Sha256: 16ec8152caee39d84f9fa738d181b6f1f8140ad15bcfcf7443bf1836e98cf68a

Contents?: true

Size: 643 Bytes

Versions: 29

Compression:

Stored size: 643 Bytes

Contents

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

      FORMATTERS = {
        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

29 entries across 29 versions & 1 rubygems

Version Path
codeclimate-0.18.6 lib/cc/analyzer/formatters.rb
codeclimate-0.18.5 lib/cc/analyzer/formatters.rb
codeclimate-0.18.4 lib/cc/analyzer/formatters.rb
codeclimate-0.18.3 lib/cc/analyzer/formatters.rb
codeclimate-0.18.2 lib/cc/analyzer/formatters.rb
codeclimate-0.18.1 lib/cc/analyzer/formatters.rb
codeclimate-0.18.0 lib/cc/analyzer/formatters.rb
codeclimate-0.17.0 lib/cc/analyzer/formatters.rb
codeclimate-0.16.6 lib/cc/analyzer/formatters.rb