diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/util/monkey_patches.rb
+++ b/lib/puppet/util/monkey_patches.rb
@@ -111,3 +111,12 @@ class Symbol
     Proc.new { |*args| args.shift.__send__(self, *args) }
   end unless method_defined? :to_proc
 end
+
+
+class String
+  alias :lines :each_line unless method_defined?(:lines)
+end
+
+class IO
+  alias :lines :each_line unless method_defined? :lines
+end
Add `lines` alias for `each_line` in Ruby <I>.

String and IO both have the method `lines`, an alias for `each_line`, added in
version <I>; this was used in a few places in the code, and because it is a
simple alias we can easily add it in older versions by hand.