* lib/rubygems: Update to RubyGems 2.5.0+ HEAD(fdab4c4).

this version includes #1396, #1397, #1398, #1399
* test/rubygems: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2015-12-04 06:21:53 +00:00
parent e4c15e313d
commit e2cf71a085
10 changed files with 57 additions and 27 deletions

View file

@ -175,6 +175,11 @@ class Gem::Specification < Gem::BasicSpecification
@@stubs_by_name = {}
# Sentinel object to represent "not found" stubs
NOT_FOUND = Struct.new(:to_spec, :this).new # :nodoc:
@@spec_with_requirable_file = {}
@@active_stub_with_requirable_file = {}
######################################################################
# :section: Required gemspec attributes
@ -1027,10 +1032,10 @@ class Gem::Specification < Gem::BasicSpecification
def self.find_by_path path
path = path.dup.freeze
stub = stubs.find { |spec|
spec.contains_requirable_file? path
}
stub && stub.to_spec
spec = @@spec_with_requirable_file[path] ||= (stubs.find { |s|
s.contains_requirable_file? path
} || NOT_FOUND)
spec.to_spec
end
##
@ -1044,6 +1049,13 @@ class Gem::Specification < Gem::BasicSpecification
stub && stub.to_spec
end
def self.find_active_stub_by_path path
stub = @@active_stub_with_requirable_file[path] ||= (stubs.find { |s|
s.activated? and s.contains_requirable_file? path
} || NOT_FOUND)
stub.this
end
##
# Return currently unresolved specs that contain the file matching +path+.
@ -1261,6 +1273,8 @@ class Gem::Specification < Gem::BasicSpecification
@@all = nil
@@stubs = nil
@@stubs_by_name = {}
@@spec_with_requirable_file = {}
@@active_stub_with_requirable_file = {}
_clear_load_cache
unresolved = unresolved_deps
unless unresolved.empty? then
@ -2847,7 +2861,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
end
warning_messages << "prerelease dependency on #{dep} is not recommended" if
prerelease_dep
prerelease_dep && !version.prerelease?
overly_strict = dep.requirement.requirements.length == 1 &&
dep.requirement.requirements.any? do |op, version|