Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding 'Related' #91

Merged
merged 2 commits into from
Jun 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion lib/fileutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ def fu_mkdir(path, mode) #:nodoc:
# 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
Expand Down Expand Up @@ -1133,6 +1135,8 @@ def mv(src, dest, force: nil, noop: nil, verbose: nil, secure: nil)
#
# rm src0.dat src0.txt
#
# Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
#
# FileUtils.remove is an alias for FileUtils.rm.
#
def rm(list, force: nil, noop: nil, verbose: nil)
Expand Down Expand Up @@ -1216,6 +1220,8 @@ def rm_f(list, noop: nil, verbose: nil)
# 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
Expand Down Expand Up @@ -1245,6 +1251,8 @@ def rm_r(list, force: nil, noop: nil, verbose: nil, secure: nil)
#
# 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
Expand All @@ -1266,6 +1274,8 @@ def rm_rf(list, noop: nil, verbose: nil, secure: nil)
# 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
Expand Down Expand Up @@ -1386,6 +1396,8 @@ def remove_entry(path, force = false)
# 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
Expand All @@ -1403,6 +1415,8 @@ def remove_file(path, force = false)
# 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
Expand Down Expand Up @@ -1497,7 +1511,7 @@ def compare_stream(a, b)
# 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
Expand Down