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.48.0 lib/cc/cli/config.rb
codeclimate-0.47.0 lib/cc/cli/config.rb
codeclimate-0.46.0 lib/cc/cli/config.rb
codeclimate-0.45.0 lib/cc/cli/config.rb
codeclimate-0.44.0 lib/cc/cli/config.rb
codeclimate-0.43.1 lib/cc/cli/config.rb
codeclimate-0.43.0 lib/cc/cli/config.rb
codeclimate-0.42.1 lib/cc/cli/config.rb
codeclimate-0.42.0 lib/cc/cli/config.rb
codeclimate-0.41.0 lib/cc/cli/config.rb
codeclimate-0.40.3 lib/cc/cli/config.rb
codeclimate-0.40.2 lib/cc/cli/config.rb
codeclimate-0.40.1 lib/cc/cli/config.rb
codeclimate-0.40.0 lib/cc/cli/config.rb
codeclimate-0.39.0 lib/cc/cli/config.rb
codeclimate-0.38.1 lib/cc/cli/config.rb
codeclimate-0.38.0 lib/cc/cli/config.rb
codeclimate-0.37.0 lib/cc/cli/config.rb
codeclimate-0.36.0 lib/cc/cli/config.rb
codeclimate-0.35.2 lib/cc/cli/config.rb