lib/puppet/util/graph.rb
# Make a graph where each of our children gets converted to
# the receiving end of an edge.  Call the same thing on all
# of our children, optionally using a block
Make a graph where each of our children gets converted to
the receiving end of an edge.  Call the same thing on all
of our children, optionally using a block
Make a graph where each of our children gets converted to the receiving end of an edge . Call the same thing on all of our children optionally using a block
def to_graph(graph = nil, &block)
    graph ||= Puppet::SimpleGraph.new
    self.each do |child|
      unless block_given? and ! yield(child)
        graph.add_edge(self, child)
        child.to_graph(graph, &block) if child.respond_to?(:to_graph)
      end
    end
    graph
  end
def to_graph ( graph = nil , & block ) graph ||= Puppet :: SimpleGraph . new self . each do | child | unless block_given? and ! yield ( child ) graph . add_edge ( self , child ) child . to_graph ( graph , & block ) if child . respond_to? ( :to_graph ) end end graph end
Make a graph where each of our children gets converted to
the receiving end of an edge.
Make a graph where each of our children gets converted to the receiving end of an edge .
# Allow our calling function to send in a graph, so that we # can call this recursively with one graph. # Do a topsort, which will throw an exception if the graph is cyclic.
graph
<not_specific>
block
<not_specific>