Class: Duty::Tasks::Base::Ruby

Inherits:
Command
  • Object
show all
Defined in:
lib/duty/tasks.rb

Instance Method Summary collapse

Methods inherited from Command

#description, #error, #initialize, #logger, run, #success?

Constructor Details

This class inherits a constructor from Duty::Tasks::Base::Command

Instance Method Details

#executeObject



137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/duty/tasks.rb', line 137

def execute
  begin
    @callable.call
    @success = true
  rescue Exception => e
    @error = "ERROR: #{e.inspect}"
  ensure
    @logger << summary 
    @logger << error
    @callable
  end
end