Class: RubyDeployer::DeployFile
- Inherits:
-
Object
- Object
- RubyDeployer::DeployFile
- Defined in:
- lib/ruby_deployer/deploy_file.rb
Instance Attribute Summary collapse
-
#artifacts ⇒ Object
readonly
Returns the value of attribute artifacts.
-
#deployments ⇒ Object
readonly
Returns the value of attribute deployments.
-
#instances ⇒ Object
readonly
Returns the value of attribute instances.
Instance Method Summary collapse
- #artifact(name, options = {}, &block) ⇒ Object
- #deploy(&block) ⇒ Object
- #evaluate ⇒ Object
-
#initialize(file) ⇒ DeployFile
constructor
A new instance of DeployFile.
- #provision(options = {}, &block) ⇒ Object
Constructor Details
#initialize(file) ⇒ DeployFile
Returns a new instance of DeployFile.
9 10 11 12 13 14 |
# File 'lib/ruby_deployer/deploy_file.rb', line 9 def initialize file @file = file @artifacts = Hash.new @instances = [] @deployments = {} end |
Instance Attribute Details
#artifacts ⇒ Object (readonly)
Returns the value of attribute artifacts.
7 8 9 |
# File 'lib/ruby_deployer/deploy_file.rb', line 7 def artifacts @artifacts end |
#deployments ⇒ Object (readonly)
Returns the value of attribute deployments.
7 8 9 |
# File 'lib/ruby_deployer/deploy_file.rb', line 7 def deployments @deployments end |
#instances ⇒ Object (readonly)
Returns the value of attribute instances.
7 8 9 |
# File 'lib/ruby_deployer/deploy_file.rb', line 7 def instances @instances end |
Instance Method Details
#artifact(name, options = {}, &block) ⇒ Object
16 17 18 19 20 |
# File 'lib/ruby_deployer/deploy_file.rb', line 16 def artifact(name, ={}, &block) artifact_dsl = ArtifactDSL.new() artifact_dsl.execute(&block) if block_given? @artifacts[name] = artifact_dsl end |
#deploy(&block) ⇒ Object
28 29 30 31 32 |
# File 'lib/ruby_deployer/deploy_file.rb', line 28 def deploy(&block) deployment_dsl = DeploymentDSL.new deployment_dsl.execute(&block) if block_given? @deployments = deployment_dsl.deployments end |
#evaluate ⇒ Object
34 35 36 |
# File 'lib/ruby_deployer/deploy_file.rb', line 34 def evaluate eval(contents, binding) end |
#provision(options = {}, &block) ⇒ Object
22 23 24 25 26 |
# File 'lib/ruby_deployer/deploy_file.rb', line 22 def provision(={}, &block) provision_dsl = ProvisionDSL.new() provision_dsl.execute(&block) if block_given? @instances = provision_dsl.instances end |