Sha256: 30dff7f920ebc71dd5e93925826d1bb3082db49d6083f980bf6fdd6083a84886

Contents?: true

Size: 743 Bytes

Versions: 163

Compression:

Stored size: 743 Bytes

Contents

module CC
  module Analyzer
    module Formatters
      autoload :Formatter, "cc/analyzer/formatters/formatter"
      autoload :HTMLFormatter, "cc/analyzer/formatters/html_formatter"
      autoload :JSONFormatter, "cc/analyzer/formatters/json_formatter"
      autoload :PlainTextFormatter, "cc/analyzer/formatters/plain_text_formatter"
      autoload :Spinner, "cc/analyzer/formatters/spinner"

      FORMATTERS = {
        html: HTMLFormatter,
        json: JSONFormatter,
        text: PlainTextFormatter,
      }.freeze

      def self.resolve(name)
        FORMATTERS[name.to_sym] or raise Formatter::InvalidFormatterError, "'#{name}' is not a valid formatter. Valid options are: #{FORMATTERS.keys.join(", ")}"
      end
    end
  end
end

Version data entries

163 entries across 163 versions & 2 rubygems

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