[#81492] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — normalperson@...

Issue #13618 has been reported by normalperson (Eric Wong).

12 messages 2017/06/01

[ruby-core:81745] [Ruby trunk Feature#2631] Allow IO#reopen to take a block

From: glass.saga@...
Date: 2017-06-23 04:20:05 UTC
List: ruby-core #81745
Issue #2631 has been updated by Glass_saga (Masaki Matsushita).


It was thoughtless. Let me revert it.

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

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

In This Thread

Prev Next