bensie/enom — Issue #8: Does not work for domains like .co.uk
Author: nicholashubbard
Created: 2012-02-02 05:27:43+00:00
State: open

Because of the way you split the domain name on dots causes it not to work for multi-level tlds, like co.uk

I would suggest using something like PublicSuffix so you can do something like this:

```ruby
irb(main):001:0> domain = PublicSuffix.parse("test.co.uk")
=> test.co.uk
irb(main):002:0> domain.sld
=> "test"
irb(main):003:0> domain.tld
=> "co.uk"
```

This helps you from having to keep the logic in your gem about what the valid TLDs are.