From: Sam Roberts Date: 2005-02-04T14:30:13+09:00 Subject: Re: 'example.com' == 'example.com.' => false... is this intended? Quoteing akr@m17n.org, on Fri, Feb 04, 2005 at 01:25:20PM +0900: > In article <20050131023128.GB13952@ensemble.local>, > Sam Roberts writes: > > > I don't understand why DNS::Name#== requires both to be absolute if one > > is. > > > > Is this really necessary/useful? It surprises me. > > I think it's right behavior. Why? When are they not the same? They are equivalent in the DNS, Resolv::DNS#getaddress() would return the same A record for both. > > Also, I have a set of comparison operations for Resolv::DNS::Name. > > I'm not sure that they are used frequently enough to occupy comparison > operators. Name doesn't have any comparison operators, so they occupy empty space. Do you have another idea on what Name < Name could mean? I found it necessary to find whether a Name was a sub-domain of another. How would you recommend to do this, if there is no method? lhs.length > rhs.length && lhs.to_a[-rhs.length, rhs.length] == rhs.to_a is the best I came up with, and its not the kind of thing I would want to type regularly. Cheers, Sam