Class: Build::DependencyNode

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

Overview

Represents a build graph node for resolving and building a single dependency.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(chain, dependency, environment, arguments) ⇒ DependencyNode

Initialize the dependency node.



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

def initialize(chain, dependency, environment, arguments)
	@chain = chain
	@dependency = dependency
	@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/dependency_node.rb', line 31

def arguments
  @arguments
end

#chainObject (readonly)

Returns the value of attribute chain.



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

def chain
  @chain
end

#dependencyObject (readonly)

Returns the value of attribute dependency.



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

def dependency
  @dependency
end

#environmentObject (readonly)

Returns the value of attribute environment.



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

def environment
  @environment
end

Instance Method Details

#==(other) ⇒ Object



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

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

#hashObject



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

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

#nameObject



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

def name
	@dependency.name
end

#provision_node_for(provision) ⇒ Object

Build a ProvisionNode for the given provision.



70
71
72
# File 'lib/build/dependency_node.rb', line 70

def provision_node_for(provision)
	ProvisionNode.new(@chain, provision, @environment, @arguments)
end

#provisionsObject



58
59
60
# File 'lib/build/dependency_node.rb', line 58

def provisions
	@chain.resolved[@dependency]
end

#public?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/build/dependency_node.rb', line 63

def public?
	@dependency.public?
end

#task_class(parent_task) ⇒ Object



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

def task_class(parent_task)
	DependencyTask
end