@@ -368,6 +368,8 @@ def mkdir(list, mode: nil, noop: nil, verbose: nil)
368
368
#
369
369
# Raises an exception if for any reason a directory cannot be created.
370
370
#
371
+ # FileUtils.mkpath and FileUtils.makedirs are aliases for FileUtils.mkdir_p.
372
+ #
371
373
def mkdir_p ( list , mode : nil , noop : nil , verbose : nil )
372
374
list = fu_list ( list )
373
375
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)
1161
1163
#
1162
1164
# FileUtils.rm(list, force: true, **kwargs)
1163
1165
#
1164
- # Argument +list+ or its elements
1166
+ # Argument +list+ (a single path or an array of paths)
1165
1167
# should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1166
1168
#
1167
1169
# See FileUtils.rm for keyword arguments.
@@ -1422,6 +1424,8 @@ def remove_dir(path, force = false)
1422
1424
# Arguments +a+ and +b+
1423
1425
# should be {interpretable as a path}[rdoc-ref:FileUtils@Path+Arguments].
1424
1426
#
1427
+ # FileUtils.identical? and FileUtils.cmp are aliases for FileUtils.compare_file.
1428
+ #
1425
1429
def compare_file ( a , b )
1426
1430
return false unless File . size ( a ) == File . size ( b )
1427
1431
File . open ( a , 'rb' ) { |fa |
@@ -1458,8 +1462,8 @@ def compare_stream(a, b)
1458
1462
end
1459
1463
module_function :compare_stream
1460
1464
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].
1463
1467
#
1464
1468
# Arguments +src+ (a single path or an array of paths)
1465
1469
# and +dest+ (a single path)
@@ -1638,7 +1642,8 @@ def mode_to_s(mode) #:nodoc:
1638
1642
1639
1643
# Changes permissions on the entries at the paths given in +list+
1640
1644
# (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:
1642
1647
#
1643
1648
# - Modifies each entry that is a regular file using
1644
1649
# {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)
1737
1742
1738
1743
# Changes the owner and group on the entries at the paths given in +list+
1739
1744
# (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:
1741
1747
#
1742
1748
# - Modifies each entry that is a regular file using
1743
1749
# {File.chown}[https://docs.ruby-lang.org/en/master/File.html#method-c-chown].
@@ -1863,7 +1869,10 @@ def fu_get_gid(group) #:nodoc:
1863
1869
# Updates modification times (mtime) and access times (atime)
1864
1870
# of the entries given by the paths in +list+
1865
1871
# (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.
1867
1876
#
1868
1877
# Argument +list+ or its elements
1869
1878
# should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
0 commit comments