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.25.0 lib/cc/cli/config.rb
codeclimate-0.24.3 lib/cc/cli/config.rb
codeclimate-0.24.2 lib/cc/cli/config.rb
codeclimate-0.24.1 lib/cc/cli/config.rb
codeclimate-0.24.0 lib/cc/cli/config.rb
codeclimate-0.23.0 lib/cc/cli/config.rb
codeclimate-0.22.3 lib/cc/cli/config.rb
codeclimate-0.22.2 lib/cc/cli/config.rb
codeclimate-0.22.1 lib/cc/cli/config.rb
codeclimate-0.22.0 lib/cc/cli/config.rb
codeclimate-0.21.4 lib/cc/cli/config.rb
codeclimate-0.21.3 lib/cc/cli/config.rb
codeclimate-0.21.2 lib/cc/cli/config.rb
codeclimate-0.21.1 lib/cc/cli/config.rb
codeclimate-0.21.0 lib/cc/cli/config.rb
codeclimate-0.20.2 lib/cc/cli/config.rb
codeclimate-0.20.1 lib/cc/cli/config.rb
codeclimate-0.20.0 lib/cc/cli/config.rb
codeclimate-0.19.2 lib/cc/cli/config.rb
codeclimate-0.19.1 lib/cc/cli/config.rb