ruby-changes:61144
From: David <ko1@a...>
Date: Fri, 8 May 2020 14:15:05 +0900 (JST)
Subject: [ruby-changes:61144] 64e89713da (master): [rubygems/rubygems] Extract a `remove_file_list` helper
https://git.ruby-lang.org/ruby.git/commit/?id=64e89713da From 64e89713dab469a162d042fbc5c3595116937e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Mon, 27 Apr 2020 22:23:16 +0200 Subject: [rubygems/rubygems] Extract a `remove_file_list` helper https://github.com/rubygems/rubygems/commit/8cc6087590 diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index 37a305e..5563b0e 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -550,14 +550,7 @@ abort "#{deprecation_message}" https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L550 file.start_with? 'defaults' end - Dir.chdir old_lib_dir do - to_remove.each do |file| - FileUtils.rm_f file - - warn "unable to remove old file #{file} please remove it by hand" if - File.exist? file - end - end + remove_file_list(to_remove, old_lib_dir) end end @@ -644,6 +637,17 @@ abort "#{deprecation_message}" https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L637 install file, dest_file, :mode => options[:data_mode] || 0644 end + def remove_file_list(files, dir) + Dir.chdir dir do + files.each do |file| + FileUtils.rm_f file + + warn "unable to remove old file #{file} please remove it by hand" if + File.exist? file + end + end + end + def target_bin_path(bin_dir, bin_file) bin_file_formatted = if options[:format_executable] Gem.default_exec_format % bin_file -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/