Sha256: 78a595ce6b9a969cc0527e5f52e8a5dc17e88dee29bda3bebdc07a3fa3f307ed

Contents?: true

Size: 541 Bytes

Versions: 69

Compression:

Stored size: 541 Bytes

Contents

LOG_DIR = File.join(File.dirname(__FILE__), *%w[logs])

God.task do |t|
  t.name = 'task'
  t.valid_states = [:ok, :clean]
  t.initial_state = :ok
  t.interval = 5
  
  # t.clean = lambda do
  #   Dir[File.join(LOG_DIR, '*.log')].each do |f|
  #     File.delete(f)
  #   end
  # end
  
  t.clean = "rm #{File.join(LOG_DIR, '*.log')}"
  
  t.transition(:clean, :ok)
  
  t.transition(:ok, :clean) do |on|
    on.condition(:lambda) do |c|
      c.lambda = lambda do
        Dir[File.join(LOG_DIR, '*.log')].size > 1
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 21 rubygems

Version Path
dguettler-god-0.7.13.2 test/configs/task/task.god
dguettler-god-0.7.13.3 test/configs/task/task.god
dosire-god-0.7.10 test/configs/task/task.god
dosire-god-0.7.12 test/configs/task/task.god
dosire-god-0.7.9 test/configs/task/task.god
dunedain289-god-0.7.12.1 test/configs/task/task.god
dustin-god-0.7.7.1 test/configs/task/task.god
eric-god-0.7.10 test/configs/task/task.god
eric-god-0.7.11 test/configs/task/task.god
eric-god-0.7.12 test/configs/task/task.god
eric-god-0.7.14 test/configs/task/task.god
eric-god-0.7.7 test/configs/task/task.god
fotonauts-god-0.7.10 test/configs/task/task.god
fotonauts-god-0.7.12 test/configs/task/task.god
gohanlonllc-god-0.7.9 test/configs/task/task.god
gordoncww-god-0.7.11.1 test/configs/task/task.god
jreynolds-god-0.7.13 test/configs/task/task.god
jwilkins-god-0.7.9 test/configs/task/task.god
mathieuravaux-god-0.7.11 test/configs/task/task.god
mojombo-god-0.7.10 test/configs/task/task.god