Module: Actions::RemoteExecution::Helpers::LiveOutput

Included in:
RunHostJob, RunProxyCommand
Defined in:
app/lib/actions/remote_execution/helpers/live_output.rb

Instance Method Summary collapse

Instance Method Details

#exception_to_output(context, exception, timestamp = Time.now.getlocal) ⇒ Object



5
6
7
# File 'app/lib/actions/remote_execution/helpers/live_output.rb', line 5

def exception_to_output(context, exception, timestamp = Time.now.getlocal)
  format_output(context + ": #{exception.class} - #{exception.message}", 'debug', timestamp)
end

#format_output(message, type = 'debug', timestamp = Time.now.getlocal) ⇒ Object



9
10
11
12
13
# File 'app/lib/actions/remote_execution/helpers/live_output.rb', line 9

def format_output(message, type = 'debug', timestamp = Time.now.getlocal)
  { 'output_type' => type,
    'output' => message,
    'timestamp' => timestamp.to_f }
end