From: Robert Klemme Date: 2012-09-13T16:34:58+09:00 Subject: Re: Pathname#to_str withdrawn in 1.9? On Thu, Sep 13, 2012 at 12:34 AM, Matt Neuburg wrote: > Robert Klemme 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/