benbalter/gman — pull request #6 by benbalter (2013-09-29 00:05:05+00:00)
Title: Rewrite domain check logic to support state and local domains

This pull request should allow definition of domains at any level. "gov" should allow all domains ending in `.gov` while an entry of "foo.bar.il.us" should allow all `*.foo.bar.il.us` domains. Once a namespace is specified, any domain within that namespace is assumed valid.

The logic is now as follows

* Rather than doing all our checking manually, create an instance of `PublicSuffix::List` with a custom domain list
* Check a given domain against that domain list using Public Suffix's standard logic
* If we're still not sure, verify it's at least a valid domain, and look for an explicit match on our list

This should support:

* foo.gov
* foo.bar.gov
* foo.gov.uk
* foo.bar.baz.gov.au
* ci.champaign.il.us
* sfgov.org
* NOT: k12.champaign.il.us

Fixes #4.

/cc @johndbritton, @leereilly