Class Puppet::SimpleGraph
In: lib/puppet/simple_graph.rb
Parent: Object

A hopefully-faster graph class to replace the use of GRATR.

Methods

Classes and Modules

Class Puppet::SimpleGraph::VertexWrapper

Public Class methods

Public Instance methods

Add a new edge. The graph user has to create the edge instance, since they have to specify what kind of edge it is.

Add a new vertex to the graph.

Clear our graph.

Which resources depend upon the given resource.

Which resources a given resource depends upon.

Whether our graph is directed. Always true. Used to produce dot files.

Call dotty for the graph which is written to the file ‘graph.dot’ in the # current directory.

Find a matching edge. Note that this only finds the first edge, not all of them or whatever.

Is there an edge between the two vertices?

Determine all of the leaf nodes below a given vertex.

Collect all of the edges that the passed events match. Returns an array of edges.

Remove an edge from our graph.

Remove a vertex from the graph.

Return a reversed version of this graph.

Return the size of the graph.

Take container information from another graph and use it to replace any container vertices with their respective leaves. This creates direct relationships where there were previously indirect relationships through the containers.

Return the graph as an array.

Output the dot format as a string

Return a DOT::DOTDigraph for directed graphs or a DOT::DOTSubgraph for an undirected Graph. params can contain any graph property specified in rdot.rb. If an edge or vertex label is a kind of Hash then the keys which match dot properties will be used as well.

Provide a topological sort.

A different way of walking a tree, and a much faster way than the one that comes with GRATR.

Test whether a given vertex is in the graph.

Return a list of all vertices.

Produce the graph files if requested.

Use dot to create a graphical representation of the graph. Returns the filename of the graphics file.

[Validate]