Parsing URLs : URI « Network « Ruby

Parsing URLs

require 'uri'

puts URI.parse('').scheme           # => "https"
puts URI.parse('').host             # => ""
puts URI.parse('').port        # => 6060
puts URI.parse('').path      # => "/a/file.html"


Related examples in the same category

1.Split a URL
4.Create a URL with
5.Dump a URL
6.mailto URI parse
7.URI parse
8.Extracting All the URLs from an HTML Document
9.Get only http and https based url