diff --git a/lib/pathname.rb b/lib/pathname.rb index a0da5ed93f1dab..b19e379cd48d9b 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -15,6 +15,8 @@ class Pathname # * Find * # Iterates over the directory tree in a depth first manner, yielding a # Pathname for each file under "this" directory. # + # Note that you need to require 'pathname' to use this method. + # # Returns an Enumerator if no block is given. # # Since it is implemented by the standard library module Find, Find.prune can @@ -40,6 +42,8 @@ def find(ignore_error: true) # :yield: pathname class Pathname # * FileUtils * # Recursively deletes a directory, including all directories beneath it. # + # Note that you need to require 'pathname' to use this method. + # # See FileUtils.rm_rf def rmtree(noop: nil, verbose: nil, secure: nil) # The name "rmtree" is borrowed from File::Path of Perl. @@ -53,6 +57,8 @@ def rmtree(noop: nil, verbose: nil, secure: nil) class Pathname # * tmpdir * # Creates a tmp directory and wraps the returned path in a Pathname object. # + # Note that you need to require 'pathname' to use this method. + # # See Dir.mktmpdir def self.mktmpdir require 'tmpdir' unless defined?(Dir.mktmpdir)