module RJack::TarPit::CleanTaskDefiner

Attributes

clean_globs[RW]

An array of file patterns to delete on clean.

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/rjack-tarpit/clean.rb, line 24
def initialize
  super

  @clean_globs ||= %w[ .source_index **/*~ **/.*~ ]

  add_define_hook( :define_clean_tasks )
end

Public Instance Methods

define_clean_tasks() click to toggle source
# File lib/rjack-tarpit/clean.rb, line 32
def define_clean_tasks
  desc 'Clean up (common backup file patterns)'
  task :clean do
    globs = clean_globs + [ 'pkg', rdoc_dir ]
    files = globs.map { |p| Dir[ p ] }.flatten
    rm_rf( files, :verbose => true ) unless files.empty?
  end
end