* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.3.

Please see entries of 2.6.3 on
  https://github.com/rubygems/rubygems/blob/master/History.txt

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2016-04-06 06:01:14 +00:00
Родитель ea736d55f9
Коммит 469bac0f92
31 изменённых файлов: 212 добавлений и 187 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Wed Apr 6 15:00:27 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.3.
Please see entries of 2.6.3 on
https://github.com/rubygems/rubygems/blob/master/History.txt
Wed Apr 6 14:13:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (rb_cv_lgamma_r_m0): check if lgamma_r(-0.0)

Просмотреть файл

@ -10,7 +10,7 @@ require 'rbconfig'
require 'thread'
module Gem
VERSION = '2.6.2'
VERSION = '2.6.3'
end
# Must be first since it unloads the prelude from 1.9.2
@ -374,8 +374,9 @@ module Gem
when Array
unless Gem::Deprecate.skip
warn <<-eowarn
Array values in the parameter are deprecated. Please use a String or nil.
An Array was passed in from #{caller[3]}
Array values in the parameter to `Gem.paths=` are deprecated.
Please use a String or nil.
An Array (#{env.inspect}) was passed in from #{caller[3]}
eowarn
end
target[k] = v.join File::PATH_SEPARATOR

Просмотреть файл

@ -306,6 +306,8 @@ class Gem::BasicSpecification
raise NotImplementedError
end
def this; self; end
private
def have_extensions?; !extensions.empty?; end
@ -323,5 +325,4 @@ class Gem::BasicSpecification
false
end
end
end

Просмотреть файл

@ -36,52 +36,6 @@ class Gem::Commands::InstallCommand < Gem::Command
add_version_option
add_prerelease_option "to be installed. (Only for listed gems)"
add_option(:"Install/Update", '-g', '--file [FILE]',
'Read from a gem dependencies API file and',
'install the listed gems') do |v,o|
v = Gem::GEM_DEP_FILES.find do |file|
File.exist? file
end unless v
unless v then
message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ', '})"
raise OptionParser::InvalidArgument,
"cannot find gem dependencies file #{message}"
end
o[:gemdeps] = v
end
add_option(:"Install/Update", '--without GROUPS', Array,
'Omit the named groups (comma separated)',
'when installing from a gem dependencies',
'file') do |v,o|
o[:without_groups].concat v.map { |without| without.intern }
end
add_option(:"Install/Update", '--default',
'Add the gem\'s full specification to',
'specifications/default and extract only its bin') do |v,o|
o[:install_as_default] = v
end
add_option(:"Install/Update", '--explain',
'Rather than install the gems, indicate which would',
'be installed') do |v,o|
o[:explain] = v
end
add_option(:"Install/Update", '--[no-]lock',
'Create a lock file (when used with -g/--file)') do |v,o|
o[:lock] = v
end
add_option(:"Install/Update", '--[no-]suggestions',
'Suggest alternates when gems are not found') do |v,o|
o[:suggest_alternate] = v
end
@installed_specs = []
end

Просмотреть файл

@ -66,7 +66,7 @@ permission to.
say "Owners for gem: #{name}"
owners.each do |owner|
say "- #{owner['email']}"
say "- #{owner['email'] || owner['handle'] || owner['id']}"
end
end
end
@ -97,4 +97,3 @@ permission to.
end
end

Просмотреть файл

@ -92,8 +92,8 @@ extensions will be restored.
spec.extensions and not spec.extensions.empty?
end
else
get_all_gem_names.map do |gem_name|
Gem::Specification.find_all_by_name gem_name, options[:version]
get_all_gem_names.sort.map do |gem_name|
Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse
end.flatten
end

Просмотреть файл

@ -247,7 +247,7 @@ is too hard to use.
spec_summary entry, spec
end
def entry_versions entry, name_tuples, platforms
def entry_versions entry, name_tuples, platforms, specs
return unless options[:versions]
list =
@ -256,7 +256,16 @@ is too hard to use.
else
platforms.sort.reverse.map do |version, pls|
if pls == [Gem::Platform::RUBY] then
version
if options[:domain] == :remote || specs.all? { |spec| spec.is_a? Gem::Source }
version
else
spec = specs.select { |spec| spec.version == version }
if spec.first.default_gem?
"default: #{version}"
else
version
end
end
else
ruby = pls.delete Gem::Platform::RUBY
platform_list = [ruby, *pls.sort].compact
@ -277,7 +286,7 @@ is too hard to use.
entry = [name_tuples.first.name]
entry_versions entry, name_tuples, platforms
entry_versions entry, name_tuples, platforms, specs
entry_details entry, detail_tuple, specs, platforms
entry.join

Просмотреть файл

