Class: Build::DependencyTask
- Defined in:
- lib/build/dependency_node.rb
Overview
Represents a task that resolves and builds all provisions for a dependency.
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Attributes inherited from Task
Instance Method Summary collapse
- #dependency ⇒ Object
-
#initialize(*arguments, **options) ⇒ DependencyTask
constructor
Initialize the dependency task.
-
#update ⇒ Object
Build all provisions for the dependency and combine the resulting environments.
Methods inherited from Task
#name, #node_string, #task_class
Constructor Details
#initialize(*arguments, **options) ⇒ DependencyTask
Initialize the dependency task.
86 87 88 89 90 91 92 93 |
# File 'lib/build/dependency_node.rb', line 86 def initialize(*arguments, **) super @provisions = [] @environments = nil @environment = nil end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
95 96 97 |
# File 'lib/build/dependency_node.rb', line 95 def environment @environment end |
Instance Method Details
#dependency ⇒ Object
98 99 100 |
# File 'lib/build/dependency_node.rb', line 98 def dependency @node.dependency end |
#update ⇒ Object
Build all provisions for the dependency and combine the resulting environments.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/build/dependency_node.rb', line 103 def update Console.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 |