[前][次][番号順一覧][スレッド一覧]

ruby-changes:3582

From: ko1@a...
Date: Wed, 16 Jan 2008 11:01:38 +0900 (JST)
Subject: [ruby-changes:3582] drbrain - Ruby:r15071 (trunk): Clean up comments

drbrain	2008-01-16 10:36:19 +0900 (Wed, 16 Jan 2008)

  New Revision: 15071

  Modified files:
    trunk/lib/rdoc/ri/formatter.rb

  Log:
    Clean up comments

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/rdoc/ri/formatter.rb?r1=15071&r2=15070&diff_format=u

Index: lib/rdoc/ri/formatter.rb
===================================================================
--- lib/rdoc/ri/formatter.rb	(revision 15070)
+++ lib/rdoc/ri/formatter.rb	(revision 15071)
@@ -9,9 +9,6 @@
     @indent  = indent
   end
 
-
-  ######################################################################
-
   def draw_line(label=nil)
     len = @width
     len -= (label.size+1) if label
@@ -23,8 +20,6 @@
     puts
   end
 
-  ######################################################################
-
   def wrap(txt,  prefix=@indent, linelen=@width)
     return unless txt && !txt.empty?
     work = conv_markup(txt)
@@ -46,36 +41,28 @@
     puts(prefix + res.join("\n" + next_prefix))
   end
 
-  ######################################################################
-
   def blankline
     puts
   end
 
-  ######################################################################
+  ##
+  # Called when we want to ensure a new 'wrap' starts on a newline.  Only
+  # needed for HtmlFormatter, because the rest do their own line breaking.
 
-  # called when we want to ensure a nbew 'wrap' starts on a newline
-  # Only needed for HtmlFormatter, because the rest do their
-  # own line breaking
-
   def break_to_newline
   end
 
-  ######################################################################
-
   def bold_print(txt)
     print txt
   end
 
-  ######################################################################
-
   def raw_print_line(txt)
     puts txt
   end
 
-  ######################################################################
+  ##
+  # Convert HTML entities back to ASCII
 
-  # convert HTML entities back to ASCII
   def conv_html(txt)
     txt.
       gsub(/>/, '>').
@@ -85,7 +72,9 @@
 
   end
 
-  # convert markup into display form
+  ##
+  # Convert markup into display form
+
   def conv_markup(txt)
     txt.
       gsub(%r{<tt>(.*?)</tt>}) { "+#$1+" } .
@@ -94,8 +83,6 @@
     gsub(%r{<em>(.*?)</em>}) { "_#$1_" }
   end
 
-  ######################################################################
-
   def display_list(list)
     case list.type
 
@@ -149,8 +136,6 @@
     end
   end
 
-  ######################################################################
-
   def display_flow_item(item, prefix=@indent)
     case item
     when RDoc::Markup::Flow::P, RDoc::Markup::Flow::LI
@@ -174,8 +159,6 @@
     end
   end
 
-  ######################################################################
-
   def display_verbatim_flow_item(item, prefix=@indent)
     item.body.split(/\n/).each do |line|
       print @indent, conv_html(line), "\n"
@@ -183,8 +166,6 @@
     blankline
   end
 
-  ######################################################################
-
   def display_heading(text, level, indent)
     text = strip_attributes(text)
     case level
@@ -206,7 +187,6 @@
     end
   end
 
-
   def display_flow(flow)
     flow.each do |f|
       display_flow_item(f)
@@ -228,7 +208,6 @@
     text.join
   end
 
-
 end
 
 ##
@@ -323,9 +302,6 @@
 
   protected
 
-  ##
-  # overridden in specific formatters
-
   def write_attribute_text(prefix, line)
     print prefix
     line.each do |achar|
@@ -334,9 +310,6 @@
     puts
   end
 
-  ##
-  # again, overridden
-
   def bold_print(txt)
     print txt
   end
@@ -384,7 +357,7 @@
   end
 
   ##
-  # draw a string in bold
+  # Draw a string in bold
 
   def bold_print(text)
     text.split(//).each do |ch|
@@ -464,10 +437,6 @@
 
 class RDoc::RI::HtmlFormatter < RDoc::RI::AttributeFormatter
 
-  def initialize(*args)
-    super
-  end
-
   def write_attribute_text(prefix, line)
     curr_attr = 0
     line.each do |achar|
@@ -636,7 +605,6 @@
 
 end
 
-
 ##
 # Finally, fill in the list of known formatters
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]