Skip to content

Instantly share code, notes, and snippets.

@bartolsthoorn
Created May 3, 2013 15:22
Show Gist options
  • Save bartolsthoorn/5509805 to your computer and use it in GitHub Desktop.
Save bartolsthoorn/5509805 to your computer and use it in GitHub Desktop.
Addressable parsing domain.com - wrong
uri = Addressable::URI.parse('http://www.google.com -')
uri.host
# => "www.google.com -"
# Trying Domainatrix
d = Domainatrix.parse(uri.host)
#<Domainatrix::Url:0x007febb38c41e0
@domain="google",
@host="www.google.com -",
@path="",
@public_suffix="com -",
@scheme="http",
@subdomain="www",
@url="http://www.google.com -">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment