Skip to content

Commit

Permalink
Merge pull request #35 from toy/require-fileutils-instead-of-autoload
Browse files Browse the repository at this point in the history
require fileutils in both methods using it
  • Loading branch information
hsbt committed Dec 28, 2023
2 parents f3d2367 + 07ad1fb commit 0a895b3
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 0a895b3

Please sign in to comment.