Skip to content

Instantly share code, notes, and snippets.

@Sharpie
Created April 9, 2014 17:56
Show Gist options
  • Save Sharpie/10297349 to your computer and use it in GitHub Desktop.
Save Sharpie/10297349 to your computer and use it in GitHub Desktop.
Puppet Graphs: Show Whits
diff --git a/lib/puppet/graph/simple_graph.rb b/lib/puppet/graph/simple_graph.rb
index 57174ee..29820f6 100644
--- a/lib/puppet/graph/simple_graph.rb
+++ b/lib/puppet/graph/simple_graph.rb
@@ -435,19 +435,19 @@ class Puppet::Graph::SimpleGraph
graph = (directed? ? DOT::DOTDigraph : DOT::DOTSubgraph).new(params)
edge_klass = directed? ? DOT::DOTDirectedEdge : DOT::DOTEdge
vertices.each do |v|
- name = v.to_s
+ name = v.ref
params = {'name' => '"'+name+'"',
'fontsize' => fontsize,
'label' => name}
- v_label = v.to_s
+ v_label = v.ref
params.merge!(v_label) if v_label and v_label.kind_of? Hash
graph << DOT::DOTNode.new(params)
end
edges.each do |e|
- params = {'from' => '"'+ e.source.to_s + '"',
- 'to' => '"'+ e.target.to_s + '"',
+ params = {'from' => '"'+ e.source.ref + '"',
+ 'to' => '"'+ e.target.ref + '"',
'fontsize' => fontsize }
- e_label = e.to_s
+ e_label = e.ref
params.merge!(e_label) if e_label and e_label.kind_of? Hash
graph << edge_klass.new(params)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment