From 7bf7a4a33be8387d9ff1ddfb762f97caeb8021f5 Mon Sep 17 00:00:00 2001 From: hsbt Date: Wed, 1 Jul 2015 21:50:14 +0000 Subject: * lib/rubygems: Update to RubyGems HEAD(c202db2). this version contains many enhancements see http://git.io/vtNwF * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems.rb | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'lib/rubygems.rb') diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 817805c1f4..7af0694402 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -9,7 +9,7 @@ require 'rbconfig' require 'thread' module Gem - VERSION = '2.4.8' + VERSION = '2.5.0' end # Must be first since it unloads the prelude from 1.9.2 @@ -26,12 +26,12 @@ require 'rubygems/errors' # For user documentation, see: # # * gem help and gem help [command] -# * {RubyGems User Guide}[http://docs.rubygems.org/read/book/1] -# * {Frequently Asked Questions}[http://docs.rubygems.org/read/book/3] +# * {RubyGems User Guide}[http://guides.rubygems.org/] +# * {Frequently Asked Questions}[http://guides.rubygems.org/faqs] # # For gem developer documentation see: # -# * {Creating Gems}[http://docs.rubygems.org/read/chapter/5] +# * {Creating Gems}[http://guides.rubygems.org/make-your-own-gem] # * Gem::Specification # * Gem::Version for version dependency notes # @@ -156,6 +156,7 @@ module Gem @@win_platform = nil @configuration = nil + @gemdeps = nil @loaded_specs = {} LOADED_SPECS_MUTEX = Mutex.new @path_to_default_spec_map = {} @@ -184,13 +185,9 @@ module Gem # or if it was ambiguous (and thus unresolved) the code in our custom # require will try to activate the more specific version. - spec = Gem::Specification.find_inactive_by_path path - - unless spec - spec = Gem::Specification.find_by_path path - return true if spec && spec.activated? - return false - end + spec = Gem::Specification.find_by_path path + return false unless spec + return true if spec.activated? begin spec.activate @@ -433,7 +430,7 @@ module Gem files = find_files_from_load_path glob if check_load_path - files.concat Gem::Specification.map { |spec| + files.concat Gem::Specification.stubs.map { |spec| spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}") }.flatten @@ -598,7 +595,7 @@ module Gem unless test_syck begin - gem 'psych', '~> 1.2', '>= 1.2.1' + gem 'psych', '>= 1.2.1' rescue Gem::LoadError # It's OK if the user does not have the psych gem installed. We will # attempt to require the stdlib version @@ -1052,7 +1049,7 @@ module Gem end rs = Gem::RequestSet.new - rs.load_gemdeps path + @gemdeps = rs.load_gemdeps path rs.resolve_current.map do |s| sp = s.full_spec @@ -1082,6 +1079,12 @@ module Gem attr_reader :loaded_specs + ## + # GemDependencyAPI object, which is set when .use_gemdeps is called. + # This contains all the information from the Gemfile. + + attr_reader :gemdeps + ## # Register a Gem::Specification for default gem. # -- cgit v1.2.3