summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-01 02:05:35 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-01 02:05:35 +0000
commitf058f2d8451abb25c149ab5fca31ffa497d13121 (patch)
treea8ea6203a6c2eb2d23d73d5edcd8008b6ee0fb7b /lib
parent2a43e8983da9b7efbe03e910e0ce41acf003abfa (diff)
merges r28455 and r28460 from trunk into ruby_1_9_2.
-- * lib/rdoc/ri/driver.rb (RDoc::RI::Driver#formatter): should use bs format when stdout is piped. [ruby-core:30734] -- * test/rdoc/test_rdoc_ri_driver.rb (TestRDocRIDriver#test_formatter): fix a test accordingly to r28455. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/ri/driver.rb6
1 files changed, 3 insertions, 3 deletions
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