how can I generate rdoc & ri documentation of the standard library? I
tried "cd /usr/local/lib/ruby; rdoc", but had to cancel it because rdoc
tried eating up all my RAM (120MB when I killed it). Is this normal, or
am I doing something wrong?
If you just let it run in the standard library, it will document
absolutely everything it finds (which is probably not what you want, as
most of the larger library modules have tons of internal classes and
methods which don't really belong in the documentation). I ran that
here last night, and it took about 15 minutes to complete.
To get something more meaningful, start in the Ruby source tree (not
the installed library) and issue the command
rdoc --ri *.c lib/*.rb
That will document (in ri form) the built-in functions and all the
direct standard library classes. It'll take a minute or two, but when
it's done, you'll be able to say
ri Array
ri CGI
ri Tempfile:
pen
and so on. In fact, on my box, you'll have at least some kind of
documentation for 325 classes and 2300 methods.
To get standard rdoc documentation in HTML format, run command
rdoc --op <somedir> *.c lib/*.rb
If you're on a Unix box, I recommend using the prettier output:
export LESS="-REX" # allow escape sequences through
ri -f ansi Array
STANDARD DISCLAIMER:
This is still a work in progress. Many of the library files have not
yet been documented in RDoc format. Some of the constructs in these
files cause RDoc to issue warnings. We're working on it.
Cheers
Dave