Just getting started experimenting with Ruby 1.9 (1.9.3) and my scripts
are collapsing about my ears - for various reasons, of course, but one
of them turns out be that my code relies heavily on implicit conversion
of Pathname to String in various string contexts. It seems that Pathname
no longer has to_str. My questions are:
(1) Why? Was this regarded as a security issue? Or has it, perhaps,
something to do with encodings? I can see the change happening here:
But I don’t understand the reasons for it - and especially why they
would do this when it causes so much breakage.
(2) Any good reason why I shouldn’t work around this by implementing my
own Pathname#to_str to call to_s? It’s an obvious response, but then one
thinks, there might be something about the answer to (1) which make the
answer to (2) “Yes, just bite the bullet and find all the places where
you do this and call to_s explicitly.” But the real problem is that I
doubt I can find them all; it’s pervasive in my code.