Thanks for opening a can of worms. If the next Ruby Conference is in
Australia, I will give a presentation on this
Documentation is not routinely installed as part of a Ruby package
installation. The commonly-used install.rb/setup.rb doesnât do it. I
think I emailed the author about it and he replied that thereâs no
standard place to install the documentation. I raised an RCR to
define a standard documentation directory. It was popular, but RCRs
need time, and Matz would like to see more detail. When the new RCR
process is in place, or perhaps before, I will write a more detailed
one.
To prove the concept, my âextensionsâ package installs documentation
with a seperate âinstall-doc.rbâ command. Anyone can use that for
their own project. It works great.
Rake has an RDoc task, so people using Rakefiles - probably more
common as time goes on as it is good technology - can provide their
users with a command to build documentation from RDoc. If and when we
are blessed with an agreed place to install documentation, then it
will be easily done with Rake.
RubyGems, as far as I know, makes no provision for installing
documentation. I was going to offer my services to the owners of this
project once it settled down a bit.
RDoc Documentation (CSS problems beware, but looks good in IE)
will soon provide a download with an installer. Using this, you will
install standard library documentation to that central directory Iâve
spoken of. Therefore one bookmark in your browser will survive all
version updates. That will be another proof of concept.
What is this central directory Iâve been talking about? The RCR
explains it (http://www.rubygarden.org/article.php?sid=319), but here
we are in brief:
Assuming /usr/local/bin/ruby - executable
/usr/local/lib/ruby/1.8/ - libraries
then /usr/local/doc/ruby/ - documentation
On my machine:
$ ls -1F /usr/local/doc/ruby/
extensions-0.2.12/ (contains full API via RDoc)
ri-1.8b/ (contains README, ChangeLog, COPYING)
ruby-1.8.0/ (same as above, but a few more scraps)
stdlib/ (contains full API via RDoc)
OK, âstdlibâ is not there yet, but it will be. âri-1.8bâ and
âruby-1.8.0â were installed there without any particular direction
from me.
Every documentation directory is versioned except for âstdlibâ, which
doesnât need it because itâs pure documentation, not software, and
because it only makes sense to have the latest copy.
Here is the code in extensions/install-doc.rb that determines where to
put documentation:
require ârbconfigâ
prefix = Config::CONFIG[âprefixâ]
rubydocdir = File.join(prefix, âdocâ, ârubyâ)
On Windows, âprefixâ would typically be âC:\Rubyâ, so ârubydocdirâ
would be âC:\Ruby\doc\rubyâ. This seems repetitive, but no more so
than the existing âC:\Ruby\lib\ruby\1.8â.
A few people on various Unix systems have reported in the past that
their directory structure doesnât look like everyone elseâs. Maybe
the above code is good for them, maybe not.
OK, so that wasnât so brief, but itâs an important issue.
Gavin
¡¡¡
On Friday, November 28, 2003, 2:11:34 AM, Gavri wrote:
As above, you donât place it in the lib area manually. Let the
installer do the work. It will decide where to put the files (almost
certainly under lib/ruby/site_ruby/1.8/iowa/).The things you download should be versioned so you can have them
sitting side by side. The runtime files arenât versioned as you can
only have one version installed at a time.
thanks gavin. there is an installer.
however i noticed that the installer didnât automatically copy any
docs. this is also the case for a few other packages i installed.
why donât installers do that? do ruby application installers never
copy docs to the ruby/docs folder. should i always do it manually?
if so, why?