class Burner::Output

A Pipeline execution can write main output, which is really an outline to whats happening, step-by-step. This is not meant to replace or be true logging, but serve more as a summary for each of the jobs. Each job can decide what it would like to include in this summary and leverage an instance of this class for inclusion of that information.

Constants

RULER_LENGTH

Attributes

id[R]
job_count[R]
outs[R]

Public Class Methods

new(id: SecureRandom.uuid, outs: [$stdout]) click to toggle source
# File lib/burner/output.rb, line 20
def initialize(id: SecureRandom.uuid, outs: [$stdout])
  @id        = id
  @outs      = Array(outs)
  @job_count = 1
end

Public Instance Methods

complete(time_in_seconds) click to toggle source
# File lib/burner/output.rb, line 52
def complete(time_in_seconds)
  detail("Completed in: #{time_in_seconds.round(3)} second(s)")

  self
end
detail(message) click to toggle source
# File lib/burner/output.rb, line 40
def detail(message)
  write("  - #{message}")

  self
end
ruler() click to toggle source
# File lib/burner/output.rb, line 26
def ruler
  write('-' * RULER_LENGTH)

  self
end
title(message) click to toggle source
# File lib/burner/output.rb, line 32
def title(message)
  write("[#{job_count}] #{message}")

  @job_count += 1

  self
end
write(message) click to toggle source
# File lib/burner/output.rb, line 46
def write(message)
  raw("[#{id} | #{Time.now.utc}] #{message}")

  self
end

Private Instance Methods

raw(message) click to toggle source
# File lib/burner/output.rb, line 60
def raw(message)
  outs.each { |out| out.puts(message) }

  self
end