mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[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:
parent
dd362a786a
commit
fd0902bfcd
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue