It seems the most important change in 1.9, in terms of compatibility, is
that String isn't Enumerable anymore. It breaks a lot of scripts on my
system.
I couldn't find an easy way to make scripts running under both 1.8 and 1.9:
- String#each_line requires a block in 1.8, and writing each_line{}
isn't really beautiful.
- String#to_a isn't available in 1.9.
- The "dirty fix":
class String
alias each lines
include Enumerable
rescue
end
is surely not what we want.
So, what is the preferable way to make scripts and libraries that use
String#each 1.9-ready? It may be okay to force developers to update
their code, but there should be an easy way not to break backward
compatibility in the process.
[murphy]