Issue #5 new

Inflector doesn't work under Ruby 2.0

Michael Granger
repo owner created an issue

The way the inflector is added to instances doesn't work under Ruby 2, in which immediate objects are apparently frozen:

  1) Linguistics::EN::Conjunctions don't use a penultimate separator if it's turned off
     Failure/Error: TEST_ITEMS.en.conjunction( :penultimate => false ).should ==
       can't modify frozen Fixnum
     # ./lib/linguistics.rb:191:in `block (2 levels) in make_inflector_mixin'
     # ./lib/linguistics/en/conjunctions.rb:165:in `block in conjunction'
     # ./lib/linguistics/en/conjunctions.rb:176:in `[]'
     # ./lib/linguistics/en/conjunctions.rb:176:in `block in conjunction'
     # ./lib/linguistics/en/conjunctions.rb:176:in `collect!'
     # ./lib/linguistics/en/conjunctions.rb:176:in `conjunction'
     # ./spec/linguistics/en/conjunctions_spec.rb:32:in `block (2 levels) in <top (required)>'

I'll need to rethink the way the inflector works, possibly using different strategies for 1.9 and 2.0.

Comments (0)

  1. Log in to comment