Method: CC::Analyzer::Formatters::JSONFormatter#write

Defined in:
lib/cc/analyzer/formatters/json_formatter.rb

#write(data) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/cc/analyzer/formatters/json_formatter.rb', line 18

def write(data)
  document = JSON.parse(data)
  document["engine_name"] = current_engine.name

  if @has_begun
    print ",\n"
  end

  print document.to_json
  @has_begun = true
end