diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-11-26 09:55:04 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-11-26 09:55:04 +0000 |
commit | ccd7b581bf990df618d410441c1f8d349aa225d9 (patch) | |
tree | 768e134483b5ed8f82adc69eebba7e8a7146b55e /lib/puppet/util | |
parent | c301b1b8f7fb417cf61b6ad4975eaa3714100306 (diff) | |
download | puppet-ccd7b581bf990df618d410441c1f8d349aa225d9.tar.gz puppet-ccd7b581bf990df618d410441c1f8d349aa225d9.tar.xz puppet-ccd7b581bf990df618d410441c1f8d349aa225d9.zip |
Intermediate commit -- I am ready to start pushing the graph stuff into the types and transactions, which will break everything for a little while.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1894 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/util')
-rw-r--r-- | lib/puppet/util/graph.rb | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/lib/puppet/util/graph.rb b/lib/puppet/util/graph.rb index c32d15cb4..d9e122c7b 100644 --- a/lib/puppet/util/graph.rb +++ b/lib/puppet/util/graph.rb @@ -2,18 +2,7 @@ # Copyright (c) 2006. All rights reserved. require 'puppet' -require 'puppet/gratr/digraph' -require 'puppet/gratr/import' -require 'puppet/gratr/dot' - -class GRATR::Digraph - # Determine all of the leaf nodes below a given vertex. - def leaves(vertex, type = :dfs) - tree = tree_from_vertex(vertex, type) - leaves = tree.keys.find_all { |c| adjacent(c, :direction => :out).empty? } - return leaves - end -end +require 'puppet/pgraph' # A module that handles the small amount of graph stuff in Puppet. module Puppet::Util::Graph @@ -23,7 +12,7 @@ module Puppet::Util::Graph def to_graph(graph = nil, &block) # Allow our calling function to send in a graph, so that we # can call this recursively with one graph. - graph ||= GRATR::Digraph.new + graph ||= Puppet::PGraph.new self.each do |child| unless block_given? and ! yield(child) @@ -45,14 +34,6 @@ module Puppet::Util::Graph graph end - - def to_jpg(graph = nil) - graph ||= to_graph - gv = graph.vertices - Dir.chdir("/Users/luke/Desktop/pics") do - graph.induced_subgraph(gv).write_to_graphic_file('jpg', 'graph') - end - end end # $Id$
\ No newline at end of file |