Use #each_line instead of #lines.

IO#each_line is deprecated so lets not rely on it.