Sha256: 925acf153f53c98de72063abb44c5f88a3b23cccd4b28435198662892162f343

Contents?: true

Size: 400 Bytes

Versions: 19

Compression:

Stored size: 400 Bytes

Contents

# Helper class to perform tasks on URI's
class UriHelper
  # Returns an Addressable::URI with the fragment section removed
  def self.join_no_fragment(content, link)
    new_link = Addressable::URI.join(content, link)
    new_link.fragment=nil
    new_link
  end

  def self.parse(url)
    begin
      URI.parse(url)
    rescue URI::InvalidURIError
      URI.parse(URI.escape(url))
    end
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cobweb-1.2.1 lib/uri_helper.rb
cobweb-1.2.0 lib/uri_helper.rb
cobweb-1.1.0 lib/uri_helper.rb
cobweb-1.0.29 lib/uri_helper.rb
cobweb-1.0.28 lib/uri_helper.rb
cobweb-1.0.27 lib/uri_helper.rb
cobweb-1.0.26 lib/uri_helper.rb
cobweb-1.0.25 lib/uri_helper.rb
cobweb-1.0.24 lib/uri_helper.rb
cobweb-1.0.23 lib/uri_helper.rb
cobweb-1.0.22 lib/uri_helper.rb
cobweb-1.0.21 lib/uri_helper.rb
cobweb-1.0.20 lib/uri_helper.rb
cobweb-1.0.19 lib/uri_helper.rb
cobweb-1.0.18 lib/uri_helper.rb
cobweb-1.0.17 lib/uri_helper.rb
cobweb-1.0.16 lib/uri_helper.rb
cobweb-1.0.15 lib/uri_helper.rb
cobweb-1.0.12 lib/uri_helper.rb