Module: RJack::TarPit::CleanTaskDefiner

Included in:
BaseStrategy
Defined in:
lib/rjack-tarpit/clean.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clean_globsObject

An array of file patterns to delete on clean.



22
23
24
# File 'lib/rjack-tarpit/clean.rb', line 22

def clean_globs
  @clean_globs
end

Instance Method Details

#define_clean_tasksObject



32
33
34
35
36
37
38
39
# 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

#initializeObject



24
25
26
27
28
29
30
# File 'lib/rjack-tarpit/clean.rb', line 24

def initialize
  super

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

  add_define_hook( :define_clean_tasks )
end