End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Kernel#readlines
readlines(sep=$/) → array
readlines(limit) → array
readlines(sep, limit) → array
io.c
View on GitHub ↗
static VALUE
rb_f_readlines(int argc, VALUE *argv, VALUE recv)
{
if (recv == argf) {
return argf_readlines(argc, argv, argf);
}
return forward(argf, rb_intern("readlines"), argc, argv);
}
Returns an array containing the lines returned by calling Kernel.gets(<i>sep</i>) until the end of file.