Skip to content

Commit 13ab964

Browse files
[DOC] Small tweaks (#89)
1 parent ba3ae24 commit 13ab964

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

lib/fileutils.rb

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ def mkdir(list, mode: nil, noop: nil, verbose: nil)
368368
#
369369
# Raises an exception if for any reason a directory cannot be created.
370370
#
371+
# FileUtils.mkpath and FileUtils.makedirs are aliases for FileUtils.mkdir_p.
372+
#
371373
def mkdir_p(list, mode: nil, noop: nil, verbose: nil)
372374
list = fu_list(list)
373375
fu_output_message "mkdir -p #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
@@ -1161,7 +1163,7 @@ def rm(list, force: nil, noop: nil, verbose: nil)
11611163
#
11621164
# FileUtils.rm(list, force: true, **kwargs)
11631165
#
1164-
# Argument +list+ or its elements
1166+
# Argument +list+ (a single path or an array of paths)
11651167
# should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
11661168
#
11671169
# See FileUtils.rm for keyword arguments.
@@ -1422,6 +1424,8 @@ def remove_dir(path, force = false)
14221424
# Arguments +a+ and +b+
14231425
# should be {interpretable as a path}[rdoc-ref:FileUtils@Path+Arguments].
14241426
#
1427+
# FileUtils.identical? and FileUtils.cmp are aliases for FileUtils.compare_file.
1428+
#
14251429
def compare_file(a, b)
14261430
return false unless File.size(a) == File.size(b)
14271431
File.open(a, 'rb') {|fa|
@@ -1458,8 +1462,8 @@ def compare_stream(a, b)
14581462
end
14591463
module_function :compare_stream
14601464

1461-
# Copies a file entry;
1462-
# see {install(1)}[https://man7.org/linux/man-pages/man1/install.1.html].
1465+
# Copies a file entry.
1466+
# See {install(1)}[https://man7.org/linux/man-pages/man1/install.1.html].
14631467
#
14641468
# Arguments +src+ (a single path or an array of paths)
14651469
# and +dest+ (a single path)
@@ -1638,7 +1642,8 @@ def mode_to_s(mode) #:nodoc:
16381642

16391643
# Changes permissions on the entries at the paths given in +list+
16401644
# (a single path or an array of paths)
1641-
# to the permissions given by +mode+:
1645+
# to the permissions given by +mode+;
1646+
# returns +list+ if it is an array, <tt>[list]</tt> otherwise:
16421647
#
16431648
# - Modifies each entry that is a regular file using
16441649
# {File.chmod}[https://docs.ruby-lang.org/en/master/File.html#method-c-chmod].
@@ -1737,7 +1742,8 @@ def chmod_R(mode, list, noop: nil, verbose: nil, force: nil)
17371742

17381743
# Changes the owner and group on the entries at the paths given in +list+
17391744
# (a single path or an array of paths)
1740-
# to the given +user+ and +group+:
1745+
# to the given +user+ and +group+;
1746+
# returns +list+ if it is an array, <tt>[list]</tt> otherwise:
17411747
#
17421748
# - Modifies each entry that is a regular file using
17431749
# {File.chown}[https://docs.ruby-lang.org/en/master/File.html#method-c-chown].
@@ -1863,7 +1869,10 @@ def fu_get_gid(group) #:nodoc:
18631869
# Updates modification times (mtime) and access times (atime)
18641870
# of the entries given by the paths in +list+
18651871
# (a single path or an array of paths);
1866-
# by default, creates an empty file for any path to a non-existent entry.
1872+
# returns +list+ if it is an array, <tt>[list]</tt> otherwise.
1873+
#
1874+
# By default, creates an empty file for any path to a non-existent entry;
1875+
# use keyword argument +nocreate+ to raise an exception instead.
18671876
#
18681877
# Argument +list+ or its elements
18691878
# should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].

0 commit comments

Comments
 (0)