From: Lucas Nussbaum Date: 2010-04-21T14:45:22+09:00 Subject: Re: Proposing a Ruby Packaging Standard On 21/04/10 at 14:01 +0900, Suraj Kurapati wrote: > Thomas Sawyer wrote: > > On Apr 20, 1:12 pm, Suraj Kurapati wrote: > >> find my project's man/ directory from my project's executable in bin/! > > > > The standard approach would be something like: > > > > require 'rbconfig' > > dir = Config::CONFIG['datadir'] > > file = File.join(dir, 'man/man1/ember.1') > > Thanks. Based on this example, I found that there is a > Config::CONFIG['mandir'] which tells us exactly where the > system's man/ directory is located. > > > B/c of RubyGems there is an extension method that redirects to the the > > appropriate place. > > > > Config.datadir("ember") > > RubyGems does not seem to provide that functionality on my system: > > sun@yantram ~> irb > ## ruby 1.9.1p378 (2010-01-10 revision 26273) [i686-linux] > >> require 'rbconfig' > => true > >> Config.datadir("ember") > NoMethodError: undefined method `datadir' for RbConfig:Module > from (irb):2 > from /usr/bin/irb:12:in `
' > >> require 'rubygems' > => false > >> Config.datadir("ember") > NoMethodError: undefined method `datadir' for RbConfig:Module > from (irb):4 > from /usr/bin/irb:12:in `
' > >> Gem::VERSION > => "1.3.6" > > > But I think it might be a problem to tell which is which for locating > > the man/ directory. > > I guess RubyGems provides a Config.mandir(the_gem_name) method to do > this? > > >> Also, if I provide a man/ directory in my gem/tarball package like this: > >> > >> man/ > >> └── man1 > >>     ├── ember.1 > >>     └── ember.1.html > > > > Can man handle .html? > > Nope. That's just there as a backup, in case a user is on Windoze > or their system somehow lacks the `man` command. `man` does warn me > about it though when searching for manpages in my man/ directory: > > man: warning: man/man1/ember.1.html: ignoring bogus filename > > But I think it's worthy trade-off to have a HTML version available. > > > I glanced at the entries in my system and I > > noticed they are all gzipped (ending in .gz). > > Thanks for the tip. I've gzipped my Roff manpage now. > > >> Will it be copied into /usr/share/man/ by RubyGems/setup.rb/Rip and > >> friends? > > > > Setup.rb does. RubyGems does not. Not sure about Rip. > > Will RubyGems ever follow the FHS style of installation like setup.rb? > > Will setup.rb ever follow the keep-everything-together RubyGems style? > > What installation style will this Ruby Packaging Standard follow? > > So many questions... Life was easier when I only used RubyGems. :-/ I think that what is important is that we have a clear set of guidelines for Ruby library developers to follow, that allow to do both rubygems-style stuff and setup.rb-style stuff. The goal of this "standard" should not be to push one or the other solution. -- | Lucas Nussbaum | lucas@lucas-nussbaum.net http://www.lucas-nussbaum.net/ | | jabber: lucas@nussbaum.fr GPG: 1024D/023B3F4F |