lib/cc/analyzer/formatters/plain_text_formatter.rb in codeclimate-0.1.2 vs lib/cc/analyzer/formatters/plain_text_formatter.rb in codeclimate-0.1.3
- old
+ new
@@ -12,13 +12,11 @@
end
def write(data)
if data.present?
json = JSON.parse(data)
- if @active_engine
- json["engine_name"] = @active_engine.name
- end
+ json["engine_name"] = current_engine.name
case json["type"].downcase
when "issue"
issues << json
when "warning"
@@ -52,15 +50,13 @@
print(colorize(" and #{pluralize(warnings.size, "warning")}", :green))
end
puts(colorize(".", :green))
end
- def engine_running(engine)
- @active_engine = engine
- with_spinner("Running #{engine.name}: ") do
- yield
+ def engine_running(engine, &block)
+ super(engine) do
+ with_spinner("Running #{current_engine.name}: ", &block)
end
- @active_engine = nil
end
def failed(output)
spinner.stop("Failed")
puts colorize("\nAnalysis failed with the following output:", :red)