From: "Mauricio Fernández" Date: 2004-08-28T03:02:45+09:00 Subject: Re: package glade files On Sat, Aug 28, 2004 at 01:39:44AM +0900, Masao Mutoh wrote: > Usually, I put it on /usr/share/app_dir/glade/ (Fedora). > This rule is used by many applications which use Glade. > > You can get "/usr/share" from Config::CONFIG["datadir"]. > > ruby -rrbconfig -e "p Config::CONFIG['datadir']" > > Aoki-san's setup.rb supports data/ directory for data > files (pixmaps, icons, locale data ...). > > rpa-base/gem don't have this feature? rpa-base works like setup.rb in this regard --- since it installs into $prefix directly, that is supported easily: the associated "helper" is installdata which will by default copy the contents of data/ to File.join(::Config::CONFIG["datadir"], "share"), exactly like setup.rb. RubyGems doesn't really support per-app data currently but I can think of the following ways to make it work without resorting to nasty tricks involving __FILE__: * provide a Gem-aware (but not gem-dependent!) module in the standard Ruby lib., which would provide a functionality similar to rbconfig's CONFIG['datadir'], while inferring (if needed) the correct gemdir to use, etc... * perform some (heavy!) "file access magic" in RubyGems: i.e. have RubyGems redefine several (singleton) methods from IO, File, etc to perform some transparent mapping of the data files at runtime. Both approaches seem tricky, though. -- Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com