Bugs: Browse | Submit New | Admin

[#25869] a :call-seq: directive with multiple lines produces only one line of output with the darkfish generator

Date:
2009-05-11 11:28
Priority:
3
Submitted By:
Stefano Crocco (stcrocco)
Assigned To:
Eric Hodel (drbrain)
Category:
None
State:
Open
Summary:
a :call-seq: directive with multiple lines produces only one line of output with the darkfish generator

Detailed description
Using a :call-seq: directive with more than one lines (with each line corresponding to a different way to call the method)
should put the different ways to call the method on a different line. For example, the code

=begin rdoc
:call-seq:
obj.method1 arg1 -> res
obj.method1 arg1, arg2 -> res

Description
=end
def method1 *args
end

should produce something like this:

obj.method1 arg1 -> res
obj.method1 arg1, arg2 -> res

Description

Instead, at least with the darkfish generator, all the different ways to call the method are put on the same line, like
this:

obj.method1 arg1 -> res obj.method1 arg1, arg2 -> res

Description

Add A Comment: Notepad

Please login


Followup

Message
Date: 2010-12-23 00:43
Sender: Kubo Takehiro

My previous patch cannot be applied to the trunk due to indentation
changes. I made a new one:

--- lib/rdoc/generator/template/darkfish/classpage.rhtml	(revision
716)
+++ lib/rdoc/generator/template/darkfish/classpage.rhtml	(working
copy)
@@ -225,16 +225,22 @@
       <div id="<%= method.html_name %>-method"
class="method-detail <%= method.is_alias_for
? "method-alias" : '' %>">
         <a name="<%= h method.aref
%>"></a>
 
+        <% if method.call_seq %>
+        <% method.call_seq.strip.split("\n").each_w
ith_index do |call_seq, i| %>
         <div class="method-heading">
-        <% if method.call_seq %>
-          <span class="method-callseq"><%=
method.call_seq.strip.gsub(/->/, '&rarr;').gsub( /^\w.+\./m,
'') %></span>
+          <span class="method-callseq"><%=
call_seq.strip.gsub(/->/, '&rarr;').gsub( /^\w.+\./m,
'') %></span>
+          <% if i == 0 %>
           <span class="method-click-advice">click
to toggle source</span>
+          <% end %>
+        </div>
+        <% end %>
         <% else %>
+        <div class="method-heading">
           <span class="method-name"><%= h
method.name %></span><span
             class="method-args"><%= method.params
%></span>
           <span class="method-click-advice">click
to toggle source</span>
+        </div>
         <% end %>
-        </div>
 
         <div class="method-description">
           <% if method.comment %>
Date: 2010-05-07 13:33
Sender: Kubo Takehiro

> Experiencing the same here, with RDoc's C parser. In RDoc
2.5,
> all lines except the first one are skipped now. Example:

It is the last one, not the first one.

I fixed it by the following patch.

--- lib/rdoc/generator/template/darkfish/classpage.rhtml~	2010-05-07
17:29:20.000000000 +0900
+++ lib/rdoc/generator/template/darkfish/classpage.rhtml	2010-05-07
22:13:17.000000000 +0900
@@ -225,16 +225,22 @@
 			<div id="<%= method.html_name %>-method"
class="method-detail <%= method.is_alias_for
? "method-alias" : '' %>">
 				<a name="<%= h method.aref
%>"></a>
 
-				<div class="method-heading">
 				<% if method.call_seq %>
-					<span class="method-callseq"><%=
method.call_seq.strip.gsub(/->/, '&rarr;').gsub( /^\w.+\./m,
'') %></span>
-					<span class="method-click-advice">click
to toggle source</span>
+					<% method.call_seq.strip.split("\n").each_with
_index do |seq, i| %>
+						<div class="method-heading">
+						<span class="method-callseq"><%=
seq.strip.gsub(/->/, '&rarr;').gsub( /^\w.+\./m,
'') %></span>
+						<% if i == 0 %>
+						<span class="method-click-advice">click
to toggle source</span>
+						<% end %>
+						</div>
+					<% end %>
 				<% else %>
+					<div class="method-heading">
 					<span class="method-name"><%= h method.name
%></span><span
 						class="method-args"><%= method.params
%></span>
 					<span class="method-click-advice">click
to toggle source</span>
+					</div>
 				<% end %>
-				</div>
 
 				<div class="method-description">
 					<% if method.comment %>
Date: 2010-04-02 09:12
Sender: Marvin Gülker

Experiencing the same here, with RDoc's C parser. In RDoc 2.5,
all lines except the first one are skipped now. Example:

/*
*call-seq: 
*  XWindow.search(str , screen = 0 , display = 0) ==> anArray
*  XWindow.search(regexp , screen = 0 , display = 0 ) ==>
anArray
*
*Searches for a special window title. 
...

Results in: 
search(regexp , screen = 0 , display = 0 ) ==> anArray

Followed by an empty code section. 

Marvin

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tonone2009-09-02 09:52zenspider