[ruby/pathname] require fileutils in both methods using it

rmtree is already requiring fileutils, but mkpath apparently relies on
autoload of FileUtils. Switch to require for both methods

07ad1fb41a
This commit is contained in:
Ivan Kuchin 2023-12-27 14:14:46 +01:00 committed by git
parent 73fa322497
commit 1f1edeef3f

View file

@ -580,14 +580,13 @@ class Pathname # * Find *
end
autoload(:FileUtils, 'fileutils')
class Pathname # * FileUtils *
# Creates a full path, including any intermediate directories that don't yet
# exist.
#
# See FileUtils.mkpath and FileUtils.mkdir_p
def mkpath(mode: nil)
require 'fileutils'
FileUtils.mkpath(@path, mode: mode)
nil
end