Method: Puppet::Graph::SimpleGraph#write_graph

Defined in:
lib/puppet/graph/simple_graph.rb

#write_graph(name) ⇒ Object

Produce the graph files if requested.



481
482
483
484
485
486
487
488
489
# File 'lib/puppet/graph/simple_graph.rb', line 481

def write_graph(name)
  return unless Puppet[:graph]

  file = File.join(Puppet[:graphdir], "#{name}.dot")
  # DOT files are assumed to be UTF-8 by default - http://www.graphviz.org/doc/info/lang.html
  File.open(file, "w:UTF-8") { |f|
    f.puts to_dot("name" => name.to_s.capitalize)
  }
end