File: sample71.rb

package info (click to toggle)
ruby-graphviz 1.2.5-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,216 kB
  • sloc: ruby: 7,685; xml: 26; makefile: 17
file content (21 lines) | stat: -rw-r--r-- 411 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/ruby

$:.unshift( "../lib" )
require "graphviz"

g = nil
if ARGV[0]
  g = GraphViz::new( "G", :path => ARGV[0] )
else
  g = GraphViz::new( "G" )
end

g.add_edges("noDe", "graph")
g.add_edges("node", "graph")
g.add_edges("node", "Graph")
g.add_edges("graph", "subgraph")
g.add_edges("edge", "node")
g.add_edges("subgraph", "digraph")
g.add_edges("subgraph", "strict")

g.output( :png => "#{$0}.png" )