From 07ad1fb41aaa88e34f70a4a4f51be5040f10ed02 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Wed, 27 Dec 2023 14:14:46 +0100 Subject: [PATCH] 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 --- lib/pathname.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pathname.rb b/lib/pathname.rb index 8eeba6a..dc63917 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -580,14 +580,13 @@ def find(ignore_error: true) # :yield: pathname 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