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/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::Environment::Base>
Lazily load all environments.
-
#initialize(config) ⇒ Deployment
constructor
A new instance of Deployment.
- #preload! ⇒ Object (also: #fetch_sources)
-
#sources ⇒ Array<R10K::Source::Base>
Lazily load all sources.
Constructor Details
#initialize(config) ⇒ Deployment
Returns a new instance of Deployment.
23 24 25 |
# File 'lib/r10k/deployment.rb', line 23 def initialize(config) @config = config end |
Class Method Details
.load_config(path) ⇒ R10K::Deployment
Generate a deployment object based on a config
18 19 20 21 |
# File 'lib/r10k/deployment.rb', line 18 def self.load_config(path) config = R10K::Deployment::Config.new(path) new(config) end |
Instance Method Details
#environments ⇒ Array<R10K::Environment::Base>
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.
53 54 55 56 |
# File 'lib/r10k/deployment.rb', line 53 def environments load_environments if @_environments.nil? @_environments end |
#preload! ⇒ Object Also known as: fetch_sources
27 28 29 |
# File 'lib/r10k/deployment.rb', line 27 def preload! sources.each(&:preload!) end |
#sources ⇒ Array<R10K::Source::Base>
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.
40 41 42 43 |
# File 'lib/r10k/deployment.rb', line 40 def sources load_sources if @_sources.nil? @_sources end |