Class: Kiba::Extend::Utils::PreJobNukeTask

Inherits:
PreJobTask
  • Object
show all
Defined in:
lib/kiba/extend/utils/pre_job_nuke_task.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PreJobTask

#initialize

Constructor Details

This class inherits a constructor from Kiba::Extend::Utils::PreJobTask

Class Method Details

.callObject



8
9
10
# File 'lib/kiba/extend/utils/pre_job_nuke_task.rb', line 8

def call
  new.call
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
# File 'lib/kiba/extend/utils/pre_job_nuke_task.rb', line 13

def call
  return unless runnable?

  dirs.each do |dir|
    puts "Deleting files from #{dir}..."
    Dir.each_child(dir) { |f| FileUtils.rm("#{dir}/#{f}") }
  end
end