[#8815] Segfault in libc strlen, via rb_str_new2 — "Sean E. Russell" <ser@...>

Howdy,

12 messages 2006/09/09
[#8817] Re: Segfault in libc strlen, via rb_str_new2 — Eric Hodel <drbrain@...7.net> 2006/09/09

On Sep 8, 2006, at 10:10 PM, Sean E. Russell wrote:

Fix: no black boxes in rdoc diagrams anymore

From: "Florian Frank" <flori@...>
Date: 2006-09-06 18:00:23 UTC
List: ruby-core #8803
Hi,

rdoc uses graphviz dot to create diagrams. Sometimes color names like 
lightcyan1 aren't defined (in the running X system?). This leads to 
graphviz falling back to black color, which doesn't look very nice.

I have included a patch, that uses the corresponding #xxxxxx hex numbers 
instead of the all the names to make rdoc more portable.

-- 
Florian Frank

Attachments (1)

rdoc.patch (3.35 KB, text/x-diff)
Index: diagram.rb
===================================================================
RCS file: /src/ruby/lib/rdoc/diagram.rb,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 diagram.rb
--- diagram.rb	16 Jul 2004 20:27:29 -0000	1.2.2.1
+++ diagram.rb	6 Sep 2006 17:46:43 -0000
@@ -58,14 +58,14 @@ module RDoc
                                     'label' => i.file_absolute_name,
                                     'fontname' => FONT,
                                     'fontsize' => '8',
-                                    'bgcolor'  => 'lightcyan1',
+                                    'bgcolor'  => '"#e0ffff"',
                                     'compound' => 'true')
         
         # it's a little hack %) i'm too lazy to create a separate class
         # for default node
         graph << DOT::DOTNode.new('name' => 'node',
                                   'fontname' => FONT,
-                                  'color' => 'black',
+                                  'color' => '"#000000"',
                                   'fontsize' => 8)
         
         i.modules.each do |mod|
@@ -86,12 +86,12 @@ module RDoc
                                       'label' => i.full_name,
                                       'fontname' => FONT,
                                       'fontsize' => '8',
-                                      'bgcolor'  => 'lightcyan1',
+                                      'bgcolor'  => '"#e0ffff"',
                                       'compound' => 'true')
 
           graph << DOT::DOTNode.new('name' => 'node',
                                     'fontname' => FONT,
-                                    'color' => 'black',
+                                    'color' => '"#000000"',
                                     'fontsize' => 8)
           draw_module(mod, graph, true)
           mod.diagram = convert_to_png("m_#{file_count}_#{count}", 
@@ -132,10 +132,10 @@ module RDoc
       m = DOT::DOTSubgraph.new('name' => "cluster_#{mod.full_name.gsub( /:/,'_' )}",
                                'label' => mod.name,
                                'fontname' => FONT,
-                               'color' => 'blue', 
+                               'color' => '"#0000ff"', 
                                'style' => 'filled', 
                                'URL'   => %{"#{url}"},
-                               'fillcolor' => toplevel ? 'palegreen1' : 'palegreen3')
+                               'fillcolor' => toplevel ? '"#9aff9a"' : '"#7ccd7c"')
       
       @done_modules[mod.full_name] = m
       add_classes(mod, m, file)
@@ -193,7 +193,7 @@ module RDoc
                                  'label'    => "#{last_file}",
                                  'fontname' => FONT,
                                  'color'=>
-                                 last_file == file ? 'red' : 'black')
+                                 last_file == file ? '"#ff0000"' : '"#000000"')
         end
 
         next if cl.name == 'Object' || cl.name[0,2] == "<<"
@@ -211,9 +211,9 @@ module RDoc
                 
         attrs = {
           'name' => "#{cl.full_name.gsub( /:/, '_' )}",
-          'fontcolor' => 'black',
+          'fontcolor' => '"#000000"',
           'style'=>'filled',
-          'color'=>'palegoldenrod',
+          'color'=>'"#eee8aa"',
           'label' => label,
           'shape' => 'ellipse',
           'URL'   => %{"#{url}"}

In This Thread

Prev Next