method

readlines

v1_8_7_330 - Show latest stable - Class: IO
readlines(...)
public

Reads the entire file specified by name as individual lines, and returns those lines in an array. Lines are separated by sep_string.

a = IO.readlines("testfile")
a[0]   #=> "This is line one\n"