Sha256: ac67cac9f8b6adcb9ef1f90561c21d78b6eb51872b685e9a9add04eed77bd48b

Contents?: true

Size: 542 Bytes

Versions: 39

Compression:

Stored size: 542 Bytes

Contents

module CrashReporter
  OUTPUT_LINES_TO_REPORT = 70

  def report_crash reply_exchange, info
    stdout = `tail -n #{OUTPUT_LINES_TO_REPORT} #{info[:out_file]}`
    stderr = `cat #{info[:err_file]}` + \
    info[:footer_text]

    send_crash_message reply_exchange, stdout, stderr

    "#{stdout}\n#{stderr}"
  end

  def send_crash_message reply_exchange, output, error
    reply = {:type => :crash, :hostname => Socket.gethostname,
      :stdout => output, :stderr => error}
    reply_exchange.publish(Yajl::Encoder.encode(reply))
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
gorgon-0.11.0 lib/gorgon/crash_reporter.rb
gorgon-0.10.5 lib/gorgon/crash_reporter.rb
gorgon-0.10.4 lib/gorgon/crash_reporter.rb
gorgon-0.10.3 lib/gorgon/crash_reporter.rb
gorgon-0.10.2 lib/gorgon/crash_reporter.rb
gorgon-0.10.1 lib/gorgon/crash_reporter.rb
gorgon-0.10.0 lib/gorgon/crash_reporter.rb
gorgon-0.9.0 lib/gorgon/crash_reporter.rb
gorgon-0.8.4 lib/gorgon/crash_reporter.rb
gorgon-0.8.3 lib/gorgon/crash_reporter.rb
gorgon-0.8.2 lib/gorgon/crash_reporter.rb
gorgon-0.8.1 lib/gorgon/crash_reporter.rb
gorgon-0.8.0 lib/gorgon/crash_reporter.rb
gorgon-0.7.1 lib/gorgon/crash_reporter.rb
gorgon-0.7.0 lib/gorgon/crash_reporter.rb
gorgon-0.7.0.rc4 lib/gorgon/crash_reporter.rb
gorgon-0.7.0.rc3 lib/gorgon/crash_reporter.rb
gorgon-0.7.0.rc2 lib/gorgon/crash_reporter.rb
gorgon-0.7.0.rc1 lib/gorgon/crash_reporter.rb
gorgon-0.6.5 lib/gorgon/crash_reporter.rb