From 1f1edeef3fe0a8ed0ae441bdf2418f4a8d9e352c Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Wed, 27 Dec 2023 14:14:46 +0100 Subject: [PATCH] [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 --- ext/pathname/lib/pathname.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb index 8eeba6aad2..dc639174d5 100644 --- a/ext/pathname/lib/pathname.rb +++ b/ext/pathname/lib/pathname.rb @@ -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