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
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