From: Joel VanderWerf Date: 2006-10-13T13:42:12+09:00 Subject: Re: My .irbrc for console/irb Ross Bamford wrote: > #### And this for RI (again, from Rubygarden or someone's blog, I forget > which): > > 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 I *think* that came out of my .irbrc, but it's always missed one thing: a nice notation for class methods: irb(main):014:0> IO.ri "close" --------------------------------------------------------------- IO#close ios.close => nil ------------------------------------------------------------------------ ... irb(main):015:0> IO.ri "open" More than one method matched your request. You can refine your search by asking for information on one of: ... Of course you can always do this: irb(main):016:0> ri "IO.open" --------------------------------------------------------------- IO::open IO.open(fd, mode_string="r" ) => io IO.open(fd, mode_string="r" ) {|io| block } => obj ------------------------------------------------------------------------ -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407