[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

https://github.com/ruby/pathname/commit/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 end
autoload(:FileUtils, 'fileutils')
class Pathname # * FileUtils * class Pathname # * FileUtils *
# Creates a full path, including any intermediate directories that don't yet # Creates a full path, including any intermediate directories that don't yet
# exist. # exist.
# #
# See FileUtils.mkpath and FileUtils.mkdir_p # See FileUtils.mkpath and FileUtils.mkdir_p
def mkpath(mode: nil) def mkpath(mode: nil)
require 'fileutils'
FileUtils.mkpath(@path, mode: mode) FileUtils.mkpath(@path, mode: mode)
nil nil
end end