lib/nanoc/base/directed_graph.rb in nanoc-3.7.3 vs lib/nanoc/base/directed_graph.rb in nanoc-3.7.4
- old
+ new
@@ -209,11 +209,11 @@
# @return [Array] The list of all edges in this graph.
def edges
result = []
@vertices.each_pair do |v1, i1|
direct_successors_of(v1).map { |v2| @vertices[v2] }.each do |i2|
- result << [ i1, i2 ]
+ result << [i1, i2]
end
end
result
end
@@ -231,11 +231,11 @@
# @deprecated Use {#delete_edge} instead
def remove_edge(from, to)
delete_edge(from, to)
end
- private
+ private
# Invalidates cached data. This method should be called when the internal
# graph representation is changed.
def invalidate_caches
@predecessors = {}
@@ -247,10 +247,10 @@
# and returns related vertices (e.g. predecessors, successors).
def recursively_find_vertices(start, method)
all_vertices = Set.new
processed_vertices = Set.new
- unprocessed_vertices = [ start ]
+ unprocessed_vertices = [start]
until unprocessed_vertices.empty?
# Get next unprocessed vertex
vertex = unprocessed_vertices.pop
next if processed_vertices.include?(vertex)