class Pipeline::Tracker

Attributes

errors[R]
findings[R]
options[R]
warnings[R]

Public Class Methods

new(options) click to toggle source

Pass in the options. Let the Tracker be the one thing that gets passed around with options and collecting output.

# File lib/pipeline/tracker.rb, line 12
def initialize options
  @options = options
  @warnings = []
  @errors = []
  @findings = []
end

Public Instance Methods

error(error) click to toggle source
# File lib/pipeline/tracker.rb, line 24
def error error
  @errors << error
end
process(event) click to toggle source

Process events that

# File lib/pipeline/tracker.rb, line 20
def process event

end
report(finding) click to toggle source
# File lib/pipeline/tracker.rb, line 32
def report finding
  @findings << finding
end
to_json() click to toggle source
# File lib/pipeline/tracker.rb, line 36
def to_json
  s = "{ \"findings\": [ "
  @findings.each do |finding|
    s << finding.to_json
    s << ","
  end
  s = s.slice(0,s.length-1) # One easy way to remove the last ,
  s << "] }"
  s

end
warn(warning) click to toggle source
# File lib/pipeline/tracker.rb, line 28
def warn warning
  @warnings << warning
end