From: Joel VanderWerf Date: 2004-02-06T04:46:19+09:00 Subject: Re: Irb Ri integration (Was: An assimilators guide to Python?) Charles Comstock wrote: > Now that we have alot of the standard docs in ri format available in > general do we have any integration between ri and irb? That would be > nice to be able to easily call them from within irb. I mean I suppose > you could just call `ri Array` or whatever, but nonetheless it seems > some integration is possible. Put something this in your .irbrc file: ==== .irbrc ==== def ri arg puts `ri #{arg}` end class Module def ri(meth=nil) if meth if instance_methods(false).include? meth.to_s puts `ri #{self}##{meth}` else super end else puts `ri #{self}` end end end =============== Then you can do: irb> String.ri irb> ri String # same as above irb> String.ri 'reverse' irb> ri 'File.new'