2013/3/27 Pritam Dey <lists / ruby-forum.com>:

> Could anyone help me to understand how ARGF#readpartial is coded for
> each of the above ** marked lines?

It seems the document is just copied from IO#readpartial and doesn't
describe ARGF specific behavior.

Since ARGF is a concatenation of multiple files,
read system call notify EOF for each file.

ARGF#readpartial returns empty string for EOF on the files except last one.
ARGF#readpartial raises EOFError for EOF on the last file.

% echo foo > foo
% ruby -e 'loop { p ARGF.readpartial(4096) }' foo foo foo
"foo\n"
""
"foo\n"
""
"foo\n"
-e:1:in `readpartial': end of file reached (EOFError)
	from -e:1:in `block in <main>'
	from -e:1:in `loop'
	from -e:1:in `<main>'
-- 
Tanaka Akira