Class: Build::DependencyTask

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

Instance Attribute Summary collapse

Attributes inherited from Task

#group, #logger

Instance Method Summary collapse

Methods inherited from Task

#name, #node_string, #task_class

Constructor Details

#initialize(*arguments, **options) ⇒ DependencyTask

Returns a new instance of DependencyTask.



82
83
84
85
86
87
88
89
# File 'lib/build/dependency_node.rb', line 82

def initialize(*arguments, **options)
	super
	
	@provisions = []
	
	@environments = nil
	@environment = nil
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



91
92
93
# File 'lib/build/dependency_node.rb', line 91

def environment
  @environment
end

Instance Method Details

#dependencyObject



93
94
95
# File 'lib/build/dependency_node.rb', line 93

def dependency
	@node.dependency
end

#updateObject



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/build/dependency_node.rb', line 97

def update
	logger.debug(self) do |buffer|
		buffer.puts "building #{@node} which #{@node.dependency}"
		@node.provisions.each do |provision|
			buffer.puts "\tbuilding #{provision.provider.name} which #{provision}"
		end
	end
	
	# Lookup what things this dependency provides:
	@node.provisions.each do |provision|
		@provisions << invoke(
			@node.provision_node_for(provision)
		)
	end
	
	if wait_for_children?
		update_environments!
	else
		fail!(ProvisionsFailed)
	end
end