ambition / lib / ambition / enumerable.rb

19 views
Skip to first unread message

Mike Barton

unread,
Apr 23, 2009, 10:49:15 AM4/23/09
to ambition.rb
Hi,

Is this line correct?

remove_method :count, :find, :find_all

I get an error when running ambition because I think Ruby Enumerable
doesn't have a count method.

Cheers

Mike

Ben Hoskings

unread,
Apr 23, 2009, 12:08:11 PM4/23/09
to ambit...@googlegroups.com
Enumerable#count is defined; to see the docs, just try a

$ ri Enumerable#count

Could you paste the error you're getting (i.e. the backtrace if it's
an exception)?

Ben

Mike Barton

unread,
Apr 23, 2009, 5:27:31 PM4/23/09
to ambition.rb
$ ri Enumerable#count
Nothing known about Enumerable#count

$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1]

Could it be specific to a Ruby version? The error I got was a method
not found.
Is this method specific to 1.9 ?

I changed the ambition code to:

remove_method :find, :find_all

Which solved the problem.

Cheers

Mike

Ben Hoskings

unread,
Apr 23, 2009, 9:04:54 PM4/23/09
to ambit...@googlegroups.com
Ahh, it'll be a ruby 1.8.7 addition. You should upgrade if you can -
what OS are you running?

Ben


Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages