зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Move fileutils require to be even more lazy
If directories are already created (the common case), fileutils won't be required at all. https://github.com/rubygems/rubygems/commit/63a9b94fc9
This commit is contained in:
Родитель
dd362a786a
Коммит
fd0902bfcd
|
@ -442,8 +442,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|||
old_umask = File.umask
|
||||
File.umask old_umask | 002
|
||||
|
||||
require 'fileutils'
|
||||
|
||||
options = {}
|
||||
|
||||
options[:mode] = mode if mode
|
||||
|
@ -451,6 +449,9 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|||
subdirs.each do |name|
|
||||
subdir = File.join dir, name
|
||||
next if File.exist? subdir
|
||||
|
||||
require 'fileutils'
|
||||
|
||||
begin
|
||||
FileUtils.mkdir_p subdir, **options
|
||||
rescue SystemCallError
|
||||
|
|
Загрузка…
Ссылка в новой задаче