From: Massimiliano Mirra Date: 2002-01-20T00:19:19+09:00 Subject: Location of Ruby modules in the filesystem I know Dave has set up a wiki page on this. Hopefully he will forgive if I bring the question back to the list to try and gather some more responses. I think it is a basic need if we wish to finally benefit from goodies like package management for users (versus system-wide only) and code-accessible docstrings. Here is my setup. I'd like people to share theirs and comment on what could be the most useful one. (Note that changing something does not imply changing one's system dirs, just choosing where goes what.) * Modules which I install and want to be available to every user in the system go to: - /usr/lib/ruby/1.6/foo.rb - /usr/lib/ruby/1.6/foo/foo.rb ...where /usr/lib/ruby/1.6 = Config::CONFIG['rubylibdir'] (The above two are reserved for the modules packaged as packages for my Linux distribution.) - /usr/local/lib/site_ruby/1.6/foo.rb - /usr/local/lib/site_ruby/1.6/foo/foo.rb ...where /usr/local/lib/site_ruby == Config::CONFIG['sitedir'] and /usr/local/lib/site_ruby/1.6 == Config::CONFIG['sitelibdir']. (This is were I manually install most packages coming from RAA.) * Modules which I install and want to be available to me only: - $HOME/lib/ruby/foo.rb - $HOME/lib/ruby/foo/foo.rb (I have `` export RUBYLIB="~/lib/ruby" '' in my .bash_profile) * My additions to builtins and standard library, available to me only: - $HOME/src/ruby-additions/string.rb To bring it into the lib path, I have this symbolic link to ruby-additions: - $HOME/lib/ruby/extra -> $HOME/src/ruby-additions ...and require my additions like this (Jack Dempsey you might be interested ;-) ): require 'extra/string.rb' (I generally keep my require-able code separate from what I install by creating links in the $HOME/lib/ruby dir to directories in $HOME/src.) * Documentation: /usr/share/doc/foo (This is where the distribution's package manager installs documentation for packaged ruby modules.) It seems that there is no standard place for installing documentation of modules from RAA. For the rpkg packaging system, I set by default: /usr/local/lib/site_ruby/docs/foo ...which means Config::CONFIG['sitelibdir']/docs/foo This sounds Linux-centric because that's what I run. Please, if you run Windows, Mac or other platforms, your opinion is just as important. Massimiliano