Class: Borg::Configuration::Applications::Application
- Inherits:
-
Object
- Object
- Borg::Configuration::Applications::Application
- Defined in:
- lib/borg/configuration/applications.rb
Instance Attribute Summary collapse
-
#execution_blocks ⇒ Object
Returns the value of attribute execution_blocks.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#stages ⇒ Object
Returns the value of attribute stages.
Instance Method Summary collapse
-
#initialize(name, namespace) ⇒ Application
constructor
A new instance of Application.
- #load_into(config) ⇒ Object
Constructor Details
#initialize(name, namespace) ⇒ Application
Returns a new instance of Application.
33 34 35 36 37 38 |
# File 'lib/borg/configuration/applications.rb', line 33 def initialize(name, namespace) @execution_blocks = [] @name = name @namespace = namespace @stages = {} end |
Instance Attribute Details
#execution_blocks ⇒ Object
Returns the value of attribute execution_blocks.
29 30 31 |
# File 'lib/borg/configuration/applications.rb', line 29 def execution_blocks @execution_blocks end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/borg/configuration/applications.rb', line 31 def name @name end |
#stages ⇒ Object
Returns the value of attribute stages.
30 31 32 |
# File 'lib/borg/configuration/applications.rb', line 30 def stages @stages end |
Instance Method Details
#load_into(config) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/borg/configuration/applications.rb', line 40 def load_into(config) if config.respond_to?(:application) # Undefine the stage method now that the app:stage config is created = class << config; self; end .send(:undef_method, 'application') # Create a capistrano variable for stage config.instance_exec(@name, &(lambda { |name| set :application, name })) end @execution_blocks.each { |blk| config.load &blk } end |