Merge rubygems-3.2.0.rc.2
This commit is contained in:
parent
f0c7a05b4c
commit
ab6c4f8be3
Notes:
git
2020-10-15 14:12:32 +09:00
@ -8,7 +8,7 @@
|
|||||||
require 'rbconfig'
|
require 'rbconfig'
|
||||||
|
|
||||||
module Gem
|
module Gem
|
||||||
VERSION = "3.2.0.rc.1".freeze
|
VERSION = "3.2.0.rc.2".freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
# Must be first since it unloads the prelude from 1.9.2
|
# Must be first since it unloads the prelude from 1.9.2
|
||||||
|
@ -533,14 +533,14 @@ By default, this RubyGems will install gem as:
|
|||||||
# for installation of bundler as default gems
|
# for installation of bundler as default gems
|
||||||
def bundler_man1_files_in(dir)
|
def bundler_man1_files_in(dir)
|
||||||
Dir.chdir dir do
|
Dir.chdir dir do
|
||||||
Dir['bundle*.1{,.txt}']
|
Dir['bundle*.1{,.txt,.ronn}']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# for installation of bundler as default gems
|
# for installation of bundler as default gems
|
||||||
def bundler_man5_files_in(dir)
|
def bundler_man5_files_in(dir)
|
||||||
Dir.chdir dir do
|
Dir.chdir dir do
|
||||||
Dir['gemfile.5{,.txt}']
|
Dir['gemfile.5{,.txt,.ronn}']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -617,15 +617,16 @@ abort "#{deprecation_message}"
|
|||||||
def remove_old_man_files(man_dir)
|
def remove_old_man_files(man_dir)
|
||||||
man_dirs = { man_dir => "bundler/man" }
|
man_dirs = { man_dir => "bundler/man" }
|
||||||
man_dirs.each do |old_man_dir, new_man_dir|
|
man_dirs.each do |old_man_dir, new_man_dir|
|
||||||
man1_files = bundler_man1_files_in(new_man_dir)
|
["1", "5"].each do |section|
|
||||||
|
man_files = send(:"bundler_man#{section}_files_in", new_man_dir)
|
||||||
|
|
||||||
old_man1_dir = "#{old_man_dir}/man1"
|
old_man_dir_with_section = "#{old_man_dir}/man#{section}"
|
||||||
|
old_man_files = send(:"bundler_man#{section}_files_in", old_man_dir_with_section)
|
||||||
|
|
||||||
old_man1_files = bundler_man1_files_in(old_man1_dir)
|
man_to_remove = old_man_files - man_files
|
||||||
|
|
||||||
man1_to_remove = old_man1_files - man1_files
|
remove_file_list(man_to_remove, old_man_dir_with_section)
|
||||||
|
end
|
||||||
remove_file_list(man1_to_remove, old_man1_dir)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -638,8 +639,6 @@ abort "#{deprecation_message}"
|
|||||||
|
|
||||||
history.force_encoding Encoding::UTF_8
|
history.force_encoding Encoding::UTF_8
|
||||||
|
|
||||||
history = history.sub(/^# coding:.*?(?=^=)/m, '')
|
|
||||||
|
|
||||||
text = history.split(HISTORY_HEADER)
|
text = history.split(HISTORY_HEADER)
|
||||||
text.shift # correct an off-by-one generated by split
|
text.shift # correct an off-by-one generated by split
|
||||||
version_lines = history.scan(HISTORY_HEADER)
|
version_lines = history.scan(HISTORY_HEADER)
|
||||||
|
@ -270,7 +270,7 @@ class Gem::Requirement
|
|||||||
return unless Gem::Requirement === other
|
return unless Gem::Requirement === other
|
||||||
|
|
||||||
# An == check is always necessary
|
# An == check is always necessary
|
||||||
return false unless requirements == other.requirements
|
return false unless _sorted_requirements == other._sorted_requirements
|
||||||
|
|
||||||
# An == check is sufficient unless any requirements use ~>
|
# An == check is sufficient unless any requirements use ~>
|
||||||
return true unless _tilde_requirements.any?
|
return true unless _tilde_requirements.any?
|
||||||
@ -282,8 +282,12 @@ class Gem::Requirement
|
|||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
def _sorted_requirements
|
||||||
|
@_sorted_requirements ||= requirements.sort_by(&:to_s)
|
||||||
|
end
|
||||||
|
|
||||||
def _tilde_requirements
|
def _tilde_requirements
|
||||||
requirements.select {|r| r.first == "~>" }
|
@_tilde_requirements ||= _sorted_requirements.select {|r| r.first == "~>" }
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -109,8 +109,6 @@ class Gem::TestCase < Minitest::Test
|
|||||||
|
|
||||||
TEST_PATH = ENV.fetch('RUBYGEMS_TEST_PATH', File.expand_path('../../../test/rubygems', __FILE__))
|
TEST_PATH = ENV.fetch('RUBYGEMS_TEST_PATH', File.expand_path('../../../test/rubygems', __FILE__))
|
||||||
|
|
||||||
SPECIFICATIONS = File.expand_path(File.join(TEST_PATH, "specifications"), __FILE__)
|
|
||||||
|
|
||||||
def assert_activate(expected, *specs)
|
def assert_activate(expected, *specs)
|
||||||
specs.each do |spec|
|
specs.each do |spec|
|
||||||
case spec
|
case spec
|
||||||
|
@ -15,15 +15,10 @@ require 'rubygems/request'
|
|||||||
#
|
#
|
||||||
|
|
||||||
class TestBundledCA < Gem::TestCase
|
class TestBundledCA < Gem::TestCase
|
||||||
THIS_FILE = File.expand_path __FILE__
|
|
||||||
|
|
||||||
def bundled_certificate_store
|
def bundled_certificate_store
|
||||||
store = OpenSSL::X509::Store.new
|
store = OpenSSL::X509::Store.new
|
||||||
|
|
||||||
ssl_cert_glob =
|
Gem::Request.get_cert_files.each do |ssl_cert|
|
||||||
File.expand_path '../../../lib/rubygems/ssl_certs/*/*.pem', THIS_FILE
|
|
||||||
|
|
||||||
Dir[ssl_cert_glob].each do |ssl_cert|
|
|
||||||
store.add_file ssl_cert
|
store.add_file ssl_cert
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_execute_rubyforge_project_warning
|
def test_execute_rubyforge_project_warning
|
||||||
rubyforge_gemspec = File.join SPECIFICATIONS, "rubyforge-0.0.1.gemspec"
|
rubyforge_gemspec = File.expand_path File.join("specifications", "rubyforge-0.0.1.gemspec"), __dir__
|
||||||
|
|
||||||
@cmd.options[:args] = [rubyforge_gemspec]
|
@cmd.options[:args] = [rubyforge_gemspec]
|
||||||
|
|
||||||
|
@ -29,9 +29,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|||||||
bundler/lib/bundler/templates/.circleci/config.yml
|
bundler/lib/bundler/templates/.circleci/config.yml
|
||||||
bundler/lib/bundler/templates/.travis.yml
|
bundler/lib/bundler/templates/.travis.yml
|
||||||
bundler/man/bundle-b.1
|
bundler/man/bundle-b.1
|
||||||
bundler/man/bundle-b.1.txt
|
bundler/man/bundle-b.1.ronn
|
||||||
bundler/man/gemfile.5
|
bundler/man/gemfile.5
|
||||||
bundler/man/gemfile.5.txt
|
bundler/man/gemfile.5.ronn
|
||||||
]
|
]
|
||||||
|
|
||||||
create_dummy_files(filelist)
|
create_dummy_files(filelist)
|
||||||
@ -166,12 +166,12 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_bundler_man1_files_in
|
def test_bundler_man1_files_in
|
||||||
assert_equal %w[bundle-b.1 bundle-b.1.txt],
|
assert_equal %w[bundle-b.1 bundle-b.1.ronn],
|
||||||
@cmd.bundler_man1_files_in('bundler/man').sort
|
@cmd.bundler_man1_files_in('bundler/man').sort
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_bundler_man5_files_in
|
def test_bundler_man5_files_in
|
||||||
assert_equal %w[gemfile.5 gemfile.5.txt],
|
assert_equal %w[gemfile.5 gemfile.5.ronn],
|
||||||
@cmd.bundler_man5_files_in('bundler/man').sort
|
@cmd.bundler_man5_files_in('bundler/man').sort
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -199,9 +199,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|||||||
@cmd.install_man dir
|
@cmd.install_man dir
|
||||||
|
|
||||||
assert_path_exists File.join("#{dir}/man1", 'bundle-b.1')
|
assert_path_exists File.join("#{dir}/man1", 'bundle-b.1')
|
||||||
assert_path_exists File.join("#{dir}/man1", 'bundle-b.1.txt')
|
assert_path_exists File.join("#{dir}/man1", 'bundle-b.1.ronn')
|
||||||
assert_path_exists File.join("#{dir}/man5", 'gemfile.5')
|
assert_path_exists File.join("#{dir}/man5", 'gemfile.5')
|
||||||
assert_path_exists File.join("#{dir}/man5", 'gemfile.5.txt')
|
assert_path_exists File.join("#{dir}/man5", 'gemfile.5.ronn')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -307,14 +307,14 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|||||||
|
|
||||||
ruby_1 = File.join man, 'man1', 'ruby.1'
|
ruby_1 = File.join man, 'man1', 'ruby.1'
|
||||||
bundle_b_1 = File.join man, 'man1', 'bundle-b.1'
|
bundle_b_1 = File.join man, 'man1', 'bundle-b.1'
|
||||||
|
bundle_b_1_ronn = File.join man, 'man1', 'bundle-b.1.ronn'
|
||||||
bundle_b_1_txt = File.join man, 'man1', 'bundle-b.1.txt'
|
bundle_b_1_txt = File.join man, 'man1', 'bundle-b.1.txt'
|
||||||
bundle_old_b_1 = File.join man, 'man1', 'bundle-old_b.1'
|
|
||||||
bundle_old_b_1_txt = File.join man, 'man1', 'bundle-old_b.1.txt'
|
|
||||||
gemfile_5 = File.join man, 'man5', 'gemfile.5'
|
gemfile_5 = File.join man, 'man5', 'gemfile.5'
|
||||||
|
gemfile_5_ronn = File.join man, 'man5', 'gemfile.5.ronn'
|
||||||
gemfile_5_txt = File.join man, 'man5', 'gemfile.5.txt'
|
gemfile_5_txt = File.join man, 'man5', 'gemfile.5.txt'
|
||||||
|
|
||||||
files_that_go = [bundle_old_b_1, bundle_old_b_1_txt]
|
files_that_go = [bundle_b_1_txt, gemfile_5_txt]
|
||||||
files_that_stay = [ruby_1, bundle_b_1, bundle_b_1_txt, gemfile_5, gemfile_5_txt]
|
files_that_stay = [ruby_1, bundle_b_1, bundle_b_1_ronn, gemfile_5, gemfile_5_ronn]
|
||||||
|
|
||||||
create_dummy_files(files_that_go + files_that_stay)
|
create_dummy_files(files_that_go + files_that_stay)
|
||||||
|
|
||||||
@ -333,8 +333,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|||||||
|
|
||||||
File.open 'History.txt', 'w' do |io|
|
File.open 'History.txt', 'w' do |io|
|
||||||
io.puts <<-HISTORY_TXT
|
io.puts <<-HISTORY_TXT
|
||||||
# coding: UTF-8
|
|
||||||
|
|
||||||
=== #{Gem::VERSION} / 2013-03-26
|
=== #{Gem::VERSION} / 2013-03-26
|
||||||
|
|
||||||
* Bug fixes:
|
* Bug fixes:
|
||||||
|
@ -22,6 +22,8 @@ class TestGemRequirement < Gem::TestCase
|
|||||||
refute_requirement_equal "~> 1.3", "~> 1.3.0"
|
refute_requirement_equal "~> 1.3", "~> 1.3.0"
|
||||||
refute_requirement_equal "~> 1.3.0", "~> 1.3"
|
refute_requirement_equal "~> 1.3.0", "~> 1.3"
|
||||||
|
|
||||||
|
assert_requirement_equal ["> 2", "~> 1.3", "~> 1.3.1"], ["~> 1.3.1", "~> 1.3", "> 2"]
|
||||||
|
|
||||||
assert_requirement_equal ["> 2", "~> 1.3"], ["> 2.0", "~> 1.3"]
|
assert_requirement_equal ["> 2", "~> 1.3"], ["> 2.0", "~> 1.3"]
|
||||||
assert_requirement_equal ["> 2.0", "~> 1.3"], ["> 2", "~> 1.3"]
|
assert_requirement_equal ["> 2.0", "~> 1.3"], ["> 2", "~> 1.3"]
|
||||||
|
|
||||||
|
@ -3,14 +3,14 @@ require "rubygems/test_case"
|
|||||||
require "rubygems/stub_specification"
|
require "rubygems/stub_specification"
|
||||||
|
|
||||||
class TestStubSpecification < Gem::TestCase
|
class TestStubSpecification < Gem::TestCase
|
||||||
FOO = File.join SPECIFICATIONS, "foo-0.0.1-x86-mswin32.gemspec"
|
FOO = File.expand_path File.join("specifications", "foo-0.0.1-x86-mswin32.gemspec"), __dir__
|
||||||
BAR = File.join SPECIFICATIONS, "bar-0.0.2.gemspec"
|
BAR = File.expand_path File.join("specifications", "bar-0.0.2.gemspec"), __dir__
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
|
||||||
@base_dir = File.dirname(SPECIFICATIONS)
|
@base_dir = __dir__
|
||||||
@gems_dir = File.join File.dirname(SPECIFICATIONS), 'gem'
|
@gems_dir = File.join __dir__, 'gem'
|
||||||
@foo = Gem::StubSpecification.gemspec_stub FOO, @base_dir, @gems_dir
|
@foo = Gem::StubSpecification.gemspec_stub FOO, @base_dir, @gems_dir
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user