Sha256: 853bf02c705d24e5f9b3a795cb827f4853760cee9418a39d68eb8c2b7735ae10

Contents?: true

Size: 632 Bytes

Versions: 21

Compression:

Stored size: 632 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 InvalidFormatterError, "'#{name}' is not a valid formatter. Valid options are: #{FORMATTERS.keys.join(', ')}"
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
codeclimate-0.16.5 lib/cc/analyzer/formatters.rb
codeclimate-0.16.4 lib/cc/analyzer/formatters.rb
codeclimate-0.16.3 lib/cc/analyzer/formatters.rb
codeclimate-0.16.2 lib/cc/analyzer/formatters.rb
codeclimate-0.16.1 lib/cc/analyzer/formatters.rb
codeclimate-0.16.0 lib/cc/analyzer/formatters.rb
codeclimate-0.15.2 lib/cc/analyzer/formatters.rb
codeclimate-0.15.1 lib/cc/analyzer/formatters.rb
codeclimate-0.15.0 lib/cc/analyzer/formatters.rb
codeclimate-0.14.7 lib/cc/analyzer/formatters.rb
codeclimate-0.14.6 lib/cc/analyzer/formatters.rb
codeclimate-0.14.5 lib/cc/analyzer/formatters.rb
codeclimate-0.14.4 lib/cc/analyzer/formatters.rb
codeclimate-0.14.3 lib/cc/analyzer/formatters.rb
codeclimate-0.14.2 lib/cc/analyzer/formatters.rb
codeclimate-0.14.1 lib/cc/analyzer/formatters.rb
codeclimate-0.14.0 lib/cc/analyzer/formatters.rb
codeclimate-0.13.0 lib/cc/analyzer/formatters.rb
codeclimate-0.11.0 lib/cc/analyzer/formatters.rb
codeclimate-0.10.1 lib/cc/analyzer/formatters.rb