Method: PDK::Config::IniFile::IniFileImpl.parse
- Defined in:
- lib/pdk/config/ini_file.rb
.parse(config_fh) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/pdk/config/ini_file.rb', line 74 def self.parse(config_fh) config = new([DefaultSection.new]) config_fh.each_line do |line| case line.chomp when /^(\s*)\[([[:word:]]+)\](\s*)$/ config.append(SectionLine.new($1, $2, $3)) when /^(\s*)([[:word:]]+)(\s*=\s*)(.*?)(\s*)$/ config.append(SettingLine.new($1, $2, $3, $4, $5)) else config.append(Line.new(line)) end end config end |