From: "ufuk (Ufuk Kayserilioglu)" Date: 2022-07-15T15:53:42+00:00 Subject: [ruby-core:109219] [Ruby master Bug#18909] ARGF.readlines reads more than current file Issue #18909 has been updated by ufuk (Ufuk Kayserilioglu). Moreover, it is documented that `ARGF` works this way in general: https://ruby-doc.org/core-3.1.0/ARGF.html > You can now use `ARGF` to work with a concatenation of each of these named files. For instance, `ARGF.read` will return the contents of `file1` followed by the contents of `file2`. ---------------------------------------- Bug #18909: ARGF.readlines reads more than current file https://bugs.ruby-lang.org/issues/18909#change-98354 * Author: JohanJosefsson (Johan Josefsson) * Status: Open * Priority: Normal * ruby -v: ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- The docuentation says that ARGF.readlines: *Reads ARGF's current file in its entirety* , but this is what happens: `$ cat fileA A $ cat fileB B $ ruby -e 'puts ARGF.readlines' fileA fileB A B` i.e. it reads both the current file and the next one (all files?). -- https://bugs.ruby-lang.org/ Unsubscribe: