99require 'thread'
1010
1111module Gem
12- VERSION = '2.4.8 '
12+ VERSION = '2.5.0 '
1313end
1414
1515# Must be first since it unloads the prelude from 1.9.2
@@ -26,12 +26,12 @@ module Gem
2626# For user documentation, see:
2727#
2828# * <tt>gem help</tt> and <tt>gem help [command]</tt>
29- # * {RubyGems User Guide}[http://docs .rubygems.org/read/book/1 ]
30- # * {Frequently Asked Questions}[http://docs .rubygems.org/read/book/3 ]
29+ # * {RubyGems User Guide}[http://guides .rubygems.org/]
30+ # * {Frequently Asked Questions}[http://guides .rubygems.org/faqs ]
3131#
3232# For gem developer documentation see:
3333#
34- # * {Creating Gems}[http://docs .rubygems.org/read/chapter/5 ]
34+ # * {Creating Gems}[http://guides .rubygems.org/make-your-own-gem ]
3535# * Gem::Specification
3636# * Gem::Version for version dependency notes
3737#
@@ -156,6 +156,7 @@ module Gem
156156 @@win_platform = nil
157157
158158 @configuration = nil
159+ @gemdeps = nil
159160 @loaded_specs = { }
160161 LOADED_SPECS_MUTEX = Mutex . new
161162 @path_to_default_spec_map = { }
@@ -184,13 +185,9 @@ def self.try_activate path
184185 # or if it was ambiguous (and thus unresolved) the code in our custom
185186 # require will try to activate the more specific version.
186187
187- spec = Gem ::Specification . find_inactive_by_path path
188-
189- unless spec
190- spec = Gem ::Specification . find_by_path path
191- return true if spec && spec . activated?
192- return false
193- end
188+ spec = Gem ::Specification . find_by_path path
189+ return false unless spec
190+ return true if spec . activated?
194191
195192 begin
196193 spec . activate
@@ -433,7 +430,7 @@ def self.find_files(glob, check_load_path=true)
433430
434431 files = find_files_from_load_path glob if check_load_path
435432
436- files . concat Gem ::Specification . map { |spec |
433+ files . concat Gem ::Specification . stubs . map { |spec |
437434 spec . matches_for_glob ( "#{ glob } #{ Gem . suffix_pattern } " )
438435 } . flatten
439436
@@ -598,7 +595,7 @@ def self.load_yaml
598595
599596 unless test_syck
600597 begin
601- gem 'psych' , '~> 1.2' , ' >= 1.2.1'
598+ gem 'psych' , '>= 1.2.1'
602599 rescue Gem ::LoadError
603600 # It's OK if the user does not have the psych gem installed. We will
604601 # attempt to require the stdlib version
@@ -1052,7 +1049,7 @@ def self.use_gemdeps path = nil
10521049 end
10531050
10541051 rs = Gem ::RequestSet . new
1055- rs . load_gemdeps path
1052+ @gemdeps = rs . load_gemdeps path
10561053
10571054 rs . resolve_current . map do |s |
10581055 sp = s . full_spec
@@ -1082,6 +1079,12 @@ class << self
10821079
10831080 attr_reader :loaded_specs
10841081
1082+ ##
1083+ # GemDependencyAPI object, which is set when .use_gemdeps is called.
1084+ # This contains all the information from the Gemfile.
1085+
1086+ attr_reader :gemdeps
1087+
10851088 ##
10861089 # Register a Gem::Specification for default gem.
10871090 #
0 commit comments