Forum: Ruby Irb documentation queries?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Benjamin J. Racine (Guest)
on 2009-01-13 20:34
(Received via mailing list)
Hello all,

I am coming from python and loving ruby (the language), but trying to
figure out some of the tools/capabilities.

Would anyone be so kind as to tell me whether irb has a way of seeing
documentation strings in the source code (as in ipython)?

Many thanks,

Ben Racine
badboy (Guest)
on 2009-01-13 20:39
(Received via mailing list)
Benjamin J. Racine schrieb:
> Hello all,
>
> I am coming from python and loving ruby (the language), but trying to figure out some of 
the tools/capabilities.
>
> Would anyone be so kind as to tell me whether irb has a way of seeing documentation 
strings in the source code (as in ipython)?
>
> Many thanks,
>
> Ben Racine
>
type
   help name
for the documentation or use
   ri names
on command-line

for example:
   $ ri 'Array::[]'
or
   irb> help 'Array::[]'

or install fastri:
   http://eigenclass.org/hiki/fastri
it's faster ;)
Albert S. (Guest)
on 2009-01-14 15:34
Benjamin J. Racine wrote:
> Would anyone be so kind as to tell me whether irb has a way of seeing
> documentation strings in the source code (as in ipython)?

No, it's not possible. Although in Ruby the documentation is embedded in
the source code, it's not something the interpreter/compiler really
sees. There's an external tool you use to call up this documentation.
This topic is locked and can not be replied to.