[as2api-dev] [CVS trunk] Make use of link_method() in more places that were doing it 'by hand'.

David Holroyd dave at badgers-in-foil.co.uk
Fri, 01 Jul 2005 20:58:58 +0000


<html>
<head>
<style><!--
  body {background-color:#ffffff;}
  .file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
  .pathname {font-family:monospace; float:right;}
  .fileheader {margin-bottom:.5em;}
  .diff {margin:0;}
  .tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
  .tasklist ul {margin-top:0;margin-bottom:0;}
  tr.alt {background-color:#eeeeee}
  #added {background-color:#ddffdd;}
  #addedchars {background-color:#99ff99;font-weight:bolder;}
  tr.alt #added {background-color:#ccf7cc;}
  #removed {background-color:#ffdddd;}
  #removedchars {background-color:#ff9999;font-weight:bolder;}
  tr.alt #removed {background-color:#f7cccc;}
  #info {color:#888888;}
  #context {background-color:#eeeeee;}
  td {padding-left:.3em;padding-right:.3em;}
  tr.head {border-bottom-width:1px;border-bottom-style:solid;}
  tr.head td {padding:0;padding-top:.2em;}
  .task {background-color:#ffff00;}
  .comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
  .error {color:red;}
  hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>trunk/as2api</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">html_output.rb</a></tt></td><td align="right" id="added">+12</td><td align="right" id="removed">-11</td><td nowrap="nowrap" align="center"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=164&amp;content-type=text/vnd.viewcvs-markup">164</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb.diff?r1=164&amp;r2=165">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=165&amp;content-type=text/vnd.viewcvs-markup">165</a></td></tr>
</table>
<pre class="comment">
Make use of link_method() in more places that were doing it 'by hand'.

link_for_method() can now automatically generate internal links, by inspecting
the type the current page documents (if any).
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk">trunk</a>/<a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api">as2api</a></span><br />
<div class="fileheader"><big><b>html_output.rb</b></big> <small id="info"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=164&amp;content-type=text/vnd.viewcvs-markup">164</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb.diff?r1=164&amp;r2=165">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=165&amp;content-type=text/vnd.viewcvs-markup">165</a></small></div>
<pre class="diff"><small id="info">--- trunk/as2api/html_output.rb	2005-06-29 23:11:43 UTC (rev 164)
+++ trunk/as2api/html_output.rb	2005-07-01 20:58:56 UTC (rev 165)
@@ -268,7 +268,11 @@
</small></pre><pre class="diff" id="context"> 
 
   def link_for_method(method)
</pre><pre class="diff" id="removed">-    return "#{link_for_type(method.containing_type)}#method_#{method.name}"
</pre><pre class="diff" id="added">+    if @type == method.containing_type
+      "#method_#{method.name}"
+    else
+      "#{link_for_type(method.containing_type)}#method_#{method.name}"
+    end
</pre><pre class="diff" id="context">   end
 
   def link_method(method)
</pre><pre class="diff"><small id="info">@@ -290,6 +294,11 @@
</small></pre><pre class="diff" id="context"> end
 
 class BasicPage &lt; Page
</pre><pre class="diff" id="added">+  def initialize(base_name, path_name=nil)
+    super(base_name, path_name)
+    @type = nil
+  end
+
</pre><pre class="diff" id="context">   def generate_content
     html_body do
       # accessability; make a link to skip over the initial navigation elements
</pre><pre class="diff"><small id="info">@@ -437,9 +446,7 @@
</small></pre><pre class="diff" id="context"> 	html_p do
 	  html_code do
 	    pcdata("new ")
</pre><pre class="diff" id="removed">-	      html_a("href"=&gt;"#method_#{type.constructor.name}") do
-		pcdata(type.constructor.name+"()")
-	      end
</pre><pre class="diff" id="added">+	    link_method(type.constructor)
</pre><pre class="diff" id="context"> 	  end
 	end
       end
</pre><pre class="diff"><small id="info">@@ -469,13 +476,7 @@
</small></pre><pre class="diff" id="context">     methods.each_with_index do |method, index|
       known_method_names &lt;&lt; method.name
       pcdata(", ") if index &gt; 0
</pre><pre class="diff" id="removed">-      if type.document?
-	html_a("href"=&gt;"#{href_prefix}#method_#{method.name}") do
-	  pcdata(method.name+"()")
-	end
-      else
-	pcdata(method.name+"()")
-      end
</pre><pre class="diff" id="added">+      link_method(method)
</pre><pre class="diff" id="context">     end
   end
 
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -&gt; email">CVSspam</a> 0.2.11</small></center>
</body></html>