to_a(*args)
Reads ARGF's current file in its entirety, returning an Array of its lines, one line per element. Lines are assumed to be separated by sep.
lines = ARGF.readlines lines[0] #=> "This is line one\n"
static VALUE argf_readlines(int argc, VALUE *argv, VALUE argf) { VALUE line, ary; ary = rb_ary_new(); while (!NIL_P(line = argf_getline(argc, argv, argf))) { rb_ary_push(ary, line); } return ary; }