ruby 2.0 fix - use .each_line instead of .each on StringIO