Sha256: fb08a297b045e8e3ba86291a2dbc3177914140b6d653e1f1f6df1bbeb49680a1

Contents?: true

Size: 638 Bytes

Versions: 32

Compression:

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

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
codeclimate-0.2.12 lib/cc/analyzer/formatters.rb
codeclimate-0.2.11 lib/cc/analyzer/formatters.rb
codeclimate-0.2.9 lib/cc/analyzer/formatters.rb
codeclimate-0.2.7 lib/cc/analyzer/formatters.rb
codeclimate-0.2.6 lib/cc/analyzer/formatters.rb
codeclimate-0.2.4 lib/cc/analyzer/formatters.rb
codeclimate-0.2.2 lib/cc/analyzer/formatters.rb
codeclimate-0.2.1 lib/cc/analyzer/formatters.rb
codeclimate-0.2 lib/cc/analyzer/formatters.rb
codeclimate-0.1.5 lib/cc/analyzer/formatters.rb
codeclimate-0.1.4 lib/cc/analyzer/formatters.rb
codeclimate-0.1.3 lib/cc/analyzer/formatters.rb
codeclimate-0.1.2 lib/cc/analyzer/formatters.rb
codeclimate-0.1.0 lib/cc/analyzer/formatters.rb
codeclimate-0.0.25 lib/cc/analyzer/formatters.rb
codeclimate-0.0.24 lib/cc/analyzer/formatters.rb
codeclimate-0.0.23 lib/cc/analyzer/formatters.rb
codeclimate-0.0.22 lib/cc/analyzer/formatters.rb
codeclimate-0.0.21 lib/cc/analyzer/formatters.rb
codeclimate-0.0.18 lib/cc/analyzer/formatters.rb