Method: Epi::Trigger#try_with

Defined in:
lib/epi/trigger.rb

#try_with(process) ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/epi/trigger.rb', line 35

def try_with(process)
  args = [process].reject(&:nil?)
  if test *args
    text = "Trigger on job #{job.id}"
    text << " (PID #{process.pid})" if process
    text << ": " << message if message
    logger.info text
    @handler.call process || job
  end
end