Sha256: bc59163425d357250f908ebae585ef2dce5df46e0aabd6056c709697e14a364f

Contents?: true

Size: 661 Bytes

Versions: 10

Compression:

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
codeclimate-0.6.1 lib/cc/analyzer/formatters.rb
codeclimate-0.6.0 lib/cc/analyzer/formatters.rb
codeclimate-0.5.0 lib/cc/analyzer/formatters.rb
codeclimate-0.4.4 lib/cc/analyzer/formatters.rb
codeclimate-0.4.3 lib/cc/analyzer/formatters.rb
codeclimate-0.4.1 lib/cc/analyzer/formatters.rb
codeclimate-0.4.0 lib/cc/analyzer/formatters.rb
codeclimate-0.3.2 lib/cc/analyzer/formatters.rb
codeclimate-0.3.1 lib/cc/analyzer/formatters.rb
codeclimate-0.3.0 lib/cc/analyzer/formatters.rb