[SVN] Re: linked_ri.rb: Changes for Ruby 1.9
James Gray
james at grayproductions.net
Fri Aug 29 18:36:27 UTC 2008
On Aug 28, 2008, at 4:32 PM, Charles Turner wrote:
> On Thu, 28 Aug 2008 16:14:58 -0500, James Gray wrote:
>> I know it doesn't by default. Is that true after a require
>> "enumerator" though? I haven't checked.
>
> Well, the original linked_ri.rb code has "require 'enumerator'", but
> 1.9 has no such library, so I guess the require is failing gracefully.
> Enumerators are internal in 1.9, right?
Right, but 1.9 still has the file so requires will succeed. It
doesn't provide 100% compatibility though it seems.
> So the original code proves the solution:
>
> /Library/Application
> Support/TextMate/Bundles/Ruby.tmbundle/Support/bin/linked_ri.rb:109:in
> `': undefined method `enum_with_index' for ["String"]:Array
> (NoMethodError)
>
> In 1.9, with a non-existant enumerator "required", the method is
> undefined. So a test for the presence of enum_with_index seems
> sufficient.
I've rewritten this to not use enumerator at all and committed the
change. It should work on Ruby 1.8 and 1.9.
James Edward Gray II
More information about the textmate-dev
mailing list