Class: CapistranoDeploy::Multistage::Config
- Inherits:
-
Object
- Object
- CapistranoDeploy::Multistage::Config
- Defined in:
- lib/capistrano-deploy/multistage.rb
Overview
Handles multistage configuration
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#stages ⇒ Object
readonly
Returns the value of attribute stages.
Instance Method Summary collapse
- #inferred_stage ⇒ Object
-
#initialize(config) ⇒ Config
constructor
A new instance of Config.
- #stage(name, options = {}) ⇒ Object
Constructor Details
#initialize(config) ⇒ Config
Returns a new instance of Config.
50 51 52 53 |
# File 'lib/capistrano-deploy/multistage.rb', line 50 def initialize(config) @config = config @stages = [] end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
47 48 49 |
# File 'lib/capistrano-deploy/multistage.rb', line 47 def config @config end |
#stages ⇒ Object (readonly)
Returns the value of attribute stages.
48 49 50 |
# File 'lib/capistrano-deploy/multistage.rb', line 48 def stages @stages end |
Instance Method Details
#inferred_stage ⇒ Object
59 60 61 62 63 64 |
# File 'lib/capistrano-deploy/multistage.rb', line 59 def inferred_stage if config.using_recipe?(:git) branch = config.local_branch stages.find { |stage| stage.[:branch].to_s == branch } end end |