Class: Hookit::Resource::Execute

Inherits:
Base
  • Object
show all
Defined in:
lib/hookit/resource/execute.rb

Direct Known Subclasses

Cron

Instance Attribute Summary

Attributes inherited from Base

#dict

Instance Method Summary collapse

Methods inherited from Base

#action, actions, #can_run?, default_action, #default_action, field, #not_if, #only_if

Constructor Details

#initialize(name) ⇒ Execute

Returns a new instance of Execute.



26
27
28
29
30
31
# File 'lib/hookit/resource/execute.rb', line 26

def initialize(name)
  command name unless command
  timeout 3600
  returns 0
  super
end

Instance Method Details

#run(action) ⇒ Object



33
34
35
36
37
38
39
40
41
42
# File 'lib/hookit/resource/execute.rb', line 33

def run(action)
  case action
  when :run
    if stream
      stream!
    else
      run!
    end
  end
end