@ -104,7 +104,7 @@ module Kernel
# Ok, now find a gem that has no conflicts, starting
# at the highest version.
valid = found_specs.reject { |s| s.has_conflicts? }.last
valid = found_specs.reject { |s| s.has_conflicts? }.first
unless valid then
le = Gem::LoadError.new "unable to find a version of '#{names.first}' to activate"

Просмотреть файл

@ -286,9 +286,7 @@ class Gem::Dependency
}
end
# `stubs_for` returns oldest first, but `matching_specs` is supposed to
# return newest first, so just reverse the list
matches.reverse
matches
end
##
@ -307,18 +305,10 @@ class Gem::Dependency
specs = Gem::Specification.stubs_for name
if specs.empty?
total = Gem::Specification.stubs.size
msg = "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n".dup
raise Gem::MissingSpecError.new name, requirement
else
specs = specs.map(&:full_name)
msg = "Could not find '#{name}' (#{requirement}) - did find: [#{specs.join ','}]\n".dup
raise Gem::MissingSpecVersionError.new name, requirement, specs
end
msg << "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information"
error = Gem::LoadError.new(msg)
error.name = self.name
error.requirement = self.requirement
raise error
end
# TODO: any other resolver validations should go here

Просмотреть файл

@ -20,6 +20,49 @@ module Gem
attr_accessor :requirement
end
##
# Raised when trying to activate a gem, and that gem does not exist on the
# system. Instead of rescuing from this class, make sure to rescue from the
# superclass Gem::LoadError to catch all types of load errors.
class MissingSpecError < Gem::LoadError
def initialize name, requirement
@name = name
@requirement = requirement
end
def message # :nodoc:
build_message +
"Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information"
end
private
def build_message
total = Gem::Specification.stubs.size
"Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n"
end
end
##
# Raised when trying to activate a gem, and the gem exists on the system, but
# not the requested version. Instead of rescuing from this class, make sure to
# rescue from the superclass Gem::LoadError to catch all types of load errors.
class MissingSpecVersionError < MissingSpecError
attr_reader :specs
def initialize name, requirement, specs
super(name, requirement)
@specs = specs
end
private
def build_message
names = specs.map(&:full_name)
"Could not find '#{name}' (#{requirement}) - did find: [#{names.join ','}]\n"
end
end
# Raised when there are conflicting gem specs loaded
class ConflictError < LoadError

Просмотреть файл

@ -180,6 +180,52 @@ module Gem::InstallUpdateOptions
options[:post_install_message] = value
end
add_option(:"Install/Update", '-g', '--file [FILE]',
'Read from a gem dependencies API file and',
'install the listed gems') do |v,o|
v = Gem::GEM_DEP_FILES.find do |file|
File.exist? file
end unless v
unless v then
message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ', '})"
raise OptionParser::InvalidArgument,
"cannot find gem dependencies file #{message}"
end
options[:gemdeps] = v
end
add_option(:"Install/Update", '--without GROUPS', Array,
'Omit the named groups (comma separated)',
'when installing from a gem dependencies',
'file') do |v,o|
options[:without_groups].concat v.map { |without| without.intern }
end
add_option(:"Install/Update", '--default',
'Add the gem\'s full specification to',
'specifications/default and extract only its bin') do |v,o|
options[:install_as_default] = v
end
add_option(:"Install/Update", '--explain',
'Rather than install the gems, indicate which would',
'be installed') do |v,o|
options[:explain] = v
end
add_option(:"Install/Update", '--[no-]lock',
'Create a lock file (when used with -g/--file)') do |v,o|
options[:lock] = v
end
add_option(:"Install/Update", '--[no-]suggestions',
'Suggest alternates when gems are not found') do |v,o|
options[:suggest_alternate] = v
end
end
##

Просмотреть файл

@ -231,7 +231,7 @@ class Gem::Installer
question = "#{spec.name}'s executable \"#{filename}\" conflicts with ".dup
if ruby_executable then
question << existing
question << (existing || 'an unknown executable')
return if ask_yes_no "#{question}\nOverwrite the executable?", false

Просмотреть файл

@ -40,7 +40,7 @@ class Gem::Request
def cert_files; @connection_pool.cert_files; end
def self.get_cert_files
pattern = File.expand_path("./ssl_certs/*.pem", File.dirname(__FILE__))
pattern = File.expand_path("./ssl_certs/*/*.pem", File.dirname(__FILE__))
Dir.glob(pattern)
end

Просмотреть файл

