I think `String#each_line` will do what you want and handle the line separator stuff.