Use IO#foreach to read lines from file