Class: Build::ProvisionNode

Inherits:
Graph::Node
  • Object
show all
Defined in:
lib/build/provision_node.rb

Overview

Represents a build graph node for applying a single provision within a dependency chain.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(chain, provision, environment, arguments) ⇒ ProvisionNode

Initialize the provision node.



18
19
20
21
22
23
24
25
26
# File 'lib/build/provision_node.rb', line 18

def initialize(chain, provision, environment, arguments)
  @chain = chain
  @provision = provision
  @environment = environment
  @arguments = arguments
  
  # Wait here, for all dependent targets, to be done:
  super(Files::List::NONE, :inherit)
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



31
32
33
# File 'lib/build/provision_node.rb', line 31

def arguments
  @arguments
end

#chainObject (readonly)

Returns the value of attribute chain.



28
29
30
# File 'lib/build/provision_node.rb', line 28

def chain
  @chain
end

#environmentObject (readonly)

Returns the value of attribute environment.



30
31
32
# File 'lib/build/provision_node.rb', line 30

def environment
  @environment
end

#provisionObject (readonly)

Returns the value of attribute provision.



29
30
31
# File 'lib/build/provision_node.rb', line 29

def provision
  @provision
end

Instance Method Details

#==(other) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/build/provision_node.rb', line 34

def == other
  super and
    @chain == other.chain and
    @provision == other.provision and
    @environment == other.environment and
    @arguments == other.arguments
end

#dependency_node_for(dependency) ⇒ Object

Build a DependencyNode for the given dependency.



60
61
62
# File 'lib/build/provision_node.rb', line 60

def dependency_node_for(dependency)
  DependencyNode.new(@chain, dependency, @environment, @arguments)
end

#hashObject



43
44
45
# File 'lib/build/provision_node.rb', line 43

def hash
  super ^ @chain.hash ^ @provision.hash ^ @environment.hash ^ @arguments.hash
end

#nameObject



53
54
55
# File 'lib/build/provision_node.rb', line 53

def name
  @provision.name
end

#task_class(parent_task) ⇒ Object



48
49
50
# File 'lib/build/provision_node.rb', line 48

def task_class(parent_task)
  ProvisionTask
end