Sha256: e7d960481258141db6f2c56c2ff8d1dbb3118683a723fdf3088542beba922727

Contents?: true

Size: 634 Bytes

Versions: 15

Compression:

Stored size: 634 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

15 entries across 15 versions & 1 rubygems

Version Path
codeclimate-0.9.7 lib/cc/analyzer/formatters.rb
codeclimate-0.9.6 lib/cc/analyzer/formatters.rb
codeclimate-0.9.5 lib/cc/analyzer/formatters.rb
codeclimate-0.9.4 lib/cc/analyzer/formatters.rb
codeclimate-0.9.3 lib/cc/analyzer/formatters.rb
codeclimate-0.9.2 lib/cc/analyzer/formatters.rb
codeclimate-0.9.1 lib/cc/analyzer/formatters.rb
codeclimate-0.9.0 lib/cc/analyzer/formatters.rb
codeclimate-0.8.1 lib/cc/analyzer/formatters.rb
codeclimate-0.8.0 lib/cc/analyzer/formatters.rb
codeclimate-0.7.2 lib/cc/analyzer/formatters.rb
codeclimate-0.7.0 lib/cc/analyzer/formatters.rb
codeclimate-0.6.4 lib/cc/analyzer/formatters.rb
codeclimate-0.6.3 lib/cc/analyzer/formatters.rb
codeclimate-0.6.2 lib/cc/analyzer/formatters.rb