Module: URI

Defined in:
lib/bazaar_sources.rb

Constant Summary collapse

CHARACTERS_DISLIKED_BY_PARSE =
'^<>`| '

Class Method Summary collapse

Class Method Details

.safe_parse(url) ⇒ Object



18
19
20
21
22
# File 'lib/bazaar_sources.rb', line 18

def self.safe_parse(url)
  escaped = URI.escape(url, CHARACTERS_DISLIKED_BY_PARSE)
  uri = URI.parse(escaped)
  uri
end