1
0
Fork 0
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:
David Rodríguez 2022-07-18 14:34:55 +02:00 committed by git
parent dd362a786a
commit fd0902bfcd

View file

@ -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