`String#each` is no longer available in Ruby 1.9.

`String#each` is no longer available in Ruby 1.9, use `String#each_line` instead.
https://projects.puppetlabs.com/issues/12268

I have not tested this on Ruby 1.8.