method
draw_module
v1_8_7_330 -
Show latest stable
- Class:
RDoc::Diagram
draw_module(mod, graph, toplevel = false, file = nil)private
No documentation available.
# File lib/rdoc/diagram.rb, line 125
def draw_module(mod, graph, toplevel = false, file = nil)
return if @done_modules[mod.full_name] and not toplevel
@counter += 1
url = mod.http_url("classes")
m = DOT::DOTSubgraph.new('name' => "cluster_#{mod.full_name.gsub( /:/,'_' )}",
'label' => mod.name,
'fontname' => FONT,
'color' => 'blue',
'style' => 'filled',
'URL' => %{"#{url}"},
'fillcolor' => toplevel ? 'palegreen1' : 'palegreen3')
@done_modules[mod.full_name] = m
add_classes(mod, m, file)
graph << m
unless mod.includes.empty?
mod.includes.each do |m|
m_full_name = find_full_name(m.name, mod)
if @local_names.include?(m_full_name)
@global_graph << DOT::DOTEdge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
'to' => "#{mod.full_name.gsub( /:/,'_' )}",
'ltail' => "cluster_#{m_full_name.gsub( /:/,'_' )}",
'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
else
unless @global_names.include?(m_full_name)
path = m_full_name.split("::")
url = File.join('classes', *path) + ".html"
@global_graph << DOT::DOTNode.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
'shape' => 'box',
'label' => "#{m_full_name}",
'URL' => %{"#{url}"})
@global_names << m_full_name
end
@global_graph << DOT::DOTEdge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
'to' => "#{mod.full_name.gsub( /:/,'_' )}",
'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
end
end
end
end