Class: R10K::Deployment
- Inherits:
-
Object
- Object
- R10K::Deployment
- Defined in:
- lib/r10k/deployment.rb,
lib/r10k/deployment/config.rb,
lib/r10k/deployment/source.rb,
lib/r10k/deployment/basedir.rb,
lib/r10k/deployment/environment.rb,
lib/r10k/deployment/config/loader.rb
Defined Under Namespace
Classes: Basedir, Config, Environment, Source
Class Method Summary collapse
-
.load_config(path) ⇒ R10K::Deployment
Generate a deployment object based on a config.
Instance Method Summary collapse
-
#environments ⇒ Array<R10K::Deployment::Environment>
Lazily load all environments.
- #fetch_sources ⇒ Object
-
#initialize(config) ⇒ Deployment
constructor
A new instance of Deployment.
-
#sources ⇒ Array<R10K::Deployment::Source>
Lazily load all sources.
Constructor Details
#initialize(config) ⇒ Deployment
Returns a new instance of Deployment.
20 21 22 23 24 |
# File 'lib/r10k/deployment.rb', line 20 def initialize(config) @config = config load_environments end |
Class Method Details
.load_config(path) ⇒ R10K::Deployment
Generate a deployment object based on a config
15 16 17 18 |
# File 'lib/r10k/deployment.rb', line 15 def self.load_config(path) config = R10K::Deployment::Config.new(path) new(config) end |
Instance Method Details
#environments ⇒ Array<R10K::Deployment::Environment>
Lazily load all environments
This instantiates the @_environments instance variable, but should not be used directly as it could be legitimately unset if we’re doing lazy loading.
54 55 56 57 |
# File 'lib/r10k/deployment.rb', line 54 def environments load_environments if @_environments.nil? @_environments end |
#fetch_sources ⇒ Object
26 27 28 29 30 31 |
# File 'lib/r10k/deployment.rb', line 26 def fetch_sources sources.each do |source| source.fetch_remote end load_environments end |
#sources ⇒ Array<R10K::Deployment::Source>
Lazily load all sources
This instantiates the @_sources instance variable, but should not be used directly as it could be legitimately unset if we’re doing lazy loading.
41 42 43 44 |
# File 'lib/r10k/deployment.rb', line 41 def sources load_sources if @_sources.nil? @_sources end |