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

ruby-changes:16468

From: mame <ko1@a...>
Date: Mon, 28 Jun 2010 05:36:29 +0900 (JST)
Subject: [ruby-changes:16468] Ruby:r28455 (trunk): * lib/rdoc/ri/driver.rb (RDoc::RI::Driver#formatter): should use bs

mame	2010-06-28 05:36:12 +0900 (Mon, 28 Jun 2010)

  New Revision: 28455

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28455

  Log:
    * lib/rdoc/ri/driver.rb (RDoc::RI::Driver#formatter): should use bs
      format when stdout is piped.  [ruby-core:30734]

  Modified files:
    trunk/ChangeLog
    trunk/lib/rdoc/ri/driver.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 28454)
+++ ChangeLog	(revision 28455)
@@ -1,3 +1,8 @@
+Mon Jun 28 05:32:51 2010  Yusuke Endoh  <mame@t...>
+
+	* lib/rdoc/ri/driver.rb (RDoc::RI::Driver#formatter): should use bs
+	  format when stdout is piped.  [ruby-core:30734]
+
 Mon Jun 28 03:12:03 2010  Yusuke Endoh  <mame@t...>
 
 	* bootstraptest/test_class.rb: add a test for [ruby-core:30843].
Index: lib/rdoc/ri/driver.rb
===================================================================
--- lib/rdoc/ri/driver.rb	(revision 28454)
+++ lib/rdoc/ri/driver.rb	(revision 28455)
@@ -546,7 +546,7 @@
 
   def display document
     page do |io|
-      text = document.accept formatter
+      text = document.accept formatter(io)
 
       io.write text
     end
@@ -795,10 +795,10 @@
   # Creates a new RDoc::Markup::Formatter.  If a formatter is given with -f,
   # use it.  If we're outputting to a pager, use bs, otherwise ansi.
 
-  def formatter
+  def formatter(io)
     if @formatter_klass then
       @formatter_klass.new
-    elsif paging? then
+    elsif paging? or !io.tty? then
       RDoc::Markup::ToBs.new
     else
       RDoc::Markup::ToAnsi.new

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

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