Method: Build::Graph::Walker#wait_on_paths
- Defined in:
- lib/build/graph/walker.rb
#wait_on_paths(paths) ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/build/graph/walker.rb', line 97 def wait_on_paths(paths) # If there are no paths, we are done: return true if paths.count == 0 # We create a new directed hyper-graph edge which waits for all paths to be ready (or failed): edge = Edge.new paths = paths.collect(&:to_s) paths.each do |path| # Is there a task generating this output? if outputs = @outputs[path] # When the output is ready, trigger this edge: outputs << edge edge.increment! end end failed = paths.any?{|path| @failed_outputs.include? path} return edge.wait && !failed end |