@ -849,7 +849,7 @@ class Gem::Specification < Gem::BasicSpecification
pattern = "#{name}-*.gemspec"
stubs = default_stubs(pattern) + installed_stubs(dirs, pattern)
stubs = uniq_by(stubs) { |stub| stub.full_name }.group_by(&:name)
stubs.each_value { |v| sort_by!(v) { |i| i.version } }
stubs.each_value { |v| _resort!(v) }
@@stubs_by_name.merge! stubs
@@stubs_by_name[name] ||= EMPTY
@ -1074,7 +1074,7 @@ class Gem::Specification < Gem::BasicSpecification
def self.find_in_unresolved_tree path
specs = unresolved_deps.values.map { |dep| dep.to_specs }.flatten
specs.reverse_each do |spec|
specs.each do |spec|
spec.traverse do |from_spec, dep, to_spec, trail|
if to_spec.has_conflicts? || to_spec.conficts_when_loaded_with?(trail)
:next
@ -2613,7 +2613,7 @@ class Gem::Specification < Gem::BasicSpecification
begin
dependencies.each do |dep|
next unless dep.runtime?
dep.to_specs.reverse_each do |dep_spec|
dep.to_specs.each do |dep_spec|
next if visited.has_key?(dep_spec)
visited[dep_spec] = true
trail.push(dep_spec)

Просмотреть файл

@ -1,32 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIFdDCCBFygAwIBAgIQJ2buVutJ846r13Ci/ITeIjANBgkqhkiG9w0BAQwFADBv
MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow
gYUxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMSswKQYD
VQQDEyJDT01PRE8gUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5M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m4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC
X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
-----END CERTIFICATE-----

Просмотреть файл

@ -89,8 +89,6 @@ class Gem::StubSpecification < Gem::BasicSpecification
end
end
def this; self; end
def default_gem?
@default_gem
end
@ -212,4 +210,3 @@ class Gem::StubSpecification < Gem::BasicSpecification
end
end

Просмотреть файл

@ -17,7 +17,7 @@ if ENV["TRAVIS"] || ENV["TEST_SSL"]
store = OpenSSL::X509::Store.new
ssl_cert_glob =
File.expand_path '../../../lib/rubygems/ssl_certs/*.pem', THIS_FILE
File.expand_path '../../../lib/rubygems/ssl_certs/*/*.pem', THIS_FILE
Dir[ssl_cert_glob].each do |ssl_cert|
store.add_file ssl_cert
@ -55,5 +55,9 @@ if ENV["TRAVIS"] || ENV["TEST_SSL"]
assert_https('rubygems.global.ssl.fastly.net')
end
def test_accessing_new_index
assert_https('fastly.rubygems.org')
end
end
end

Просмотреть файл

@ -973,6 +973,19 @@ class TestGem < Gem::TestCase
assert Gem.try_activate('b'), 'try_activate should still return true'
end
def test_spec_order_is_consistent
b1 = util_spec 'b', '1.0'
b2 = util_spec 'b', '2.0'
b3 = util_spec 'b', '3.0'
install_specs b1, b2, b3
specs1 = Gem::Specification.stubs.find_all { |s| s.name == 'b' }
Gem::Specification.reset
specs2 = Gem::Specification.stubs_for('b')
assert_equal specs1.map(&:version), specs2.map(&:version)
end
def test_self_try_activate_missing_dep
b = util_spec 'b', '1.0'
a = util_spec 'a', '1.0', 'b' => '>= 1.0'
@ -986,7 +999,7 @@ class TestGem < Gem::TestCase
io.puts '# a_file.rb'
end
e = assert_raises Gem::LoadError do
e = assert_raises Gem::MissingSpecError do
Gem.try_activate 'a_file'
end
@ -1006,7 +1019,7 @@ class TestGem < Gem::TestCase
io.puts '# a_file.rb'
end
e = assert_raises Gem::LoadError do
e = assert_raises Gem::MissingSpecError do
Gem.try_activate 'a_file'
end
@ -1070,7 +1083,7 @@ class TestGem < Gem::TestCase
'GEM_PATH' => [Gem.paths.home, 'foo'] }
end
assert_equal [Gem.paths.home, 'foo'], Gem.paths.path
assert_match(/Array values in the parameter are deprecated. Please use a String or nil/, stderr)
assert_match(/Array values in the parameter to `Gem.paths=` are deprecated.\nPlease use a String or nil/m, stderr)
assert_equal '', stdout
end

Просмотреть файл

@ -23,7 +23,7 @@ class TestGemCommandsEnvironmentCommand < Gem::TestCase
end
assert_match %r|RUBYGEMS VERSION: (\d\.)+\d|, @ui.output
assert_match %r|RUBY VERSION: \d\.\d\.\d \(.*\) \[.*\]|, @ui.output
assert_match %r|RUBY VERSION: \d+\.\d+\.\d+ \(.*\) \[.*\]|, @ui.output
assert_match %r|INSTALLATION DIRECTORY: #{Regexp.escape @gemhome}|,
@ui.output
assert_match %r|RUBYGEMS PREFIX: |, @ui.output

Просмотреть файл

