From fbf59bdbea63efd34ccc144e648467d2f52e7345 Mon Sep 17 00:00:00 2001 From: drbrain Date: Sat, 10 Nov 2007 07:48:56 +0000 Subject: Import RubyGems trunk revision 1493. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rbconfig/datadir.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/rbconfig/datadir.rb (limited to 'lib/rbconfig') diff --git a/lib/rbconfig/datadir.rb b/lib/rbconfig/datadir.rb new file mode 100644 index 0000000000..5b8f07754a --- /dev/null +++ b/lib/rbconfig/datadir.rb @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby +#-- +# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. +# All rights reserved. +# See LICENSE.txt for permissions. +#++ + + +module Config + + # Only define datadir if it doesn't already exist. + 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 -- cgit v1.2.3