TwP / inifile

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

added parameter to ignore line backslash line endings as line continuations #45

Open nickoconnor-appcorp opened 7 years ago

nickoconnor-appcorp commented 7 years ago

Hi,

I have INI files on windows platforms that regularly end with backslashes where values are folder paths - eg:

[general] Logpath=C:\Temp\path\ Logformat=name_something

This is currently treated as a line continuation, and read into the inifile instance as the value "C:\Temp\pathLogformat=name_something". To get around this i would have to escape the trailing backslash, which breaks my application.

In this PR I've added a new parameter "slash_lc" that accepts true/false and defaults to true (current behaviour). A false value allows my scenario above to work.

Example to use: IniFile.load 'test/data/line_continuation.ini', :slash_lc => false

Thanks, nicko