Issue #7654 has been updated by shock_one (??抉抖抉忱我技我?? 宋忘????抗我抄).


Just to be clear: code block will allow to write the first code snippet as follows:
data = File.readlines('/home/shock_one/test.rb'){ |line| line.upcase }
----------------------------------------
Feature #7654: Add optional code block to IO::readlines
https://bugs.ruby-lang.org/issues/7654#change-35207

Author: shock_one (??抉抖抉忱我技我?? 宋忘????抗我抄)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 


Of course, we always can write something like
File.readlines('/home/shock_one/test.rb').map{ |line| line.upcase }
but this way we create unneeded intermediate array which can be pretty big.
There is also a method IO::foreach, but it doesn't collect return values.
Besides it seems pretty logical and natural to have a block in this method.


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