Class: Duty::Tasks::Base::Shell
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
#execute ⇒ Object
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/duty/tasks.rb', line 159 def execute if !cmd @success = true return end begin @stdout, @stderr, @status = Open3.capture3(cmd) @success = true if status.success? rescue Exception => e @error = "ERROR: #{e.inspect}" ensure @logger << summary @logger << error [@stdout, @stderr, @status] end end |