Sha256: 7314ddeaf33c2d7f27e1ce5da68664064d69ed32ed89ac5eef2bb2d9f1972ea1
Contents?: true
Size: 724 Bytes
Versions: 45
Compression:
Stored size: 724 Bytes
Contents
require "safe_yaml" module CC module Analyzer class EngineRegistry def initialize(dev_mode = false) @path = File.expand_path("../../../../config/engines.yml", __FILE__) @config = YAML.safe_load_file(@path) @dev_mode = dev_mode end def [](engine_name) if dev_mode? { "image" => "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
45 entries across 45 versions & 1 rubygems