[#11073] segfault printing instruction sequence for iterator — <noreply@...>

Bugs item #10527, was opened at 2007-05-02 14:42

14 messages 2007/05/02
[#11142] Re: [ ruby-Bugs-10527 ] segfault printing instruction sequence for iterator — Nobuyoshi Nakada <nobu@...> 2007/05/10

Hi,

[#11188] Re: [ ruby-Bugs-10527 ] segfault printing instruction sequence for iterator — Paul Brannan <pbrannan@...> 2007/05/16

On Thu, May 10, 2007 at 04:51:18PM +0900, Nobuyoshi Nakada wrote:

[#11234] Planning to release 1.8.6 errata — Urabe Shyouhei <shyouhei@...>

Hi all.

17 messages 2007/05/25

ri HTML output bug with constants

From: Chris Thomas <chris@...>
Date: 2007-05-19 04:03:13 UTC
List: ruby-core #11206
`ri -f HTML` doesn't render the constant section correctly (see the  
output for String, for example). DefaultDisplay#display_class_info  
passes the name of the constant as the prefix argument to  
TextFormatter#wrap, and HTMLFormatter ignores the prefix argument.  
This seems to be true for both 1.8.6 and trunk.

One way to address the problem is the strawman patch below; this  
places the constants in a table. For plain text output, there is an  
extra line between items. That could be fixed, at the risk of mangling  
content which expects extra lines there. And it's perhaps not a great  
idea to reference SM::Flow from ri_display.

--- /usr/lib/ruby/1.8/rdoc/ri/ri_display.pristine.rb	2007-05-18  
23:20:41.000000000 -0400
+++ /usr/lib/ruby/1.8/rdoc/ri/ri_display.rb	2007-05-18  
23:19:02.000000000 -0400
@@ -105,13 +110,18 @@
        unless klass.constants.empty?
          @formatter.blankline
          @formatter.display_heading("Constants:", 2, "")
-        len = 0
-        klass.constants.each { |c| len = c.name.length if  
c.name.length > len }
-        len += 2
+
+        list = SM::Flow::LIST.new(SM::ListBase::NOTE)
+
          klass.constants.each do |c|
-          @formatter.wrap(c.value,
-                          @formatter.indent+((c.name+":").ljust(len)))
+          item = SM::Flow::LI.new
+          item.label = c.name
+          item.body  = c.value
+          list << item
          end
+
+        @formatter.display_list(list)
        end

        unless klass.class_methods.empty?


In This Thread

Prev Next