diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-26 01:10:50 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-26 01:10:50 +0000 |
commit | e93d882d96cc536857e6c181b5f0194f15316b7d (patch) | |
tree | d5810ac15991fc2d4eeb19138e49ba4b892e866d /lib/rubygems/path_support.rb | |
parent | 4544b3824c8ce74e0a92c58a3167f900904f506b (diff) | |
download | ruby-e93d882d96cc536857e6c181b5f0194f15316b7d.tar.gz |
* lib/rubygems: Update to RubyGems 1.8.10. Fixes security issue in
creating ruby-format gemspecs. Fixes Gem.dir not being at the front
of Gem.path to fix uninstall and cleanup commands. Fixes gem
uninstall stopping on the first missing gem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/path_support.rb')
-rw-r--r-- | lib/rubygems/path_support.rb | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/rubygems/path_support.rb b/lib/rubygems/path_support.rb index 059e372112..0aaf2c1bed 100644 --- a/lib/rubygems/path_support.rb +++ b/lib/rubygems/path_support.rb @@ -1,5 +1,4 @@ ## -# # Gem::PathSupport facilitates the GEM_HOME and GEM_PATH environment settings # to the rest of RubyGems. # @@ -43,18 +42,16 @@ class Gem::PathSupport # Set the Gem search path (as reported by Gem.path). def path=(gpaths) - # FIX: it should be [home, *path], not [*path, home] - - gem_path = [] + gem_path = [@home] # FIX: I can't tell wtf this is doing. gpaths ||= (ENV['GEM_PATH'] || "").empty? ? nil : ENV["GEM_PATH"] - if gpaths - if gpaths.kind_of?(Array) - gem_path = gpaths.dup + if gpaths then + if gpaths.kind_of?(Array) then + gem_path.push(*gpaths) else - gem_path = gpaths.split(File::PATH_SEPARATOR) + gem_path.push(*gpaths.split(File::PATH_SEPARATOR)) end if File::ALT_SEPARATOR then @@ -62,14 +59,10 @@ class Gem::PathSupport this_path.gsub File::ALT_SEPARATOR, File::SEPARATOR end end - - gem_path << @home else - gem_path = Gem.default_path + [@home] + gem_path.push(*Gem.default_path) - if defined?(APPLE_GEM_HOME) - gem_path << APPLE_GEM_HOME - end + gem_path << APPLE_GEM_HOME if defined?(APPLE_GEM_HOME) end @path = gem_path.uniq |