Skip to content

Commit

Permalink
require fileutils in both methods using it
Browse files Browse the repository at this point in the history
rmtree is already requiring fileutils, but mkpath apparently relies on
autoload of FileUtils. Switch to require for both methods
  • Loading branch information
toy committed Dec 27, 2023
1 parent f3d2367 commit 07ad1fb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/pathname.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 07ad1fb

Please sign in to comment.