def draw
      unless @options.quiet
        $stderr.print "Diagrams: "
        $stderr.flush
      end

      @info.each_with_index do |i, file_count|
        @done_modules = {}
        @local_names = find_names(i)
        @global_names = []
        @global_graph = graph = DOT::Digraph.new('name' => 'TopLevel',
                                                 'fontname' => FONT,
                                                 'fontsize' => '8',
                                                 'bgcolor'  => 'lightcyan1',
                                                 'compound' => 'true')

        # it's a little hack %) i'm too lazy to create a separate class
        # for default node
        graph << DOT::Node.new('name' => 'node',
                               'fontname' => FONT,
                               'color' => 'black',
                               'fontsize' => 8)

        i.modules.each do |mod|
          draw_module(mod, graph, true, i.file_relative_name)
        end
        add_classes(i, graph, i.file_relative_name)

        i.diagram = convert_to_png("f_#{file_count}", graph)

        # now go through and document each top level class and
        # module independently
        i.modules.each_with_index do |mod, count|
          @done_modules = {}
          @local_names = find_names(mod)
          @global_names = []

          @global_graph = graph = DOT::Digraph.new('name' => 'TopLevel',
                                                   'fontname' => FONT,
                                                   'fontsize' => '8',
                                                   'bgcolor'  => 'lightcyan1',
                                                   'compound' => 'true')

          graph << DOT::Node.new('name' => 'node',
                                 'fontname' => FONT,
                                 'color' => 'black',
                                 'fontsize' => 8)
          draw_module(mod, graph, true)
          mod.diagram = convert_to_png("m_#{file_count}_#{count}",
                                       graph)
        end
      end
      $stderr.puts unless @options.quiet
    end
def draw
      unless @options.quiet
        $stderr.print "Diagrams: "
        $stderr.flush
      end

      @info.each_with_index do |i, file_count|
        @done_modules = {}
        @local_names = find_names(i)
        @global_names = []
        @global_graph = graph = DOT::Digraph.new('name' => 'TopLevel',
                                                 'fontname' => FONT,
                                                 'fontsize' => '8',
                                                 'bgcolor'  => 'lightcyan1',
                                                 'compound' => 'true')

        # it's a little hack %) i'm too lazy to create a separate class
        # for default node
        graph << DOT::Node.new('name' => 'node',
                               'fontname' => FONT,
                               'color' => 'black',
                               'fontsize' => 8)

        i.modules.each do |mod|
          draw_module(mod, graph, true, i.file_relative_name)
        end
        add_classes(i, graph, i.file_relative_name)

        i.diagram = convert_to_png("f_#{file_count}", graph)

        # now go through and document each top level class and
        # module independently
        i.modules.each_with_index do |mod, count|
          @done_modules = {}
          @local_names = find_names(mod)
          @global_names = []

          @global_graph = graph = DOT::Digraph.new('name' => 'TopLevel',
                                                   'fontname' => FONT,
                                                   'fontsize' => '8',
                                                   'bgcolor'  => 'lightcyan1',
                                                   'compound' => 'true')

          graph << DOT::Node.new('name' => 'node',
                                 'fontname' => FONT,
                                 'color' => 'black',
                                 'fontsize' => 8)
          draw_module(mod, graph, true)
          mod.diagram = convert_to_png("m_#{file_count}_#{count}",
                                       graph)
        end
      end
      $stderr.puts unless @options.quiet
    end
Pass in the set of top level objects. The method also creates the
 subdirectory to hold the images

 Draw the diagrams. We traverse the files, drawing a diagram for each. We
 also traverse each top-level class and module in that file drawing a
 diagram for these too.