From 3725454161b55681e5b4ec3b7ca23a4126e23736 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 29 Jul 2022 15:47:02 +0900 Subject: [PATCH] Merge ruby/fileutils from https://github.com/ruby/fileutils/commit/332025bc0299254f97a06d64e580f60fea4e7125 --- lib/fileutils.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 003b4bdd82..7eb66dda0c 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -440,6 +440,8 @@ module FileUtils # Raises an exception if a directory does not exist # or if for any reason a directory cannot be removed. # + # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting]. + # def rmdir(list, parents: nil, noop: nil, verbose: nil) list = fu_list(list) fu_output_message "rmdir #{parents ? '-p ' : ''}#{list.join ' '}" if verbose @@ -1261,6 +1263,8 @@ module FileUtils # rm -r src0.dat src0.txt # rm -r src1 # + # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting]. + # def rm_r(list, force: nil, noop: nil, verbose: nil, secure: nil) list = fu_list(list) fu_output_message "rm -r#{force ? 'f' : ''} #{list.join ' '}" if verbose @@ -1290,6 +1294,8 @@ module FileUtils # # FileUtils.rmtree is an alias for FileUtils.rm_rf. # + # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting]. + # def rm_rf(list, noop: nil, verbose: nil, secure: nil) rm_r list, force: true, noop: noop, verbose: verbose, secure: secure end @@ -1311,6 +1317,8 @@ module FileUtils # Optional argument +force+ specifies whether to ignore # raised exceptions of StandardError and its descendants. # + # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting]. + # def remove_entry_secure(path, force = false) unless fu_have_symlink? remove_entry path, force @@ -1431,6 +1439,8 @@ module FileUtils # Optional argument +force+ specifies whether to ignore # raised exceptions of StandardError and its descendants. # + # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting]. + # def remove_file(path, force = false) Entry_.new(path).remove_file rescue @@ -1448,6 +1458,8 @@ module FileUtils # Optional argument +force+ specifies whether to ignore # raised exceptions of StandardError and its descendants. # + # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting]. + # def remove_dir(path, force = false) remove_entry path, force # FIXME?? check if it is a directory end @@ -1546,7 +1558,7 @@ module FileUtils # using {File.chown}[https://docs.ruby-lang.org/en/master/File.html#method-c-chown]. # - mode: permissions - changes the permissions. # using {File.chmod}[https://docs.ruby-lang.org/en/master/File.html#method-c-chmod]. - # - noop: true - does not remove entries; returns +nil+. + # - noop: true - does not copy entries; returns +nil+. # - owner: owner - changes the owner if not +nil+, # using {File.chown}[https://docs.ruby-lang.org/en/master/File.html#method-c-chown]. # - preserve: true - preserve timestamps