Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# Fix uri's with only 1 '/' in them
require 'uri'
module URI
class << self
alias parse_orig parse
def parse(string)
unless string.include?("//")
string[string.index('/')] = "//" if string.include?("http")
end
parse_orig(string)
end
end
end
uri = URI.parse('http:/www.google.com')
p uri.host # => www.google.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.