aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-27 20:36:12 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-27 20:36:12 +0000
commit19e835f952baed4f466fbc0eb836460cd86264e9 (patch)
tree023535800171bf981c55d1c80923c4d4a5721ebb
parentbe1c68caeb878f6822e9720687152b41dcc160a5 (diff)
downloadruby-19e835f952baed4f466fbc0eb836460cd86264e9.tar.gz
* lib/rdoc/ri/driver.rb (RDoc::RI::Driver#formatter): should use bs
format when stdout is piped. [ruby-core:30734] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/rdoc/ri/driver.rb6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a50a159a43..c9569d307d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jun 28 05:32:51 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * 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@tsg.ne.jp>
* bootstraptest/test_class.rb: add a test for [ruby-core:30843].
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index b5523355d5..90fbc7c7a2 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -546,7 +546,7 @@ Options may also be set in the 'RI' environment variable.
def display document
page do |io|
- text = document.accept formatter
+ text = document.accept formatter(io)
io.write text
end
@@ -795,10 +795,10 @@ Options may also be set in the 'RI' environment variable.
# 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