[Rubygems-developers] Getting ready for release 0.9.0
Chad Fowler
chad at chadfowler.com
Wed Jun 7 16:20:48 EDT 2006
On Jun 7, 2006, at 1:57 PM, Jim Weirich wrote:
> Sorry this has taken so long.
>
Hey, you're keeping the torch burning! Don't apologize!
> I pondered long and hard over the datadir issue and finally decide to
> take a minimalist approach verify similar to Maruicio's first
> suggestion
> in http://tinyurl.com/b7yo9. I am suggesting that people use
> Config.datadir(package_name) to locate their data directory. In the
> absence of RubyGems, this will just resolve to
> File.join(Config::CONFIG['datadir'], package_name). If RubyGems is
> present, it will locate the 'data' directory in the corresponding
> versioned gem area.
>
>
> module Config
> unless Config.respond_to?(:datadir)
>
> # Return the path to the data directory associated with the
> given
> # package name. Normally this is just
> # "#{Config::CONFIG['datadir']}/#{package_name}", but may be
> # modified by packages like RubyGems to handle versioned data
> # directories.
> def Config.datadir(package_name)
> File.join(CONFIG['datadir'], package_name)
> end
>
> end
> end
>
> Notice that is carefully checks for an existing datadir method, so
> if it
> does become available natively in Ruby, this file will degrade
> gracefully.
>
> Thoughts?
>
Seems good to me. If everyone had RubyGems, we could have them
install a gem for this :)
Great stuff, Jim!
Chad
More information about the Rubygems-developers
mailing list