Sha256: 9b0e176cd17c43806f4c62684327c65f7b0cca06c284a177518d9c0ccba6f0c5

Contents?: true

Size: 1.13 KB

Versions: 16

Compression:

Stored size: 1.13 KB

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

g.node[:shape] = "ellipse"
g.node[:color] = "black"

g.edge[:color] = "black"
g.edge[:weight] = "1"
g.edge[:style] = "filled"
g.edge[:label] = ""

g[:size] = "4,4"

main        = g.add_nodes( "main", :shape => "box" )
parse       = g.add_nodes( "parse" )
execute     = g.add_nodes( "execute" )
init        = g.add_nodes( "init" )
cleanup     = g.add_nodes( "cleanup" )
make_string = g.add_nodes( "make_string", :label => 'make a\nstring' )
printf      = g.add_nodes( "printf" )
compare     = g.add_nodes( "compare", :shape => "box", :style => "filled", :color => ".7 .3 1.0" )

g.add_edges( main, parse, :weight => "8" )
g.add_edges( parse, execute )
g.add_edges( main, init, :style => "dotted" )
g.add_edges( main, cleanup )
g.add_edges( execute, make_string )
g.add_edges( execute, printf )
g.add_edges( init, make_string )
g.add_edges( main, printf, :color => "red", :style => "bold", :label => "100 times" )
g.add_edges( execute, compare, :color => "red" )

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

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
ruby-graphviz-1.2.5 examples/sample02.rb
ruby-graphviz-1.2.4 examples/sample02.rb
ruby-graphviz-1.2.3 examples/sample02.rb
ruby-graphviz-1.2.2 examples/sample02.rb
ruby-graphviz-1.2.1 examples/sample02.rb
ruby-graphviz-1.2.0 examples/sample02.rb
ruby-graphviz-1.1.0 examples/sample02.rb
ruby-graphviz_c-1.1.1 examples/sample02.rb
ruby-graphviz_c-1.1.0 examples/sample02.rb
ruby-graphviz-1.0.9 examples/sample02.rb
ruby-graphviz-1.0.8 examples/sample02.rb
ruby-graphviz-1.0.7 examples/sample02.rb
ruby-graphviz-1.0.6 examples/sample02.rb
ruby-graphviz-1.0.5 examples/sample02.rb
ruby-graphviz-1.0.4 examples/sample02.rb
ruby-graphviz-1.0.3 examples/sample02.rb