1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
mame 2010-06-27 20:36:12 +00:00
parent be1c68caeb
commit 19e835f952
2 changed files with 8 additions and 3 deletions

View file

@ -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> Mon Jun 28 03:12:03 2010 Yusuke Endoh <mame@tsg.ne.jp>
* bootstraptest/test_class.rb: add a test for [ruby-core:30843]. * bootstraptest/test_class.rb: add a test for [ruby-core:30843].

View file

@ -546,7 +546,7 @@ Options may also be set in the 'RI' environment variable.
def display document def display document
page do |io| page do |io|
text = document.accept formatter text = document.accept formatter(io)
io.write text io.write text
end 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, # 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. # use it. If we're outputting to a pager, use bs, otherwise ansi.
def formatter def formatter(io)
if @formatter_klass then if @formatter_klass then
@formatter_klass.new @formatter_klass.new
elsif paging? then elsif paging? or !io.tty? then
RDoc::Markup::ToBs.new RDoc::Markup::ToBs.new
else else
RDoc::Markup::ToAnsi.new RDoc::Markup::ToAnsi.new