lib/r10k/deployment.rb in r10k-2.0.3 vs lib/r10k/deployment.rb in r10k-2.1.0

- old
+ new

@@ -13,14 +13,16 @@ require 'r10k/deployment/config' # Generate a deployment object based on a config # + # @deprecated + # # @param path [String] The path to the deployment config # @return [R10K::Deployment] The deployment loaded with the given config - def self.load_config(path) - config = R10K::Deployment::Config.new(path) + def self.load_config(path, overrides={}) + config = R10K::Deployment::Config.new(path, overrides) new(config) end # @!attribute [r] config # @return [R10K::Deployment::Config] @@ -96,21 +98,21 @@ end end def accept(visitor) visitor.visit(:deployment, self) do - sources.each do |env| - env.accept(visitor) + sources.each do |source| + source.accept(visitor) end end end private def load_sources - sources = @config.setting(:sources) + sources = @config[:sources] if sources.nil? || sources.empty? - raise R10K::Error, "'sources' key in #{@config.configfile} missing or empty." + raise R10K::Error, "Unable to load sources; the supplied configuration does not define the 'sources' key" end @_sources = sources.map do |(name, hash)| R10K::Source.from_hash(name, hash) end end