summaryrefslogtreecommitdiff
path: root/lib/rdoc/ri/driver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/ri/driver.rb')
-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