Sha256: 290fb8ae582fd5fdf0c3f7ad71f2e0e36350033501519eb27ed88a3fa6536097
Contents?: true
Size: 1.15 KB
Versions: 16
Compression:
Stored size: 1.15 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["color"] = "black" g.edge["color"] = "black" g.edge["weight"] = "1" g.edge["style"] = "filled" g.edge["label"] = "" g["size"] = "4,4" g.node["shape"] = "box" main = g.add_nodes( "main" ) g.node["shape"] = "ellipse" 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