TwP / inifile

Native Ruby package for reading and writing INI files
http://codeforpeople.rubyforge.org/inifile
95 stars 47 forks source link

inifile raise an error while parsing a value containing the "=" #26

Closed fabiomux closed 10 years ago

fabiomux commented 10 years ago

As stated in the title here is the error:

/usr/lib/ruby/gems/1.9.1/gems/inifile-2.0.2/lib/inifile.rb:523:in `parse_error': Could not parse line: "Exec=/usr/lib/chromium/chromium --profile-directory=Default --app-id=ihmgiclibbndffejedjimfjmfoabpcke" (IniFile::Error)

Everything works fine except for this row which can't be parsed, i tried to find where there error is generated and seems that applying the comments as below in the parse! method it works:

...
     # look for the separator between property name and value
      elsif scanner.scan(%r/#{@param}/)

#         if property.empty?
          property = string.strip
          string.slice!(0, string.length)
#         else
#     p property
#           parse_error
#         end

      # look for the start of a new section
...