Sha256: a0cba53c24ba3d5ca7ff7805dfc5954af1e87192d0c0c618f9ea4bf463e4f7ee

Contents?: true

Size: 604 Bytes

Versions: 13

Compression:

Stored size: 604 Bytes

Contents

module CC
  module Analyzer
    module Formatters
      class JSONFormatter < Formatter

        def engine_running(engine)
          @active_engine = engine
          yield
          @active_engine = nil
        end

        def write(data)
          return unless data.present?

          document = JSON.parse(data)
          document["engine_name"] = @active_engine.name
          puts document.to_json
        end

        def failed(output)
          $stderr.puts "\nAnalysis failed with the following output:"
          $stderr.puts output
          exit 1
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
codeclimate-0.0.18 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.17 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.16 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.15 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.14 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.13 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.11 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.10 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.9 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.7 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.6 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.5 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.0.1 lib/cc/analyzer/formatters/json_formatter.rb