On Thu, Sep 13, 2012 at 12:34 AM, Matt Neuburg <[email protected]> wrote:
> Robert Klemme <[email protected]> wrote:
>> I interpret "path object is not a string." to mean that a Pathname is
>> not generally considered equivalent to a String.
>
> Except that it is. From the core methods section of the Pathname
> documentation: "These methods are effectively manipulating a String,
> because that's all a path is."
Well then... I don't know.
> The use cases are like this:
>
> require "pathname"
> f = Pathname("howdy")
> p ("well " + f)
>
> Under 1.8.7 that's "well howdy". Under 1.9.3 it's an error, "can't
> convert Pathname into String." One wants to say: "Sure you can, just
> call to_s like you used to!"
I'd rather recommend to use string interpolation for these kinds of
things. I believe this might even be faster.
p "well #{f}"
> It's the breakage I don't understand. Why do our Benevolent Masters
> think this is just okay? I'll never find all the code where I'm doing
> this sort of thing... m.
Obviously "they" (probably this translates to "Matz") judged that
fixing this issue in the library was more important than to prevent
breakage. But as to the "why" I can only speculate.
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
to [email protected]. For more options, visit this
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en