2009/2/19 Roger Pack <rogerdpack / gmail.com>:
>> irb(main):002:0> help "String#chars"
>
> Wow that is way cool and I would think unknown by most people [?].  It
> is what I have been missing somehow [?]
>
> Obviously I am still debiliated in this regard, as apparently make
> doesn't install the rdocs by default for 1.8.x?
>
> Here's some attempts at it.
>
>>> help "String#chars"
> NameError: undefined method `execute' for module `IRB::ExtendCommand::Help'
>        from (eval):4:in `instance_method'
>        from (eval):4:in `irb_help'
>        from (irb):8
>        from /home/byu_p2pweb/installs/ruby_19_trunk/bin/irb:12:in `<main>'
> irb(main):009:0> RUBY_VERSION
> => "1.9.2"
>
> irb(main):002:0>  help "String#chars"
> Nothing known about String#chars
> => nil
> irb(main):003:0> RUBY_VERSION
> => "1.8.7"
>
> irb(main):004:0> help "String#chars"
> No ri documentation found in:
>
> Was rdoc run to create documentation?
>
> Errno::EINVAL: Invalid argument - >        from c:/ruby18/lib/ruby/1.8/rdoc/usage.rb:100:in `initialize'
>        from c:/ruby18/lib/ruby/1.8/rdoc/usage.rb:100:in `open'
>        from c:/ruby18/lib/ruby/1.8/rdoc/usage.rb:100:in `usage_no_exit'
>        from c:/ruby18/lib/ruby/1.8/rdoc/usage.rb:93:in `usage'
>        from c:/ruby18/lib/ruby/1.8/rdoc/ri/ri_driver.rb:39:in
> `report_missing_documentation'
>        from c:/ruby18/lib/ruby/1.8/rdoc/ri/ri_driver.rb:25:in `initialize'
>        from c:/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require'
>        from c:/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `require'
>        from (eval):3:in `help'
>        from (irb):4
>        from 0
> irb(main):005:0> RUBY_VERSION
> => "1.8.6"
>
> Also does it work for gems?
> Also isn't it kinder slow since it uses ri not fastri?  At least it
> doesn't require a running server, though.
>
> re: http://p.ramaze.net/17901
> Nice.  Though it appears that Pathname.chdir doesn't exist, if it used
> SCRIPT_LINES__ for cacheing it would be lightning fast.  I can't
> compare with the speed of the help command since I don't yet have a
> working instance.

Sorry, I posted this before I noticed that Pathname#chdir was
deprecated (after 5 years... great timing :)
Should work fine with most other methods defined in Ruby though.
It will not be able to show any docs for the C core methods, which
makes it kind of useless unless supported by RDoc.

^ manveru