Sha256: 600a0e826027ff7a1f61e34d7fd6bfff05c664793dc1017620a6503d15d67081

Contents?: true

Size: 643 Bytes

Versions: 9

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

9 entries across 9 versions & 1 rubygems

Version Path
codeclimate-0.29.0 lib/cc/analyzer/formatters.rb
codeclimate-0.28.0 lib/cc/analyzer/formatters.rb
codeclimate-0.27.2 lib/cc/analyzer/formatters.rb
codeclimate-0.27.1 lib/cc/analyzer/formatters.rb
codeclimate-0.27.0 lib/cc/analyzer/formatters.rb
codeclimate-0.27.0.rc1 lib/cc/analyzer/formatters.rb
codeclimate-0.26.0 lib/cc/analyzer/formatters.rb
codeclimate-0.25.1 lib/cc/analyzer/formatters.rb
codeclimate-0.25.0 lib/cc/analyzer/formatters.rb