зеркало из https://github.com/github/ruby.git
* lib/rdoc/ri/ri_display.rb (DefaultDisplay::setup_pager): ensure
pager closes and stdout is restored. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
54a0407425
Коммит
57cbecdb4f
|
@ -1,3 +1,8 @@
|
|||
Wed Mar 3 18:58:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/rdoc/ri/ri_display.rb (DefaultDisplay::setup_pager): ensure
|
||||
pager closes and stdout is restored.
|
||||
|
||||
Wed Mar 3 13:10:56 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (method_hash): new method. [ruby-talk:93968]
|
||||
|
|
|
@ -183,12 +183,11 @@ class DefaultDisplay
|
|||
######################################################################
|
||||
|
||||
def page
|
||||
setup_pager
|
||||
pager = setup_pager
|
||||
begin
|
||||
yield
|
||||
page_output
|
||||
ensure
|
||||
STDOUT.reopen(@save_stdout) if @save_stdout
|
||||
page_output(pager)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -203,20 +202,20 @@ class DefaultDisplay
|
|||
else
|
||||
@save_stdout = STDOUT.clone
|
||||
STDOUT.reopen(pager)
|
||||
return
|
||||
return pager
|
||||
end
|
||||
end
|
||||
@options.use_stdout = true
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
######################################################################
|
||||
|
||||
def page_output
|
||||
unless @options.use_stdout
|
||||
STDOUT.reopen(@save_stdout)
|
||||
@save_stdout = nil
|
||||
end
|
||||
def page_output(pager)
|
||||
STDOUT.reopen(@save_stdout) if @save_stdout
|
||||
@save_stdout = nil
|
||||
pager.close if pager
|
||||
end
|
||||
|
||||
######################################################################
|
||||
|
|
Загрузка…
Ссылка в новой задаче