mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Extract a remove_file_list
helper
https://github.com/rubygems/rubygems/commit/8cc6087590
This commit is contained in:
parent
c74d306b22
commit
64e89713da
Notes:
git
2020-05-08 14:14:17 +09:00
1 changed files with 12 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue