Skip to content

Instantly share code, notes, and snippets.

@kamal
Created February 16, 2009 02:14
Show Gist options
  • Save kamal/64955 to your computer and use it in GitHub Desktop.
Save kamal/64955 to your computer and use it in GitHub Desktop.
MacBook-Pro:zoecity-app(master) kamal$ irb
irb(main):001:0> require "rubygems"
=> true
irb(main):002:0> require "addressable/uri"
=> true
irb(main):003:0> a = Addressable::URI.heuristic_parse("www.google.com ")
=> #<Addressable::URI:0xc3300c URI:http://www.google.com >
irb(main):004:0> a.normalize!
=> #<Addressable::URI:0xc3300c URI:http://www.google.com/>
irb(main):005:0> a.host
=> "www.google.com"
irb(main):006:0> a.to_s
=> "http://www.google.com/"
irb(main):007:0> a.scheme
=> "http"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment