
Untitled
By: a guest on
Aug 19th, 2012 | syntax:
None | size: 0.66 KB | hits: 9 | expires: Never
require 'graph'
module Orcl
class Element
def node(g)
g.rect + g.filled + graph(g) << g.node(name)
deps.each { |d| g.edge name, d.name }
end
end
class Table
def graph(g) g.c1 end
end
class View
def graph(g) g.c2 end
end
class MaterializedView
def graph(g) g.c3 end
end
class Schema
def graph
s = self
digraph do
rotate
colorscheme :accent , 3
s.tabloid.each { |t| t.node self }
# graph_attribs << p("{ rank=same; #{s.table.map( &:name ).join(' ')}}")
same_rank s.table.map( &:name )
save "schema/mxofm", "pdf"
end
:done
end
end
end