1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Cache destination dir.

It is not necessary to strip the `destdir` prefix every iteration, when
it can be done just once.
This commit is contained in:
Vít Ondruch 2019-10-15 15:15:25 +02:00 committed by Nobuyoshi Nakada
parent b8a8fdba63
commit 9d6d531527
Notes: git 2020-02-26 11:05:18 +09:00

View file

@ -722,9 +722,10 @@ module RbInstall
return if @src_dir == destination_dir
File.chmod(0700, destination_dir)
mode = pattern == File.join(spec.bindir, '*') ? prog_mode : data_mode
destdir = without_destdir(destination_dir)
spec.files.each do |f|
src = File.join(@src_dir, f)
dest = File.join(without_destdir(destination_dir), f)
dest = File.join(destdir, f)
makedirs(dest[/.*(?=\/)/m])
install src, dest, :mode => mode
end