[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 коммит произвёл git
Родитель dd362a786a
Коммит fd0902bfcd
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

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