module Bundler::FileUtils

def rm(list, force: nil, noop: nil, verbose: nil)


Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].

rm src0.dat src0.txt

Output:

Bundler::FileUtils.rm(['src0.dat', 'src0.txt'], noop: true, verbose: true)

- verbose: true - prints an equivalent command:
- noop: true - does not remove files; returns +nil+.
and its descendants.
- force: true - ignores raised exceptions of StandardError

Keyword arguments:

Bundler::FileUtils.rm(['src0.dat', 'src0.txt']) # => ["src0.dat", "src0.txt"]
Bundler::FileUtils.touch(['src0.txt', 'src0.dat'])

With no keyword arguments, removes files at the paths given in +list+:

should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
Argument +list+ or its elements

returns +list+, if it is an array, [list] otherwise.
(a single path or an array of paths)
Removes entries at the paths in the given +list+
def rm(list, force: nil, noop: nil, verbose: nil)
  list = fu_list(list)
  fu_output_message "rm#{force ? ' -f' : ''} #{list.join ' '}" if verbose
  return if noop
  list.each do |path|
    remove_file path, force
  end
end