README.textile in shadowbq-domainatrix-0.0.12 vs README.textile in shadowbq-domainatrix-0.0.14

- old
+ new

@@ -1,7 +1,11 @@ h1. Domainatrix +!https://badge.fury.io/rb/shadowbq-domainatrix.png!:http://badge.fury.io/rb/shadowbq-domainatrix "!https://codeclimate.com/github/shadowbq/domainatrix.png!":https://codeclimate.com/github/shadowbq/domainatrix "!https://secure.travis-ci.org/shadowbq/domainatrix.png?branch=master!":http://travis-ci.org/shadowbq/domainatrix + +PaulDix's Original Repo + "http://github.com/pauldix/domainatrix":http://github.com/pauldix/domainatrix h2. Summary A cruel mistress that uses the public suffix domain list to dominate URLs by canonicalizing, finding public suffixes, and breaking them into their domain parts. @@ -31,24 +35,36 @@ <pre> require 'rubygems' require 'domainatrix' +# Common Usage url = Domainatrix.parse("http://www.pauldix.net") url.url # => "http://www.pauldix.net/" (the original url) url.host # => "www.pauldix.net" url.public_suffix # => "net" url.domain # => "pauldix" url.canonical # => "net.pauldix" +# Looking at scheme and paths url = Domainatrix.parse("http://foo.bar.pauldix.co.uk/asdf.html?q=arg") url.public_suffix # => "co.uk" url.domain # => "pauldix" url.subdomain # => "foo.bar" url.path # => "/asdf.html?q=arg" url.canonical # => "uk.co.pauldix.bar.foo/asdf.html?q=arg" url.scheme #=> "http" +# ICANN section only suffix search using DynDNS' +url = Domainatrix.icann_parse('www.foo.dyndns.org') +url.host #=> 'www.foo.dyndns.org' } +url.url #=> 'http://www.foo.dyndns.org/' } +url.public_suffix #=>'org' } +url.domain #=>'dyndns' } +url.subdomain #=> 'www.foo' } +url.domain_with_tld #=> 'dyndns.org' } + +# Scanning text line urls = Domainatrix.scan("wikipedia (http://en.wikipedia.org/wiki/Popular_culture): lol") do |match| match.url # Given a block, works like 'map' end urls # => ["http://en.wikipedia.org/wiki/Popular_culture"] </pre>