From 68ab369dd714aecfb47ea49477a9edb0fc37d1d4 Mon Sep 17 00:00:00 2001 From: drbrain Date: Mon, 24 Dec 2007 23:28:35 +0000 Subject: Fix some test failures in RubyGems. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/rubygems.rb b/lib/rubygems.rb index cc8066858..e25e05a3b 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -345,9 +345,15 @@ module Gem end sitelibdir = ConfigMap[:sitelibdir] + sitelibdir_index = $LOAD_PATH.index sitelibdir - # gem directories must come after -I and ENV['RUBYLIB'] - $:.insert($:.index(sitelibdir), *require_paths) + if sitelibdir_index then + # gem directories must come after -I and ENV['RUBYLIB'] + $LOAD_PATH.insert(sitelibdir_index, *require_paths) + else + # we are probably testing in core, -I and RUBYLIB don't apply + $LOAD_PATH.unshift(*require_paths) + end # Now autorequire if autorequire && spec.autorequire then # DEPRECATED -- cgit