diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/rdoc/ri/driver.rb | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -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 |