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:
parent
be1c68caeb
commit
19e835f952
2 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue