[前][次][番号順一覧][スレッド一覧]

ruby-changes:63352

From: Hiroshi <ko1@a...>
Date: Thu, 15 Oct 2020 14:12:27 +0900 (JST)
Subject: [ruby-changes:63352] ab6c4f8be3 (master): Merge rubygems-3.2.0.rc.2

https://git.ruby-lang.org/ruby.git/commit/?id=ab6c4f8be3

From ab6c4f8be3dd0fb116ba2722a2fcdc53ad4ea0b7 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Thu, 15 Oct 2020 13:25:27 +0900
Subject: Merge rubygems-3.2.0.rc.2


diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 03f9063..eabe1c4 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -8,7 +8,7 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L8
 require 'rbconfig'
 
 module Gem
-  VERSION = "3.2.0.rc.1".freeze
+  VERSION = "3.2.0.rc.2".freeze
 end
 
 # Must be first since it unloads the prelude from 1.9.2
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb
index 73c1b65..b63920a 100644
--- a/lib/rubygems/commands/setup_command.rb
+++ b/lib/rubygems/commands/setup_command.rb
@@ -533,14 +533,14 @@ By default, this RubyGems will install gem as: https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L533
   # for installation of bundler as default gems
   def bundler_man1_files_in(dir)
     Dir.chdir dir do
-      Dir['bundle*.1{,.txt}']
+      Dir['bundle*.1{,.txt,.ronn}']
     end
   end
 
   # for installation of bundler as default gems
   def bundler_man5_files_in(dir)
     Dir.chdir dir do
-      Dir['gemfile.5{,.txt}']
+      Dir['gemfile.5{,.txt,.ronn}']
     end
   end
 
@@ -617,15 +617,16 @@ abort "#{deprecation_message}" https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L617
   def remove_old_man_files(man_dir)
     man_dirs = { man_dir => "bundler/man" }
     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(man1_to_remove, old_man1_dir)
+        remove_file_list(man_to_remove, old_man_dir_with_section)
+      end
     end
   end
 
@@ -638,8 +639,6 @@ abort "#{deprecation_message}" https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L639
 
         history.force_encoding Encoding::UTF_8
 
-        history = history.sub(/^# coding:.*?(?=^=)/m, '')
-
         text = history.split(HISTORY_HEADER)
         text.shift # correct an off-by-one generated by split
         version_lines = history.scan(HISTORY_HEADER)
diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb
index d9d7c2f..a2a5c7b 100644
--- a/lib/rubygems/requirement.rb
+++ b/lib/rubygems/requirement.rb
@@ -270,7 +270,7 @@ class Gem::Requirement https://github.com/ruby/ruby/blob/trunk/lib/rubygems/requirement.rb#L270
     return unless Gem::Requirement === other
 
     # 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 ~>
     return true unless _tilde_requirements.any?
@@ -282,8 +282,12 @@ class Gem::Requirement https://github.com/ruby/ruby/blob/trunk/lib/rubygems/requirement.rb#L282
 
   protected
 
+  def _sorted_requirements
+    @_sorted_requirements ||= requirements.sort_by(&:to_s)
+  end
+
   def _tilde_requirements
-    requirements.select {|r| r.first == "~>" }
+    @_tilde_requirements ||= _sorted_requirements.select {|r| r.first == "~>" }
   end
 
   private
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 7bf7142..09b91b6 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -109,8 +109,6 @@ class Gem::TestCase < Minitest::Test https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L109
 
   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)
     specs.each do |spec|
       case spec
diff --git a/test/rubygems/test_bundled_ca.rb b/test/rubygems/test_bundled_ca.rb
index b30264a..557298d 100644
--- a/test/rubygems/test_bundled_ca.rb
+++ b/test/rubygems/test_bundled_ca.rb
@@ -15,15 +15,10 @@ require 'rubygems/request' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_bundled_ca.rb#L15
 #
 
 class TestBundledCA < Gem::TestCase
-  THIS_FILE = File.expand_path __FILE__
-
   def bundled_certificate_store
     store = OpenSSL::X509::Store.new
 
-    ssl_cert_glob =
-      File.expand_path '../../../lib/rubygems/ssl_certs/*/*.pem', THIS_FILE
-
-    Dir[ssl_cert_glob].each do |ssl_cert|
+    Gem::Request.get_cert_files.each do |ssl_cert|
       store.add_file ssl_cert
     end
 
diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb
index 01f3487..24c6047 100644
--- a/test/rubygems/test_gem_commands_build_command.rb
+++ b/test/rubygems/test_gem_commands_build_command.rb
@@ -148,7 +148,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_build_command.rb#L148
   end
 
   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]
 
diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb
index 050c1ce..9b6aa87 100644
--- a/test/rubygems/test_gem_commands_setup_command.rb
+++ b/test/rubygems/test_gem_commands_setup_command.rb
@@ -29,9 +29,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L29
       bundler/lib/bundler/templates/.circleci/config.yml
       bundler/lib/bundler/templates/.travis.yml
       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.txt
+      bundler/man/gemfile.5.ronn
     ]
 
     create_dummy_files(filelist)
@@ -166,12 +166,12 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L166
   end
 
   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
   end
 
   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
   end
 
@@ -199,9 +199,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L199
       @cmd.install_man dir
 
       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.txt')
+      assert_path_exists File.join("#{dir}/man5", 'gemfile.5.ronn')
     end
   end
 
@@ -307,14 +307,14 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L307
 
     ruby_1             = File.join man, 'man1', 'ruby.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_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_ronn     = File.join man, 'man5', 'gemfile.5.ronn'
     gemfile_5_txt      = File.join man, 'man5', 'gemfile.5.txt'
 
-    files_that_go   = [bundle_old_b_1, bundle_old_b_1_txt]
-    files_that_stay = [ruby_1, bundle_b_1, bundle_b_1_txt, gemfile_5, gemfile_5_txt]
+    files_that_go   = [bundle_b_1_txt, 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)
 
@@ -333,8 +333,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L333
 
     File.open 'History.txt', 'w' do |io|
       io.puts <<-HISTORY_TXT
-# coding: UTF-8
-
 === #{Gem::VERSION} / 2013-03-26
 
 * Bug fixes:
diff --git a/test/rubygems/test_gem_requirement.rb b/test/rubygems/test_gem_requirement.rb
index af9d807..20127a1 100644
--- a/test/rubygems/test_gem_requirement.rb
+++ b/test/rubygems/test_gem_requirement.rb
@@ -22,6 +22,8 @@ class TestGemRequirement < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_requirement.rb#L22
     refute_requirement_equal "~> 1.3", "~> 1.3.0"
     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.0", "~> 1.3"], ["> 2", "~> 1.3"]
 
diff --git a/test/rubygems/test_gem_stub_specification.rb b/test/rubygems/test_gem_stub_specification.rb
index 5a47fa5..2ee94dc 100644
--- a/test/rubygems/test_gem_stub_specification.rb
+++ b/test/rubygems/test_gem_stub_specification.rb
@@ -3,14 +3,14 @@ require "rubyg (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]