Sha256: 5e6ec2e87df9156adfd423ea4452f25be9fcc090deaaf9be7d11d3e4152784a9

Contents?: true

Size: 728 Bytes

Versions: 63

Compression:

Stored size: 728 Bytes

Contents

module CC
  module Analyzer
    class EngineRegistry
      def initialize(dev_mode = false)
        @path = File.expand_path("../../../../config/engines.yml", __FILE__)
        @config = YAML.safe_load(File.read(@path))
        @dev_mode = dev_mode
      end

      def [](engine_name)
        if dev_mode?
          { "channels" => { "stable" => "codeclimate/codeclimate-#{engine_name}:latest" } }
        else
          @config[engine_name]
        end
      end

      def list
        @config
      end

      def key?(engine_name)
        return true if dev_mode?
        list.key?(engine_name)
      end

      alias_method :exists?, :key?

      private

      def dev_mode?
        @dev_mode
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
codeclimate-0.43.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.42.1 lib/cc/analyzer/engine_registry.rb
codeclimate-0.42.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.41.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.40.3 lib/cc/analyzer/engine_registry.rb
codeclimate-0.40.2 lib/cc/analyzer/engine_registry.rb
codeclimate-0.40.1 lib/cc/analyzer/engine_registry.rb
codeclimate-0.40.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.39.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.38.1 lib/cc/analyzer/engine_registry.rb
codeclimate-0.38.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.37.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.36.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.35.2 lib/cc/analyzer/engine_registry.rb
codeclimate-0.35.1 lib/cc/analyzer/engine_registry.rb
codeclimate-0.35.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.34.1 lib/cc/analyzer/engine_registry.rb
codeclimate-0.34.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.33.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.32.1 lib/cc/analyzer/engine_registry.rb