Method: Graph#save
- Defined in:
- lib/graph.rb
#save(path, type = nil) ⇒ Object
Saves out both a dot file to path and an image for the specified type. Specify type as nil to skip exporting an image.
337 338 339 340 341 342 |
# File 'lib/graph.rb', line 337 def save path, type = nil File.open "#{path}.dot", "w" do |f| f.puts self.to_s end system "dot -T#{type} #{path}.dot > #{path}.#{type}" if type end |