Method: Build::Graph::Walker#exit

Defined in:
lib/build/graph/walker.rb

#exit(task) ⇒ Object



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/build/graph/walker.rb', line 159

def exit(task)
  @logger.debug{"<-- #{task.node.process}"}
  
  # Fail outputs if the node failed:
  if task.failed?
    @failed_tasks << task
    
    if task.outputs
      @failed_outputs += task.outputs.collect{|path| path.to_s}
    end
  end
  
  # Clean the node's outputs:
  task.outputs.each do |path|
    path = path.to_s
    
    if edges = @outputs.delete(path)
      edges.each{|edge| edge.traverse(task)}
    end
  end
  
  # Notify the parent nodes that the child is done:
  if parents = @parents.delete(task.node)
    parents.each{|edge| edge.traverse(task)}
  end
  
  @monitor.add(task)
end