require 'fileutils' CLEAN = ['**/*.o', '**/*.bak'] def clean fu = ARGV.include?('--dryrun') ? FileUtils::DryRun : FileUtils CLEAN.each do |glob| Dir[glob].each do |path| fu.rm_rf(path) end end end