Project

General

Profile

ActionsLike0

Feature #7654

open

Add optional code block to IO::readlines

Added by shock_one (Володимир Шацький) over 12 years ago. Updated about 1 year ago.

Status:
Assigned
Target version:
-
[ruby-core:51240]

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.

Updated by drbrain (Eric Hodel) about 12 years ago

  • Target version set to 2.6

Updated by ko1 (Koichi Sasada) about 12 years ago

  • Assignee set to matz (Yukihiro Matsumoto)
#10

Updated by naruse (Yui NARUSE) over 7 years ago

  • Target version deleted (2.6)
#11

Updated by hsbt (Hiroshi SHIBATA) about 1 year ago

  • Status changed from Open to Assigned
ActionsLike0

Also available in: Atom PDF