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.
264 265 266 267 268 269 |
# File 'lib/graph.rb', line 264 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 |