Yes, everybody and his dog has hacked his .irbrc in order to use RI and
complete methods.
You've seen it in
rubygarden and
then in wirble.
But really, typing
Object.ri "object_id"
is way too much work.
sheepman showed the way to
combine method completion and RI, and here's my improvement on it: thanks to
FastRI*1
being much faster than RI, you can discover where a method came from and get
the corresponding documentation:
Leaving the unneeded typing aside, you'd have obtained
Nothing known about Hash#inject
In other words: you'd have to know where the method comes from, that is, in which
class/module it was defined. Now, that's easy for Enumerable#inject, but did
you know about e.g. Precision#prec?
My irbrc hack looks for the method in all the ancestors of the receiver's
class, so you don't need to know where the method you knew (maybe) nothing about
(besides the name) to begin with comes from.
This is where
FastRI enters the picture: the older RI can take
over one second per lookup even when all your RI docs are cached and you don't hit the disk,
and much longer (about 5 seconds for me) for the first one.
So
>> 1.0.ri_object_id
could take over 10 seconds with RI. It's under half a second for
FastRI*2 -- and half of that time is actually spent formatting the description.