From: "shyouhei (Shyouhei Urabe)" Date: 2012-10-27T05:51:24+09:00 Subject: [ruby-core:48343] [ruby-trunk - Feature #2631] Allow IO#reopen to take a block Issue #2631 has been updated by shyouhei (Shyouhei Urabe). Target version changed from 2.0.0 to next minor I was poked by _ko1. But we lack a implementation proposal. So I move its target to next minor. It might happen to be implemented some time later but not today. Any opinions? ---------------------------------------- Feature #2631: Allow IO#reopen to take a block https://bugs.ruby-lang.org/issues/2631#change-31652 Author: djberg96 (Daniel Berger) Status: Assigned Priority: Normal Assignee: shyouhei (Shyouhei Urabe) Category: core Target version: next minor =begin Please allow IO#reopen to accept a block. This would allow users to temporarily redirect output without having to manually reset the file descriptor. For example: require 'mkmf' # stdout redirected within block only $stdout.reopen('/dev/null') do if have_header('foo.h') # Do stuff end end # stdout now back to its former setting I believe this is both convenient and intuitive when one considers the IO.open also takes a block. Regards, Dan =end -- http://bugs.ruby-lang.org/