summaryrefslogtreecommitdiff
path: root/lib/rubygems
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems')
-rw-r--r--lib/rubygems/commands/setup_command.rb19
-rw-r--r--lib/rubygems/requirement.rb8
-rw-r--r--lib/rubygems/test_case.rb2
3 files changed, 15 insertions, 14 deletions
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb
index 73c1b65223..b63920ab8d 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:
# 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}"
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}"
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 d9d7c2fbad..a2a5c7bca1 100644
--- a/lib/rubygems/requirement.rb
+++ b/lib/rubygems/requirement.rb
@@ -270,7 +270,7 @@ class Gem::Requirement
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
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 7bf7142a45..09b91b6ac6 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -109,8 +109,6 @@ class Gem::TestCase < Minitest::Test
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