From: flightsblogproject@...
Date: 2018-05-24T13:22:02+00:00
Subject: [ruby-core:87253] [Ruby trunk Feature#2631] Allow IO#reopen to take	a block

Issue #2631 has been updated by Bookgoogleflights (google flights).


The idea of temporary intercepting any output to another IO is worth considering.  Though I doubt to name that feature a "reopen".est/ruby/test_io.rb: add a test NEWS: add an entry for this change, he new Google Flights offers all of the speed and usability of the old Google Flights, but with some great new features added on top book flights using "bookgoogleflights.wordpress.com":https://bookgoogleflights.wordpress.com/

----------------------------------------
Feature #2631: Allow IO#reopen to take a block
https://bugs.ruby-lang.org/issues/2631#change-72243

* Author: djberg96 (Daniel Berger)
* Status: Assigned
* Priority: Normal
* Assignee: Glass_saga (Masaki Matsushita)
* Target version: 
----------------------------------------
=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




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>