rdoc: how to generate rdoc & ri documentation of standard library?

Discussion in 'Ruby' started by Andreas Schwarz, Dec 31, 2003.

  1. Hi,

    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?

    Andreas
    Andreas Schwarz, Dec 31, 2003
    #1
    1. Advertising

  2. Andreas Schwarz

    Dave Thomas Guest

    On Dec 31, 2003, at 6:11, Andreas Schwarz wrote:

    > 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::eek: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
    Dave Thomas, Dec 31, 2003
    #2
    1. Advertising

  3. Dave Thomas wrote:
    >
    > 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::eek:pen


    Ok, thanks. Where do I have to put the ri data to make it available to
    all users? I tried "rdoc -o -o /usr/local/share/ri/1.8/system ...", but
    rdoc still wrote the data to /root/.ri/.

    Maybe it would make sense to add a ri rule to the ruby makefile?

    Andreas
    Andreas Schwarz, Dec 31, 2003
    #3
  4. Andreas Schwarz

    ts Guest

    >>>>> "A" == Andreas Schwarz <> writes:

    A> Ok, thanks. Where do I have to put the ri data to make it available to
    A> all users? I tried "rdoc -o -o /usr/local/share/ri/1.8/system ...", but
    A> rdoc still wrote the data to /root/.ri/.

    rdoc --help can be helpfull :)

    svg% rdoc --help

    RDoc V1.0pr1: 2003/12/01 07:12:48 (1.1)

    [...]
    --ri-site, -R generate output for use by 'ri.' The files are
    stored in a site-wide directory, making them accessible
    to others, so special privileges are needed.

    [...]
    svg%


    Guy Decoux
    ts, Dec 31, 2003
    #4
  5. On Thu 01 Jan 2004 at 00:00:48 +0900, Dave Thomas wrote:

    > 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::eek:pen


    If I issue the command line above, I get class entries for Array and
    Hash (and probably others) that contain no methods. If I amend the
    command line to 'rdoc --ri *.c' (i.e. excluding 'lib/*.rb'), the Array
    and Hash entries get populated with their methods.

    A bug?

    Ian
    --
    Ian Macdonald | Natural laws have no pity.
    System Administrator |
    |
    http://www.caliban.org |
    |
    Ian Macdonald, Jan 1, 2004
    #5
  6. Andreas Schwarz

    Dave Thomas Guest

    On Dec 31, 2003, at 19:26, Ian Macdonald wrote:

    > If I issue the command line above, I get class entries for Array and
    > Hash (and probably others) that contain no methods. If I amend the
    > command line to 'rdoc --ri *.c' (i.e. excluding 'lib/*.rb'), the Array
    > and Hash entries get populated with their methods.
    >
    > A bug?


    Hmm.. Perhaps, but not in RDoc, exactly... The class TSort extends
    class Array, but flags it :nodoc: so it doesn't get documented
    internally. tsort should probably have used stopdoc instead.


    Cheers

    Dave
    Dave Thomas, Jan 1, 2004
    #6
  7. On 12/31/2003 10:00 AM, Dave Thomas wrote:

    > If you're on a Unix box, I recommend using the prettier output:
    >
    > export LESS="-REX" # allow escape sequences through
    > ri -f ansi Array


    less also runs natively on Windows. The home page is
    <http://www.greenwoodsoftware.com/less/>. I use it along with a port of
    groff <http://sourceforge.net/projects/gnuwin32/> all the time for
    viewing manpages.

    Regards,
    Randy.
    Randy W. Sims, Jan 1, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Teddy
    Replies:
    3
    Views:
    332
    osmium
    Jul 23, 2003
  2. Water Cooler v2

    Downloadable C Standard library documentation

    Water Cooler v2, Aug 14, 2007, in forum: C Programming
    Replies:
    1
    Views:
    364
    santosh
    Aug 14, 2007
  3. William Webber
    Replies:
    3
    Views:
    140
    james_b
    Jul 30, 2003
  4. Kenneth McDonald
    Replies:
    20
    Views:
    537
    Eric Hodel
    Feb 25, 2009
  5. Bjoern
    Replies:
    14
    Views:
    160
    Roger Pack
    Jul 8, 2009
Loading...

Share This Page