summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-05-04 13:08:29 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 14:13:29 +0900
commit0e195c82c172465b15495da1cddaf1fee31c26ad (patch)
tree0a3d735a0e237043980251757edba1df65c9a2cc
parentc982c5efac3985e989c02d10b8bc834b902c6e5c (diff)
[rubygems/rubygems] Remove old `gauntlet_rubygems` file on rubygems upgrade
The file was removed at https://github.com/rubygems/rubygems/commit/65b709b095b8354ac2620d1a5d7d537e539f6498, shipped with rubygems 2.6.5. https://github.com/rubygems/rubygems/commit/739159a120
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3092
-rw-r--r--lib/rubygems/commands/setup_command.rb3
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb4
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb
index 8368e3ac7a..055f329a5d 100644
--- a/lib/rubygems/commands/setup_command.rb
+++ b/lib/rubygems/commands/setup_command.rb
@@ -604,6 +604,9 @@ abort "#{deprecation_message}"
to_remove = old_lib_files - lib_files
+ gauntlet_rubygems = File.join(lib_dir, 'gauntlet_rubygems.rb')
+ to_remove << gauntlet_rubygems if File.exist? gauntlet_rubygems
+
to_remove.delete_if do |file|
file.start_with? 'defaults'
end
diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb
index e0a6c0c94c..9ebe2a37e8 100644
--- a/test/rubygems/test_gem_commands_setup_command.rb
+++ b/test/rubygems/test_gem_commands_setup_command.rb
@@ -277,11 +277,13 @@ class TestGemCommandsSetupCommand < Gem::TestCase
engine_defaults_rb = File.join lib_rubygems_defaults, 'jruby.rb'
os_defaults_rb = File.join lib_rubygems_defaults, 'operating_system.rb'
+ old_gauntlet_rubygems_rb = File.join lib, 'gauntlet_rubygems.rb'
+
old_builder_rb = File.join lib_rubygems, 'builder.rb'
old_format_rb = File.join lib_rubygems, 'format.rb'
old_bundler_c_rb = File.join lib_bundler, 'c.rb'
- files_that_go = [old_builder_rb, old_format_rb, old_bundler_c_rb]
+ files_that_go = [old_gauntlet_rubygems_rb, old_builder_rb, old_format_rb, old_bundler_c_rb]
files_that_stay = [securerandom_rb, engine_defaults_rb, os_defaults_rb]
create_dummy_files(files_that_go + files_that_stay)