summaryrefslogtreecommitdiff
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb31
1 files changed, 17 insertions, 14 deletions
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:
#
# * <tt>gem help</tt> and <tt>gem help [command]</tt>
-# * {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
@@ -1083,6 +1080,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.
#
# Two formats for the specification are supported: