aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-25 19:14:49 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-25 19:14:49 +0000
commit04817ae6d3e1d898d6fbf09ad146850d26d2b404 (patch)
tree7e5482d13830cacf363d21a087b490588a960095 /lib/rubygems.rb
parentc107372597586e1ad0fea03c00a14bdd7205b5d8 (diff)
downloadruby-04817ae6d3e1d898d6fbf09ad146850d26d2b404.tar.gz
* lib/rubygems: Update to RubyGems master 612f85a. Notable changes:
Fixed installation and activation of git: and path: gems via Gem.use_gemdeps Improved documentation coverage * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb34
1 files changed, 13 insertions, 21 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 8a0d992141..7570e4ad24 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -1005,30 +1005,18 @@ module Gem
def self.use_gemdeps
return unless path = ENV['RUBYGEMS_GEMDEPS']
- path = path.dup.untaint
+ path = path.dup
- if path == "-"
- here = Dir.pwd.untaint
- start = here
+ if path == "-" then
+ require 'rubygems/util'
- begin
- while true
- path = GEM_DEP_FILES.find { |f| File.file?(f) }
-
- if path
- path = File.join here, path
- break
- end
+ Gem::Util.traverse_parents Dir.pwd do |directory|
+ dep_file = GEM_DEP_FILES.find { |f| File.file?(f) }
- Dir.chdir ".."
+ next unless dep_file
- # If we're at a toplevel, stop.
- return if Dir.pwd == here
-
- here = Dir.pwd
- end
- ensure
- Dir.chdir start
+ path = File.join directory, dep_file
+ break
end
end
@@ -1047,6 +1035,9 @@ module Gem
end
class << self
+ ##
+ # TODO remove with RubyGems 3.0
+
alias detect_gemdeps use_gemdeps # :nodoc:
end
@@ -1218,4 +1209,5 @@ Gem::Specification.load_defaults
require 'rubygems/core_ext/kernel_gem'
require 'rubygems/core_ext/kernel_require'
-Gem.detect_gemdeps
+Gem.use_gemdeps
+