@ -19,7 +19,12 @@ class TestGemCommandsOwnerCommand < Gem::TestCase
response = <<EOF
---
- email: user1@example.com
id: 1
handle: user1
- email: user2@example.com
- id: 3
handle: user3
- id: 4
EOF
@fetcher.data["#{Gem.host}/api/v1/gems/freewill/owners.yaml"] = [response, 200, 'OK']
@ -34,6 +39,8 @@ EOF
assert_match %r{Owners for gem: freewill}, @ui.output
assert_match %r{- user1@example.com}, @ui.output
assert_match %r{- user2@example.com}, @ui.output
assert_match %r{- user3}, @ui.output
assert_match %r{- 4}, @ui.output
end
def test_show_owners_setting_up_host_through_env_var

Просмотреть файл

@ -537,6 +537,26 @@ a (2 universal-darwin, 1 ruby x86-linux)
assert_equal '', @ui.error
end
def test_execute_show_default_gems
spec_fetcher { |fetcher| fetcher.spec 'a', 2 }
a1 = new_default_spec 'a', 1
install_default_specs a1
use_ui @ui do
@cmd.execute
end
expected = <<-EOF
*** LOCAL GEMS ***
a (2, default: 1)
EOF
assert_equal expected, @ui.output
end
def test_execute_default_details
spec_fetcher do |fetcher|
fetcher.spec 'a', 2

Просмотреть файл

@ -14,16 +14,16 @@ class TestGemCommandsSetupCommand < Gem::TestCase
@cmd.options[:prefix] = @install_dir
FileUtils.mkdir_p 'bin'
FileUtils.mkdir_p 'lib/rubygems/ssl_certs'
FileUtils.mkdir_p 'lib/rubygems/ssl_certs/rubygems.org'
open 'bin/gem', 'w' do |io| io.puts '# gem' end
open 'lib/rubygems.rb', 'w' do |io| io.puts '# rubygems.rb' end
open 'lib/rubygems/test_case.rb', 'w' do |io| io.puts '# test_case.rb' end
open 'lib/rubygems/ssl_certs/foo.pem', 'w' do |io| io.puts 'PEM' end
open 'lib/rubygems/ssl_certs/rubygems.org/foo.pem', 'w' do |io| io.puts 'PEM' end
end
def test_pem_files_in
assert_equal %w[rubygems/ssl_certs/foo.pem],
assert_equal %w[rubygems/ssl_certs/rubygems.org/foo.pem],
@cmd.pem_files_in('lib').sort
end
@ -39,7 +39,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
@cmd.install_lib dir
assert_path_exists File.join(dir, 'rubygems.rb')
assert_path_exists File.join(dir, 'rubygems/ssl_certs/foo.pem')
assert_path_exists File.join(dir, 'rubygems/ssl_certs/rubygems.org/foo.pem')
end
end

Просмотреть файл

@ -331,7 +331,7 @@ class TestGemDependency < Gem::TestCase
dep = Gem::Dependency.new "a", "= 2.0"
e = assert_raises Gem::LoadError do
e = assert_raises Gem::MissingSpecVersionError do
dep.to_specs
end
@ -350,7 +350,7 @@ class TestGemDependency < Gem::TestCase
dep = Gem::Dependency.new "b", "= 2.0"
e = assert_raises Gem::LoadError do
e = assert_raises Gem::MissingSpecError do
dep.to_specs
end

Просмотреть файл

@ -100,6 +100,17 @@ end
load 'rubygems/syck_hack.rb'
end
def test_self_find_active_stub_by_path
spec = new_spec('a', '1', nil, 'lib/foo.rb')
spec.activated = true
# There used to be a bug (introduced in a9c1aaf) when Gem::Specification
# objects are present in the @stubs collection. This test verifies that
# this scenario works correctly.
Gem::Specification.all = [spec]
Gem::Specification.find_active_stub_by_path('foo')
end
def test_self_activate
foo = util_spec 'foo', '1'
@ -3373,7 +3384,7 @@ end
assert Gem::Specification.find_by_name "a", "1"
assert Gem::Specification.find_by_name "a", ">1"
assert_raises Gem::LoadError do
assert_raises Gem::MissingSpecError do
Gem::Specification.find_by_name "monkeys"
end
end
@ -3387,7 +3398,7 @@ end
assert Gem::Specification.find_by_name "b"
assert_raises Gem::LoadError do
assert_raises Gem::MissingSpecVersionError do
Gem::Specification.find_by_name "b", "1"
end

Просмотреть файл

@ -66,7 +66,7 @@ class TestKernel < Gem::TestCase
def test_gem_env_req
ENV["GEM_REQUIREMENT_A"] = '~> 2.0'
assert_raises(Gem::LoadError) { gem('a', '= 1') }
assert_raises(Gem::MissingSpecVersionError) { gem('a', '= 1') }
assert gem('a', '> 1')
assert_equal @a2, Gem.loaded_specs['a']
end