lib/pallets/graph.rb in pallets-0.2.0 vs lib/pallets/graph.rb in pallets-0.3.0
- old
+ new
@@ -14,9 +14,13 @@
def parents(node)
@nodes[node]
end
+ def empty?
+ @nodes.empty?
+ end
+
# Returns nodes topologically sorted, together with their order (number of
# nodes that have to be executed prior)
def sorted_with_order
# Identify groups of nodes that can be executed concurrently
groups = tsort_each.slice_when { |a, b| parents(a) != parents(b) }