Module: Rake::Cleaner

Extended by:
FileUtils
Defined in:
lib/rake/clean.rb

Constant Summary

Constants included from FileUtils

FileUtils::LN_SUPPORTED, FileUtils::RUBY

Class Method Summary collapse

Methods included from FileUtils

ruby, safe_ln, sh, split_all

Class Method Details

.cleanup(file_name, opts = {}) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/rake/clean.rb', line 30

def cleanup(file_name, opts={})
  begin
    opts = { verbose: Rake.application.options.trace }.merge(opts)
    rm_r file_name, opts
  rescue StandardError => ex
    puts "Failed to remove #{file_name}: #{ex}" unless file_already_gone?(file_name)
  end
end

.cleanup_files(file_names) ⇒ Object



24
25
26
27
28
# File 'lib/rake/clean.rb', line 24

def cleanup_files(file_names)
  file_names.each do |file_name|
    cleanup(file_name)
  end
end