class UriHelper

Helper class to perform tasks on URI's

Public Class Methods

join_no_fragment(content, link) click to toggle source

Returns an Addressable::URI with the fragment section removed

# File lib/uri_helper.rb, line 4
def self.join_no_fragment(content, link)
  new_link = Addressable::URI.join(content, link)
  new_link.fragment=nil
  new_link
end
parse(url) click to toggle source
# File lib/uri_helper.rb, line 10
def self.parse(url)
  begin
    URI.parse(url)
  rescue URI::InvalidURIError
    URI.parse(URI.escape(url))
  end
end