* 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:
parent
e4c15e313d
commit
e2cf71a085
@ -1,3 +1,9 @@
|
|||||||
|
Fri Dec 4 15:21:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/rubygems: Update to RubyGems 2.5.0+ HEAD(fdab4c4).
|
||||||
|
this version includes #1396, #1397, #1398, #1399
|
||||||
|
* test/rubygems: ditto.
|
||||||
|
|
||||||
Fri Dec 4 11:22:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Dec 4 11:22:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* thread.c (rb_thread_setname): name must be ascii-compatible, as
|
* thread.c (rb_thread_setname): name must be ascii-compatible, as
|
||||||
|
@ -65,22 +65,17 @@ class Gem::BasicSpecification
|
|||||||
# Return true if this spec can require +file+.
|
# Return true if this spec can require +file+.
|
||||||
|
|
||||||
def contains_requirable_file? file
|
def contains_requirable_file? file
|
||||||
@contains_requirable_file ||= {}
|
if @ignored then
|
||||||
@contains_requirable_file[file] ||=
|
return false
|
||||||
begin
|
elsif missing_extensions? then
|
||||||
if @ignored then
|
@ignored = true
|
||||||
return false
|
|
||||||
elsif missing_extensions? then
|
|
||||||
@ignored = true
|
|
||||||
|
|
||||||
warn "Ignoring #{full_name} because its extensions are not built. " +
|
warn "Ignoring #{full_name} because its extensions are not built. " +
|
||||||
"Try: gem pristine #{name} --version #{version}"
|
"Try: gem pristine #{name} --version #{version}"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
have_file? file, Gem.suffixes
|
have_file? file, Gem.suffixes
|
||||||
end ? :yes : :no
|
|
||||||
@contains_requirable_file[file] == :yes
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_gem?
|
def default_gem?
|
||||||
|
@ -60,9 +60,7 @@ module Kernel
|
|||||||
#--
|
#--
|
||||||
# TODO request access to the C implementation of this to speed up RubyGems
|
# TODO request access to the C implementation of this to speed up RubyGems
|
||||||
|
|
||||||
spec = Gem::Specification.stubs.find { |s|
|
spec = Gem::Specification.find_active_stub_by_path path
|
||||||
s.activated? and s.contains_requirable_file? path
|
|
||||||
}
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
RUBYGEMS_ACTIVATION_MONITOR.exit
|
RUBYGEMS_ACTIVATION_MONITOR.exit
|
||||||
|
@ -89,9 +89,9 @@ class Gem::Requirement
|
|||||||
# specification, like <tt>">= 1.2"</tt>, or a simple version number,
|
# specification, like <tt>">= 1.2"</tt>, or a simple version number,
|
||||||
# like <tt>"1.2"</tt>.
|
# like <tt>"1.2"</tt>.
|
||||||
#
|
#
|
||||||
# parse("> 1.0") # => [">", "1.0"]
|
# parse("> 1.0") # => [">", Gem::Version.new("1.0")]
|
||||||
# parse("1.0") # => ["=", "1.0"]
|
# parse("1.0") # => ["=", Gem::Version.new("1.0")]
|
||||||
# parse(Gem::Version.new("1.0")) # => ["=, "1.0"]
|
# parse(Gem::Version.new("1.0")) # => ["=, Gem::Version.new("1.0")]
|
||||||
|
|
||||||
def self.parse obj
|
def self.parse obj
|
||||||
return ["=", obj] if Gem::Version === obj
|
return ["=", obj] if Gem::Version === obj
|
||||||
|
@ -175,6 +175,11 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
|
|
||||||
@@stubs_by_name = {}
|
@@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
|
# :section: Required gemspec attributes
|
||||||
|
|
||||||
@ -1027,10 +1032,10 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
|
|
||||||
def self.find_by_path path
|
def self.find_by_path path
|
||||||
path = path.dup.freeze
|
path = path.dup.freeze
|
||||||
stub = stubs.find { |spec|
|
spec = @@spec_with_requirable_file[path] ||= (stubs.find { |s|
|
||||||
spec.contains_requirable_file? path
|
s.contains_requirable_file? path
|
||||||
}
|
} || NOT_FOUND)
|
||||||
stub && stub.to_spec
|
spec.to_spec
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
@ -1044,6 +1049,13 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
stub && stub.to_spec
|
stub && stub.to_spec
|
||||||
end
|
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+.
|
# Return currently unresolved specs that contain the file matching +path+.
|
||||||
|
|
||||||
@ -1261,6 +1273,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
@@all = nil
|
@@all = nil
|
||||||
@@stubs = nil
|
@@stubs = nil
|
||||||
@@stubs_by_name = {}
|
@@stubs_by_name = {}
|
||||||
|
@@spec_with_requirable_file = {}
|
||||||
|
@@active_stub_with_requirable_file = {}
|
||||||
_clear_load_cache
|
_clear_load_cache
|
||||||
unresolved = unresolved_deps
|
unresolved = unresolved_deps
|
||||||
unless unresolved.empty? then
|
unless unresolved.empty? then
|
||||||
@ -2847,7 +2861,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
|
|||||||
end
|
end
|
||||||
|
|
||||||
warning_messages << "prerelease dependency on #{dep} is not recommended" if
|
warning_messages << "prerelease dependency on #{dep} is not recommended" if
|
||||||
prerelease_dep
|
prerelease_dep && !version.prerelease?
|
||||||
|
|
||||||
overly_strict = dep.requirement.requirements.length == 1 &&
|
overly_strict = dep.requirement.requirements.length == 1 &&
|
||||||
dep.requirement.requirements.any? do |op, version|
|
dep.requirement.requirements.any? do |op, version|
|
||||||
|
@ -88,6 +88,8 @@ class Gem::StubSpecification < Gem::BasicSpecification
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def this; self; end
|
||||||
|
|
||||||
def default_gem?
|
def default_gem?
|
||||||
@default_gem
|
@default_gem
|
||||||
end
|
end
|
||||||
|
BIN
test/rubygems/specifications/foo-0.0.1-x86-mswin32.gemspec
Normal file
BIN
test/rubygems/specifications/foo-0.0.1-x86-mswin32.gemspec
Normal file
Binary file not shown.
@ -516,7 +516,7 @@ class TestGemResolver < Gem::TestCase
|
|||||||
|
|
||||||
dependency = e.conflict.dependency
|
dependency = e.conflict.dependency
|
||||||
|
|
||||||
assert_equal 'a', dependency.name
|
assert_includes %w(a b), dependency.name
|
||||||
assert_equal req('>= 0'), dependency.requirement
|
assert_equal req('>= 0'), dependency.requirement
|
||||||
|
|
||||||
activated = e.conflict.activated
|
activated = e.conflict.activated
|
||||||
|
@ -2678,6 +2678,21 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_validate_prerelease_dependencies_with_prerelease_version
|
||||||
|
util_setup_validate
|
||||||
|
|
||||||
|
Dir.chdir @tempdir do
|
||||||
|
@a1.version = '1.0.0.beta.1'
|
||||||
|
@a1.add_runtime_dependency 'b', '~> 1.2.0.beta.1'
|
||||||
|
|
||||||
|
use_ui @ui do
|
||||||
|
@a1.validate
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_equal '', @ui.error, 'warning'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_validate_description
|
def test_validate_description
|
||||||
util_setup_validate
|
util_setup_validate
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ require "rubygems/stub_specification"
|
|||||||
|
|
||||||
class TestStubSpecification < Gem::TestCase
|
class TestStubSpecification < Gem::TestCase
|
||||||
SPECIFICATIONS = File.expand_path(File.join("..", "specifications"), __FILE__)
|
SPECIFICATIONS = File.expand_path(File.join("..", "specifications"), __FILE__)
|
||||||
FOO = File.join SPECIFICATIONS, "foo-0.0.1.gemspec"
|
FOO = File.join SPECIFICATIONS, "foo-0.0.1-x86-mswin32.gemspec"
|
||||||
BAR = File.join SPECIFICATIONS, "bar-0.0.2.gemspec"
|
BAR = File.join SPECIFICATIONS, "bar-0.0.2.gemspec"
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user