Sha256: 2a3f8ca1bedd9df2e2c585639d1fb67ccf216231634e5c4ef6ceadb112590d41

Contents?: true

Size: 744 Bytes

Versions: 68

Compression:

Stored size: 744 Bytes

Contents

module CC
  module CLI
    class Config
      delegate :to_yaml, to: :config
      def initialize
        @config = {
          "engines" => {},
          "ratings" => { "paths" => [] },
        }
      end

      def add_engine(engine_name, engine_config)
        config["engines"][engine_name] = { "enabled" => true }

        if engine_config["default_config"].present?
          config["engines"][engine_name]["config"] = engine_config["default_config"]
        end

        config["ratings"]["paths"] |= engine_config["default_ratings_paths"]
      end

      def add_exclude_paths(paths)
        config["exclude_paths"] ||= []
        config["exclude_paths"] |= paths
      end

      private

      attr_reader :config
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
codeclimate-0.19.0 lib/cc/cli/config.rb
codeclimate-0.18.6 lib/cc/cli/config.rb
codeclimate-0.18.5 lib/cc/cli/config.rb
codeclimate-0.18.4 lib/cc/cli/config.rb
codeclimate-0.18.3 lib/cc/cli/config.rb
codeclimate-0.18.2 lib/cc/cli/config.rb
codeclimate-0.18.1 lib/cc/cli/config.rb
codeclimate-0.18.0 lib/cc/cli/config.rb