From: Mark Hubbart Date: 2004-10-06T05:41:53+09:00 Subject: Re: Use ri from irb ? On Wed, 6 Oct 2004 05:01:55 +0900, Michael Neumann wrote: > Its Me wrote: > > What do I need to do to use ri from within irb? I can use it fine from the > > (dos) command line. > > That's handled in Programming Ruby 2 (Pickaxe II), page 191. > > Add the following to your .irbrc file: > > def ri(*names) > system(%{ri #{names.map {|name| name.to_s}.join(" ")}}) > end Is it just me, or does that look a bit kludgy? ri itself is a ruby script, and a ruby lib. It seems to me that there should be a clean way of including the ri documentation in every object's methods... ie: irb> require 'irb/ri' ==> true irb> Kernel.docs [... paged documentation output ...] ==> Kernel irb> Kernel.docs(:puts) [...] ... and so on. This should be able to be one programatically, rather than spawning an ri process. cheers, Mark