summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/setup_command.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-04-27 22:16:16 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 14:13:29 +0900
commitd2087f1cde7810c76f6eb94553a24f760636e72c (patch)
tree4ad8d31abb4c39d2c7660c52f2dbb00cc008c653 /lib/rubygems/commands/setup_command.rb
parent41b288476ee62b032f89ea4f353f638b88de2c95 (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
Diffstat (limited to 'lib/rubygems/commands/setup_command.rb')
-rw-r--r--lib/rubygems/commands/setup_command.rb14
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