Actions
Feature #7654
openAdd optional code block to IO::readlines
Feature #7654:
Add optional code block to IO::readlines
Description
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.
Actions