From: "ko1 (Koichi Sasada)" Date: 2013-02-22T09:12:17+09:00 Subject: [ruby-core:52656] [ruby-trunk - Feature #7654] Add optional code block to IO::readlines Issue #7654 has been updated by ko1 (Koichi Sasada). Assignee set to matz (Yukihiro Matsumoto) ---------------------------------------- Feature #7654: Add optional code block to IO::readlines https://bugs.ruby-lang.org/issues/7654#change-36742 Author: shock_one (������������������ ��������������) Status: Open Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: core Target version: next minor 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/