Sha256: 28efcf7a2e2a9fb22f90b79fba4c6b720cf8da766ae5d8f500ccecfd0f49e135
Contents?: true
Size: 974 Bytes
Versions: 52
Compression:
Stored size: 974 Bytes
Contents
module CC module Analyzer module Formatters class Formatter def initialize(filesystem, output = $stdout) @filesystem = filesystem @output = output end def write(data) json = JSON.parse(data) json["engine_name"] = current_engine.name case json["type"].downcase when "issue" issues << json when "warning" warnings << json else raise "Invalid type found: #{json["type"]}" end end def started end def engine_running(engine) @current_engine = engine yield ensure @current_engine = nil end def finished end def close end def failed(_output) end InvalidFormatterError = Class.new(StandardError) private attr_reader :current_engine end end end end
Version data entries
52 entries across 52 versions & 1 rubygems