On Sep 15, 2004, at 2:20 PM, Joel VanderWerf wrote: > Brian Wisti wrote: >>> Or in irb: > Array.methods.sort > > <snip> > >> This is one of those situations where I kinda miss Python and its >> ability to store and later display the docstring of a function or >> class >> when requested. >> One thing at a time, I suppose. > > Why bloat the ruby executable with docstrings when you can easily add > ri to irb? After all, irb is where you want to access the docs. Here's > the relevant part of my .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}` > end > else > puts `ri #{self}` > end > end > end Very cool. Over here in Portland (where there are lots of Ruby jobs and everyone is happy) we were talking about working on an *enhanced* version of irb that would support some/all of the stuff you see here: http://ipython.scipy.org/ (scroll down to Main Features) Hasn't gone anywhere though, but I am still pretty excited about the idea. IMHO some type of irb addition which groups statements by blocks instead of by lines would be nice. So when you press 'up' you cycle through the blocks in your history rather than the individual lines. (by block I mean if .... end, do .... end, etc) Seems like it would have to be more than a drop in readline replacement, since it would have to allow multiline editing of the blocks in history. Hope that made sense, Charlie