ri bug and bugfix

O

oinkoink

The current ri in ruby (ruby 1.8.4 (2006-05-27)) fails with some
queries. For example:

root@barnyard:/usr/local/src/ruby/ruby # ri String
/usr/local/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in `concat':
can't
convert nil into Array (TypeError)
from /usr/local/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in
`merge_in'
[further error messages deleted]

It is easy enough to fix. I commented out the 99th line of
ri_descriptions.rb and replaced
it with the following line below:

# [in ri_descriptions.rb] [also, spelling error: desscription :)]
# merge in another class desscription into this one
def merge_in(old)
merge(@class_methods, old.class_methods)
merge(@instance_methods, old.instance_methods)
merge(@attributes, old.attributes)
merge(@constants, old.constants)
merge(@includes, old.includes)
if @comment.nil? || @comment.empty?
@comment = old.comment
else
@comment << SM::Flow::RULE.new
# @comment.concat old.comment
@comment.concat(old.comment || [])
end
end

This ensured that ri didn't barf when old.comment was nil. This
isn't a show-stopper, so I don't know if I should report it on the
rubyforge bug tracker (or how to go about doing that, for that matter).

Regards, Bret
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top