summaryrefslogtreecommitdiff
path: root/ext/pathname
diff options
context:
space:
mode:
authorIvan Kuchin <tadump+git@gmail.com>2023-12-27 14:14:46 +0100
committergit <svn-admin@ruby-lang.org>2023-12-28 00:07:56 +0000
commit1f1edeef3fe0a8ed0ae441bdf2418f4a8d9e352c (patch)
treefb6d29e37a9ba1857d853652fb155c10dff8f2dc /ext/pathname
parent73fa3224975c42e1c4e2231212a64ac325054130 (diff)
[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
Diffstat (limited to 'ext/pathname')
-rw-r--r--ext/pathname/lib/pathname.rb3
1 files changed, 1 insertions, 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