Sha256: 6a0efd8c7637ee7dfdf763ad207012f34f2db9051cdfc6e9e65d7c421d8c8b6b

Contents?: true

Size: 749 Bytes

Versions: 221

Compression:

Stored size: 749 Bytes

Contents

module CC
  module Analyzer
    module Formatters
      class JSONFormatter < Formatter
        def initialize(filesystem)
          @filesystem = filesystem
          @has_begun = false
        end

        def started
          print "["
        end

        def finished
          print "]\n"
        end

        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

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

Version data entries

221 entries across 221 versions & 2 rubygems

Version Path
codeclimate-0.85.27 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.85.26 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.85.25 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-0.85.24 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.54 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.53 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.52 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.51 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.50 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.49 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.48 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.47 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.46 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.45 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.44 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.43 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.42 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.41 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.40 lib/cc/analyzer/formatters/json_formatter.rb
codeclimate-fede-0.85.39 lib/cc/analyzer/formatters/json_formatter.rb