Issue #19628 has been reported by davishmcclurg (David Harsha).
----------------------------------------
Feature #19628: Add ARGF.each_file for iterating file/io objects
https://bugs.ruby-lang.org/issues/19628
* Author: davishmcclurg (David Harsha)
* Status: Open
* Priority: Normal
----------------------------------------
`ARGF` provides helpers for processing file/stdin command line arguments in various ways
(bytes, chars, codepoints, etc), but it doesn't currently have a simple way to iterate
through the arguments as `File`/`IO` objects. This can be useful when you want to perform
an operation on the contents of an entire file (eg, JSON parsing) instead of combining
them into a single string or going line-by-line. My proposal is to add an `ARGF.each_file`
method that yields each file (or returns an enumerator if no block is provided).
Possible implementation:
https://github.com/davishmcclurg/ruby/commit/cc8054c2737243f839d72622977a44…
--
https://bugs.ruby-lang.org/