summaryrefslogtreecommitdiff
path: root/lib/fileutils.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-07-29 15:47:02 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-07-29 19:10:10 +0900
commit3725454161b55681e5b4ec3b7ca23a4126e23736 (patch)
tree3131e1f522a7ae1c7399187fafca75a7c85674a8 /lib/fileutils.rb
parentd1e726cce727fab7083993eb75237472a462cd72 (diff)
Merge ruby/fileutils from https://github.com/ruby/fileutils/commit/332025bc0299254f97a06d64e580f60fea4e7125
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6200
Diffstat (limited to 'lib/fileutils.rb')
-rw-r--r--lib/fileutils.rb14
1 files changed, 13 insertions, 1 deletions
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].
# - <tt>mode: <i>permissions</i></tt> - changes the permissions.
# using {File.chmod}[https://docs.ruby-lang.org/en/master/File.html#method-c-chmod].
- # - <tt>noop: true</tt> - does not remove entries; returns +nil+.
+ # - <tt>noop: true</tt> - does not copy entries; returns +nil+.
# - <tt>owner: <i>owner</i></tt> - changes the owner if not +nil+,
# using {File.chown}[https://docs.ruby-lang.org/en/master/File.html#method-c-chown].
# - <tt>preserve: true</tt> - preserve timestamps