Sha256: 35c36d0158e9d7f866ac6c62c955fc06864e1b73cbf197a3ef45b963fe521e33

Contents?: true

Size: 514 Bytes

Versions: 6

Compression:

Stored size: 514 Bytes

Contents

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_remote_execution-1.1.1 app/lib/actions/remote_execution/helpers/live_output.rb
foreman_remote_execution-1.1.0 app/lib/actions/remote_execution/helpers/live_output.rb
foreman_remote_execution-1.0.0 app/lib/actions/remote_execution/helpers/live_output.rb
foreman_remote_execution-0.3.2 app/lib/actions/remote_execution/helpers/live_output.rb
foreman_remote_execution-0.3.1 app/lib/actions/remote_execution/helpers/live_output.rb
foreman_remote_execution-0.3.0 app/lib/actions/remote_execution/helpers/live_output.rb