Class: RubyDeployer::DeployFile

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_deployer/deploy_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#artifactsObject (readonly)

Returns the value of attribute artifacts.



7
8
9
# File 'lib/ruby_deployer/deploy_file.rb', line 7

def artifacts
  @artifacts
end

#deploymentsObject (readonly)

Returns the value of attribute deployments.



7
8
9
# File 'lib/ruby_deployer/deploy_file.rb', line 7

def deployments
  @deployments
end

#instancesObject (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, options={}, &block)
  artifact_dsl = ArtifactDSL.new(options)
  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

#evaluateObject



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(options={}, &block)
  provision_dsl = ProvisionDSL.new(options)
  provision_dsl.execute(&block) if block_given?
  @instances = provision_dsl.instances
end