From: Tanaka Akira Date: 2005-02-04T17:02:45+09:00 Subject: Re: 'example.com' == 'example.com.' => false... is this intended? In article <20050204052951.GA2531@ensemble.local>, Sam Roberts writes: > Why? When are they not the same? For example, if you have a machine named "museum", it is confusing with "museum." domain. > They are equivalent in the DNS, Resolv::DNS#getaddress() would return > the same A record for both. There are several top-domains which have A record: ac, museum, etc. If your local domain have a machine named "ac", it is important to distinguish a relative "ac" domain and the absolute "ac" domain. > Name doesn't have any comparison operators, so they occupy empty space. > > Do you have another idea on what Name < Name could mean? For example, lexical order. > 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. Adding some method (not operator) is acceptable if it has a good name. -- Tanaka Akira