Earl

What URI wishes it could look like.

Installation

Add this line to your application's Gemfile:

gem 'earl'

And then execute:

$ bundle

Or install it yourself as:

$ gem install earl

Usage

url = Earl::URL.new 'http://www.foo.com'

url.scheme              # => 'http'
url.scheme?             # => true

url.subdomain           # => 'www'
url.subdomain.www?      # => true
url.subdomain.baz?      # => false

url.host = 'foo.edu'
url.to_s                # => 'http://www.foo.edu'

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request