summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-12 15:11:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-12 15:11:10 +0000
commit04e68d0107460575a86cc427338eae436be16286 (patch)
tree21d6239b192f81e58fdfd09959e613dffd79ce9a /lib
parent614619031b6d34d12f7bf2752c24eadefb9a8f8f (diff)
* ruby.c (ruby_init_loadpath_safe): mark initial load paths.
* gem_prelude.rb (push_all_highest_version_gems_on_load_path): search insertion position by initial load path mark. * lib/rubygems.rb (Gem.load_path_insert_index): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems.rb18
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index dd086bc821..d0c82970eb 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -254,8 +254,6 @@ module Gem
File.join spec.full_gem_path, path
end
- sitelibdir = ConfigMap[:sitelibdir]
-
# gem directories must come after -I and ENV['RUBYLIB']
insert_index = load_path_insert_index
@@ -570,23 +568,9 @@ module Gem
##
# The index to insert activated gem paths into the $LOAD_PATH.
- #
- # Defaults to the site lib directory unless gem_prelude.rb has loaded paths,
- # then it inserts the activated gem's paths before the gem_prelude.rb paths
- # so you can override the gem_prelude.rb default $LOAD_PATH paths.
def self.load_path_insert_index
- index = $LOAD_PATH.index ConfigMap[:sitelibdir]
-
- $LOAD_PATH.each_with_index do |path, i|
- if path.instance_variables.include?(:@gem_prelude_index) or
- path.instance_variables.include?('@gem_prelude_index') then
- index = i
- break
- end
- end
-
- index
+ $LOAD_PATH.index {|path| path.instance_variable_defined?(:@gem_prelude_index)}
end
##