diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 06:52:18 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 06:52:18 +0000 |
commit | 9694bb8cac12969300692dac5a1cf7aa4e3a46cd (patch) | |
tree | c3cb423d701f7049ba9382de052e2a937cd1302d /lib/rubygems/path_support.rb | |
parent | 3f606b7063fc7a8b191556365ad343a314719a8d (diff) |
* lib/rubygems*: Updated to RubyGems 2.0
* test/rubygems*: ditto.
* common.mk (prelude): Updated for RubyGems 2.0 source rearrangement.
* tool/change_maker.rb: Allow invalid UTF-8 characters in source
files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37976 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, 14 insertions, 7 deletions
diff --git a/lib/rubygems/path_support.rb b/lib/rubygems/path_support.rb index 0aaf2c1bed..059e372112 100644 --- a/lib/rubygems/path_support.rb +++ b/lib/rubygems/path_support.rb @@ -1,4 +1,5 @@ ## +# # Gem::PathSupport facilitates the GEM_HOME and GEM_PATH environment settings # to the rest of RubyGems. # @@ -42,16 +43,18 @@ class Gem::PathSupport # Set the Gem search path (as reported by Gem.path). def path=(gpaths) - gem_path = [@home] + # FIX: it should be [home, *path], not [*path, home] + + gem_path = [] # FIX: I can't tell wtf this is doing. gpaths ||= (ENV['GEM_PATH'] || "").empty? ? nil : ENV["GEM_PATH"] - if gpaths then - if gpaths.kind_of?(Array) then - gem_path.push(*gpaths) + if gpaths + if gpaths.kind_of?(Array) + gem_path = gpaths.dup else - gem_path.push(*gpaths.split(File::PATH_SEPARATOR)) + gem_path = gpaths.split(File::PATH_SEPARATOR) end if File::ALT_SEPARATOR then @@ -59,10 +62,14 @@ class Gem::PathSupport this_path.gsub File::ALT_SEPARATOR, File::SEPARATOR end end + + gem_path << @home else - gem_path.push(*Gem.default_path) + gem_path = Gem.default_path + [@home] - gem_path << APPLE_GEM_HOME if defined?(APPLE_GEM_HOME) + if defined?(APPLE_GEM_HOME) + gem_path << APPLE_GEM_HOME + end end @path = gem_path.uniq |