/usr/share/doc/ruby-graphviz/examples/sample12.rb is in ruby-graphviz 1.0.8-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #!/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[:color] = "black"
g.cluster0( ) do |cluster|
cluster[:label] = "process #1"
cluster[:style] = "filled"
cluster[:color] = "lightgrey"
cluster.a0 :style => "filled", :color => "white"
cluster.a1 :style => "filled", :color => "white"
cluster.a2 :style => "filled", :color => "white"
cluster.a3 :style => "filled", :color => "white"
cluster.a0 << cluster.a1
cluster.a1 << cluster.a2
cluster.a2 << cluster.a3
end
g.cluster1( :label => "process #2" ) do |cluster|
cluster.b0 :style => "filled", :color => "blue"
cluster.b1 :style => "filled", :color => "blue"
cluster.b2 :style => "filled", :color => "blue"
cluster.b3 :style => "filled", :color => "blue"
cluster.b0 << cluster.b1
cluster.b1 << cluster.b2
cluster.b2 << cluster.b3
end
g.start :shape => "Mdiamond"
g.endn :shape => "Msquare", :label => "end"
g.start << g.cluster0.a0
g.start << g.cluster1.b0
g.cluster0.a1 << g.cluster1.b3
g.cluster1.b2 << g.cluster0.a3
g.cluster0.a3 << g.cluster0.a0
g.cluster0.a3 << g.endn
g.cluster1.b3 << g.endn
g.output( :png => "#{$0}.png" )
|