How to edit each line of a file in ruby, without using a temp file

Thank you very much for the help.