diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-03 09:58:25 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-03 09:58:25 +0000 |
commit | 57cbecdb4f62df817c4d4fb694837b32b0f3b604 (patch) | |
tree | b1fe4696c44ee8b56849088e40a68ac33edbae60 /lib/rdoc/ri | |
parent | 54a04074256fa85db5da3bf0041773ddc3391196 (diff) | |
download | ruby-57cbecdb4f62df817c4d4fb694837b32b0f3b604.tar.gz |
* 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
Diffstat (limited to 'lib/rdoc/ri')
-rw-r--r-- | lib/rdoc/ri/ri_display.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/rdoc/ri/ri_display.rb b/lib/rdoc/ri/ri_display.rb index 500632ae05..d07f595531 100644 --- a/lib/rdoc/ri/ri_display.rb +++ b/lib/rdoc/ri/ri_display.rb @@ -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 ###################################################################### |