Closed mhuggins closed 10 years ago
Parsing a domain, as well parsing an email, is a simple problem, with no simple solution. I decided to avoid entering that field because it will make my life as a maintainer very complicated. It starts with http, then it will be https, ftps, exceptions, etc. There are so many variants to the problem, enough to consider that task beyond the purpose of this library.
Last but not least, the PublicSuffix is not used to extract an hostname from an URL or an email. Therefore, it makes sense to me to keep the functionalities of this library as close as possible to the original purpose of the PSL.
If I'm trying to parse a full URL, it seems strange that I need to use both PublicSuffix and URI. e.g.:
It seems like it would be relatively easy for this gem's
#parse
method to automatically to aURI.parse(...).domain
to fetch the domain behind the scenes, falling back on the default implementation if URI can't parse the string.