diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-04-27 22:16:16 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-08 14:13:29 +0900 |
commit | d2087f1cde7810c76f6eb94553a24f760636e72c (patch) | |
tree | 4ad8d31abb4c39d2c7660c52f2dbb00cc008c653 | |
parent | 41b288476ee62b032f89ea4f353f638b88de2c95 (diff) |
[rubygems/rubygems] Extract an `install_file_list` helper
https://github.com/rubygems/rubygems/commit/5106ea4582
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3092
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index dc7a73f63a..b330b8ae03 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -324,13 +324,9 @@ By default, this RubyGems will install gem as: pem_files = pem_files_in path Dir.chdir path do - lib_files.each do |lib_file| - install_file lib_file, lib_dir - end + install_file_list(lib_files, lib_dir) - pem_files.each do |pem_file| - install_file pem_file, lib_dir - end + install_file_list(pem_files, lib_dir) end end end @@ -634,6 +630,12 @@ abort "#{deprecation_message}" private + def install_file_list(files, dest_dir) + files.each do |file| + install_file file, dest_dir + end + end + def install_file(file, dest_dir) dest_file = File.join dest_dir, file dest_dir = File.dirname dest_file |