summaryrefslogtreecommitdiff
path: root/gem_prelude.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-21 10:00:48 (GMT)
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-21 10:00:48 (GMT)
commit8f1f47a072c5044f3a24ab63afb3be6bf951f0c3 (patch)
tree39d16717c69dacc8c46d2468a29dd80da1b6da6a /gem_prelude.rb
parentc6a24c45f8eb8f3e64dedaec492eaabfd5ec5ddc (diff)
* gem_prelude.rb (Gem.default_dir and misc.): use rubylibprefix.
follows the chagne in r23368. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gem_prelude.rb')
-rw-r--r--gem_prelude.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/gem_prelude.rb b/gem_prelude.rb
index 4eb0e4e..65f3481 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -24,6 +24,7 @@ if defined?(Gem) then
ConfigMap = {
:sitedir => RbConfig::CONFIG["sitedir"],
:ruby_version => RbConfig::CONFIG["ruby_version"],
+ :rubylibprefix => RbConfig::CONFIG["rubylibprefix"],
:libdir => RbConfig::CONFIG["libdir"],
:sitelibdir => RbConfig::CONFIG["sitelibdir"],
:arch => RbConfig::CONFIG["arch"],
@@ -105,12 +106,8 @@ if defined?(Gem) then
if defined? RUBY_FRAMEWORK_VERSION then
File.join File.dirname(ConfigMap[:sitedir]), 'Gems',
ConfigMap[:ruby_version]
- elsif RUBY_VERSION > '1.9' then
- File.join(ConfigMap[:libdir], ConfigMap[:ruby_install_name], 'gems',
- ConfigMap[:ruby_version])
else
- File.join(ConfigMap[:libdir], ruby_engine, 'gems',
- ConfigMap[:ruby_version])
+ ConfigMap[:sitelibdir].sub(%r'/site_ruby/(?=[^/]+)', '/gems/')
end
end
@@ -218,8 +215,7 @@ if defined?(Gem) then
undef_method :gem if method_defined? :gem
end
- $".delete File.join(Gem::ConfigMap[:libdir],
- Gem::ConfigMap[:ruby_install_name],
+ $".delete File.join(Gem::ConfigMap[:rubylibprefix],
Gem::ConfigMap[:ruby_version], 'rubygems.rb')
require 'rubygems'
@@ -342,7 +338,7 @@ if defined?(Gem) then
begin
Gem.push_all_highest_version_gems_on_load_path
- $" << File.join(Gem::ConfigMap[:libdir], Gem::ConfigMap[:ruby_install_name],
+ $" << File.join(Gem::ConfigMap[:rubylibprefix],
Gem::ConfigMap[:ruby_version], "rubygems.rb")
rescue Exception => e
puts "Error loading gem paths on load path in gem_prelude"