diff options
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index 37a305eb3a..5563b0e105 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -550,14 +550,7 @@ abort "#{deprecation_message}" 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}" 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 |