Flowdock
method

draw_module

Importance_0
draw_module(mod, graph, toplevel = false, file = nil) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# 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::Subgraph.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 |inc|
          m_full_name = find_full_name(inc.name, mod)
          if @local_names.include?(m_full_name)
            @global_graph << DOT::Edge.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::Node.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
                                             'shape' => 'box',
                                             'label' => "#{m_full_name}",
                                             'URL'   => %{"#{url}"})
              @global_names << m_full_name
            end
            @global_graph << DOT::Edge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
                                           'to' => "#{mod.full_name.gsub( /:/,'_' )}",
                                           'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
          end
        end
      end
    end
Register or log in to add new notes.