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.69.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.68.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.67.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.66.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.65.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.64.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.63.7 lib/cc/analyzer/engine_registry.rb
codeclimate-0.63.6 lib/cc/analyzer/engine_registry.rb
codeclimate-0.63.5 lib/cc/analyzer/engine_registry.rb
codeclimate-0.63.4 lib/cc/analyzer/engine_registry.rb
codeclimate-0.63.3 lib/cc/analyzer/engine_registry.rb
codeclimate-0.63.2 lib/cc/analyzer/engine_registry.rb
codeclimate-0.63.1 lib/cc/analyzer/engine_registry.rb
codeclimate-0.63.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.62.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.61.1 lib/cc/analyzer/engine_registry.rb
codeclimate-0.61.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.60.1 lib/cc/analyzer/engine_registry.rb
codeclimate-0.60.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.59.1 lib/cc/analyzer/engine_registry.rb