> I'd suggest adding lines method to return an array of lines in the
> string, if it's not defined.
Okay, that works fine (with "unless" instead of "if"):

  class String
    unless defined? "".lines
      alias lines to_a
    end
  end

Thanks!

> If 1.8 maintainer agrees, I'd add the method to 1.8.
Would this mean that some scripts (that use String#lines but don't
include the patch above) are running with Ruby 1.9.x and 1.8.7+ only?
Sounds weird...wouldn't it be better to force the patch, instead of
adding another compatibility level (between 1.8.7 and 1.9)?

At least Ruby 1.8 should raise a warning when you try to use a String as
Enumerable.

[murphy]