From: Evan Phoenix Date: 2006-03-28T02:04:35+09:00 Subject: Re: PATCH: A subclassable Pathname Quite right on the .glob and .getwd. I guess the tests don't test hit those methods, I'll add some quick tests for those. Also, why is it not so simple when a Pathname is an argument? For instance, the code for join tests that each argument is a Pathname (which will come up as true for subclasses). The it simply uses self.class.new to create the return value. - Evan On 3/27/06, Tanaka Akira wrote: > In article <92f5f81d0603262350k796fe48fp2224b9f2108ac507@mail.gmail.com>, > "Evan Phoenix" writes: > > > A simply change (changing all references of "Pathname.new" to > > "self.class.new") allows for an easily subclassable Pathname. I doubt > > I need to explain why thats a good thing. > > It's acceptable for the instance methods which doesn't take > a Pathname argument. > > However I think it's not so simple for the methods which > take a Pathname argument: +, join, relative_path_from > > Apart from that class methods should not use self.class: > Pathname.glob, Pathname.getwd > -- > Tanaka Akira > > -- When I do good, I feel good; when I do bad, I feel bad, and that is my religion. -- Abraham Lincoln (1809 - 1865)