Skip to content

Commit

Permalink
Added usage instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Nov 2, 2009
1 parent dbb71c1 commit e207362
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Manifest
@@ -1,6 +1,17 @@
README
CHANGELOG.rdoc
LICENSE.rdoc
Manifest
README.rdoc
Rakefile
lib/domain_name.rb
lib/domain_name/definitions.dat
lib/domain_name/errors.rb
lib/domain_name/rule.rb
lib/domain_name/rule_list.rb
lib/domain_name/version.rb
tasks/domain_name.rake
test/acceptance_test.rb
test/domain_name_test.rb
test/rule_list_test.rb
test/rule_test.rb
test/test_helper.rb
Manifest
24 changes: 24 additions & 0 deletions README.rdoc
Expand Up @@ -41,6 +41,30 @@ Via RubyGems/Gemcutter

You might need administrator privileges on your system to install it.


== Usage

Example domain without subdomains.

domain = DomainName.parse("google.com")
domain.tld
# => "com"
domain.domain
# => "google"
domain.subdomain
# => nil

Example domain with subdomains.

domain = DomainName.parse("www.google.com")
domain.tld
# => "com"
domain.domain
# => "google"
domain.subdomain
# => "www"


== Credits

Author:: {Simone Carletti}[http://www.simonecarletti.com/] <weppos@weppos.net>
Expand Down

0 comments on commit e207362

Please sign in to comment.