Sha256: 58111e764fa2de9c2da05167a300dbbda284a794ab3bad9961ebefdfc49ac6e3

Contents?: true

Size: 758 Bytes

Versions: 7

Compression:

Stored size: 758 Bytes

Contents

#!/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

main        = g.add_node( "main" )
parse       = g.add_node( "parse" )
execute     = g.add_node( "execute" )
init        = g.add_node( "init" )
cleanup     = g.add_node( "cleanup" )
make_string = g.add_node( "make_string" )
printf      = g.add_node( "printf" )
compare     = g.add_node( "compare" )

g.add_edge( main, parse )
g.add_edge( parse, execute )
g.add_edge( main, init )
g.add_edge( main, cleanup )
g.add_edge( execute, make_string )
g.add_edge( execute, printf )
g.add_edge( init, make_string )
g.add_edge( main, printf )
g.add_edge( execute, compare )

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby-graphviz-0.9.7 examples/sample01.rb
ruby-graphviz-0.9.6 examples/sample01.rb
ruby-graphviz-0.9.5 examples/sample01.rb
ruby-graphviz-0.9.4 examples/sample01.rb
ruby-graphviz-0.9.3 examples/sample01.rb
ruby-graphviz-0.9.2 examples/sample01.rb
ruby-graphviz-0.9.1 examples/sample01.rb