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.59.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.58.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.57.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.56.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.55.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.54.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.53.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.52.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.51.3 lib/cc/analyzer/engine_registry.rb
codeclimate-0.51.2 lib/cc/analyzer/engine_registry.rb
codeclimate-0.51.1 lib/cc/analyzer/engine_registry.rb
codeclimate-0.51.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.50.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.49.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.48.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.47.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.46.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.45.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.44.0 lib/cc/analyzer/engine_registry.rb
codeclimate-0.43.1 lib/cc/analyzer/engine_registry.rb