# File lib/r10k/deployment/config.rb, line 16 def initialize(configfile, overrides={}) @configfile = configfile @overrides = overrides load_config end
Load and store a config file, and set relevant options
@param [String] configfile The path to the YAML config file
# File lib/r10k/deployment/config.rb, line 37 def load_config loader = R10K::Settings::Loader.new hash = loader.read(@configfile) with_overrides = hash.merge(@overrides) do |key, oldval, newval| logger.debug2 _("Overriding config file setting '%{key}': '%{old_val}' -> '%{new_val}'") % {key: key, old_val: oldval, new_val: newval} newval end @config = R10K::Settings.global_settings.evaluate(with_overrides) initializer = R10K::Initializers::GlobalInitializer.new(@config) initializer.call end
Perform a scan for key and check for both string and symbol keys
# File lib/r10k/deployment/config.rb, line 24 def setting(key) @config[key] end
# File lib/r10k/deployment/config.rb, line 30 def settings @config end