Class: R10K::Deployment::Basedir
- Inherits:
-
Object
- Object
- R10K::Deployment::Basedir
- Includes:
- Util::Purgeable
- Defined in:
- lib/r10k/deployment/basedir.rb
Instance Method Summary collapse
-
#desired_contents ⇒ Array<String>
List all environments that should exist in this basedir.
-
#initialize(path, deployment) ⇒ Basedir
constructor
Represents a directory containing environments.
-
#managed_directory ⇒ String
Return the path of the basedir.
Methods included from Util::Purgeable
#current_contents, #pending_contents, #purge!, #stale_contents
Constructor Details
#initialize(path, deployment) ⇒ Basedir
Represents a directory containing environments
10 11 12 13 |
# File 'lib/r10k/deployment/basedir.rb', line 10 def initialize(path,deployment) @path = path @deployment = deployment end |
Instance Method Details
#desired_contents ⇒ Array<String>
Note:
This implements a required method for the Purgeable mixin
List all environments that should exist in this basedir
27 28 29 30 31 32 33 34 |
# File 'lib/r10k/deployment/basedir.rb', line 27 def desired_contents @keepers = [] @deployment.sources.each do |source| next unless source.managed_directory == @path @keepers += source.desired_contents end @keepers end |
#managed_directory ⇒ String
Note:
This implements a required method for the Purgeable mixin
Return the path of the basedir
20 21 22 |
# File 'lib/r10k/deployment/basedir.rb', line 20 def managed_directory @path end |