Ri, rdoc, gems, and the ruby_site directory


#1

I’m on Debian GNU/Linux, but installed from source to my /opt
directory (–prefix=/opt/ruby-1.8.4).

  • If I write some modules and want everyone at the site to be able to
    access them, should I copy them to
    /opt/ruby-1.8.4/lib/ruby/site_ruby/1.8 ?

  • After I’ve got those site-wide modules in-place, I want to make
    their docs available to everyone via the ri command. Can I then just
    do:

cd /opt/ruby-1.8.4/lib/ruby/site_ruby/1.8
rdoc --ri-site

?

  • My guess is, rdoc will ripple down through everything in that dir
    and below (including the rubygems directory I figure) looking for .rb
    (or .c) files and creating .yaml files from them. If that’s the case,
    where do the resulting .yaml files end up?

  • Now, as for using RubyGems, it looks like when I install gems, some
    docs for them get installed automatically (so, I don’t need to
    manually run “gem rdoc” I suppose). For rake, for example, these docs
    are all html files in
    /opt/ruby-1.8.4/lib/ruby/gems/1.8/doc/rake-0.7.1. But I’m guessing
    that many gems have docs in them that I’d like to read using ri. For
    those:

** How do I generate the yaml files for those gems’ files? (maybe cd
to /opt/ruby-1.8.4/lib/ruby/gems/1.8/gems and run “rdoc --ri-foo”?)

** Where would the yaml files (corresponding to the gems’ source
files) end up? (maybe in some new
/opt/ruby-1.8.4/lib/ruby/site_ruby/ri directory? Hm…)

I’m trying to write up a doc on this whole affair that might be useful
to others. Tonight’s very rough first cut is here:
http://www.simisen.com/jmg/temp/ri_rdoc.html

Thanks,
—John


#2

On 6/2/06, John G. removed_email_address@domain.invalid wrote:

[snip]

Whoops. Typo:

message_subj.sub( /ruby_site/, “site_ruby” )


#3

On 6/2/06, John G. removed_email_address@domain.invalid wrote:

[snip]

** How do I generate the yaml files for those gems’ files? (maybe cd
to /opt/ruby-1.8.4/lib/ruby/gems/1.8/gems and run “rdoc --ri-foo”?)

** Where would the yaml files (corresponding to the gems’ source
files) end up? (maybe in some new
/opt/ruby-1.8.4/lib/ruby/site_ruby/ri directory? Hm…)

Hmm… “message “Re: [PATCH] Rubygems/ri integration””:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7423
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7426
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7479


#4

On 6/2/06, I wrote:

I’m on Debian GNU/Linux, but installed from source to my /opt
directory (–prefix=/opt/ruby-1.8.4).

[snip a bunch of questions]

Ok, I figured out some of the details, and got help on the RubyGems ML
for others. I put up what I’ve learned here:

http://wiki.rubygarden.org/Ruby/page/show/RiRDocAndGems

—John


#5

Thanks! I’ve been needing that…
:_)