The inflector seem to be broken in active_support 3.0.4 and 3.0.5.rc1 irb(main):001:0> require ''rubygems'' => true irb(main):002:0> require ''active_support'' => true irb(main):003:0> require ''active_support/core_ext/string'' => true irb(main):004:0> "test".pluralize => "test" irb(main):005:0> using active_support 3.0.3 or earlier correctly returns "tests" for the above. It seems hard to believe that this is fundamentally broken, but I can''t see what I''m doing wrong. This surfaced in my (now broken) script that uses the ''mail'' gem which in turns require active_support etc. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Loading development environment (Rails 3.0.4) ruby-1.9.2-p0 > "test".pluralize => "tests" Looks ok here. On Thu, Feb 24, 2011 at 1:48 AM, Gary Doades <gpd@gpdnet.co.uk> wrote:> The inflector seem to be broken in active_support 3.0.4 and 3.0.5.rc1 > > irb(main):001:0> require ''rubygems'' > => true > irb(main):002:0> require ''active_support'' > => true > irb(main):003:0> require ''active_support/core_ext/string'' > => true > irb(main):004:0> "test".pluralize > => "test" > irb(main):005:0> > > using active_support 3.0.3 or earlier correctly returns "tests" for > the above. > > It seems hard to believe that this is fundamentally broken, but I > can''t see what I''m doing wrong. > > This surfaced in my (now broken) script that uses the ''mail'' gem which > in turns require active_support etc. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
It seems you need to include active_support/inflections too: odd:~ $ irb>> require ''active_support/core_ext/string/inflections''=> true>> ''test''.pluralize=> "test">> require ''active_support/inflections''=> true>> ''test''.pluralize=> "tests" Don''t know the reason this changed. Everything related with inflections is now required in ''active_support/inflector'', So I suggest require''ing that. rgrds, Jan On 24 Feb 2011, at 22:35, Andrew Kaspick wrote:> Loading development environment (Rails 3.0.4) > ruby-1.9.2-p0 > "test".pluralize > => "tests" > > Looks ok here. > > On Thu, Feb 24, 2011 at 1:48 AM, Gary Doades <gpd@gpdnet.co.uk> wrote: >> The inflector seem to be broken in active_support 3.0.4 and 3.0.5.rc1 >> >> irb(main):001:0> require ''rubygems'' >> => true >> irb(main):002:0> require ''active_support'' >> => true >> irb(main):003:0> require ''active_support/core_ext/string'' >> => true >> irb(main):004:0> "test".pluralize >> => "test" >> irb(main):005:0> >> >> using active_support 3.0.3 or earlier correctly returns "tests" for >> the above. >> >> It seems hard to believe that this is fundamentally broken, but I >> can''t see what I''m doing wrong. >> >> This surfaced in my (now broken) script that uses the ''mail'' gem which >> in turns require active_support etc. >> >> -- >> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. >> To post to this group, send email to rubyonrails-core@googlegroups.com. >> To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. >> For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. >> >> > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On 24/02/2011 9:50 PM, Jan De Poorter - SumoCoders wrote:> It seems you need to include active_support/inflections too: > > odd:~ $ irb >>> require ''active_support/core_ext/string/inflections'' > => true >>> ''test''.pluralize > => "test" >>> require ''active_support/inflections'' > => true >>> ''test''.pluralize > => "tests" > > Don''t know the reason this changed. Everything related with inflections is now required in ''active_support/inflector'', So I suggest require''ing that. > > rgrds, > Jan >Yeah, it''s not me that''s requiring activesupport. I''m sure it works OK in rails because rails has changed to (or possibly always did) accommodate the changed activesupport behaviour. There are quiet a few other gems that use activesupport outside of rails and many of those are now broken. I''m including the ''mail'' gem into my (non-rails) script and the mail gem is including activesupport. Is there a sound reason for this behaviour change from 3.0.3 to 3.0.4 onwards? It seems that there will be a lot of people caught out by this. The Sequel library seems well broken when using activesupport in a non-rails script. Regards, Gary.> On 24 Feb 2011, at 22:35, Andrew Kaspick wrote: > >> Loading development environment (Rails 3.0.4) >> ruby-1.9.2-p0> "test".pluralize >> => "tests" >> >> Looks ok here. >> >> On Thu, Feb 24, 2011 at 1:48 AM, Gary Doades<gpd@gpdnet.co.uk> wrote: >>> The inflector seem to be broken in active_support 3.0.4 and 3.0.5.rc1 >>> >>> irb(main):001:0> require ''rubygems'' >>> => true >>> irb(main):002:0> require ''active_support'' >>> => true >>> irb(main):003:0> require ''active_support/core_ext/string'' >>> => true >>> irb(main):004:0> "test".pluralize >>> => "test" >>> irb(main):005:0> >>> >>> using active_support 3.0.3 or earlier correctly returns "tests" for >>> the above. >>> >>> It seems hard to believe that this is fundamentally broken, but I >>> can''t see what I''m doing wrong. >>> >>> This surfaced in my (now broken) script that uses the ''mail'' gem which >>> in turns require active_support etc. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. >>> To post to this group, send email to rubyonrails-core@googlegroups.com. >>> To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. >>> For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. >> To post to this group, send email to rubyonrails-core@googlegroups.com. >> To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. >> For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. >>-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.