TwP / inifile

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

SyntaxError @ line 558 in inifile.rb #31

Closed marcovdkuur closed 10 years ago

marcovdkuur commented 10 years ago

Hi!

I'm having some trouble since commit 9ee737177a6be5b9759de858d49436be2d5e5625. I'm using Capifony with Vagrant and receive the following error when i try to deploy.

/opt/vagrant_ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/inifile-3.0.0/lib/inifile.rb:558: undefined (?...) sequence: /\A"(.*)(?<!\\)"\z/ (SyntaxError)
from /opt/vagrant_ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/capifony-2.8.0/lib/capifony_symfony2.rb:6

Looks like the following line is giving trouble:

self.value = $1 if value =~ %r/\A"(.*)(?<!\\)"\z/m

Is it a bug in inifile?

TwP commented 10 years ago

The inifile gem is not compatible with ruby 1.8. That particular regular expression is using negative look-behind which is only supported in ruby 1.9 and higher.

marcovdkuur commented 10 years ago

Thank you, in that case i'm going to update Ruby

marcovdkuur commented 10 years ago

Nevertheless, some backwards compatibility would we awesome.

TwP commented 10 years ago

This was a major version bump to 3.0 indicating that it has backwards incompatible changes. You can use the previous version for ruby 1.8 applications. But the lack of negative look-behind in the ruby 1.8 regular expression engine prohibits these changes from being back ported to a ruby 1.8 compatible version.