Utility functions for domain strings
gem install domo-rb
>> require 'domo'
=> 'true'
>> Domo.canonicalize "www.ebay.com"
=> "ebay.com"
>> Domo.canonicalize "boats.ebay.co.uk"
=> "ebay.co.uk"
>> Domo.canonicalize "edition.cnn.com"
=> "cnn.com"
>> Domo.strip_url "http://www.cnn.com/news/last-week/main.html"
=> "www.cnn.com"
Install development dependencies with
bundle install
And run the tests with:
rake spec
Copyright (c) 2011 Gur Dotan, released under the MIT license.