Sha256: 7f276ac9691845c556c0fa4604ab92d33c4cd3da8a977aeb5d478ce6ffe6e93d

Contents?: true

Size: 761 Bytes

Versions: 7

Compression:

Stored size: 761 Bytes

Contents

# frozen_string_literal: true
require 'uri'
require 'addressable/uri'
require 'net/http'
require 'nokogiri'

autoload :OpenSSL, 'openssl'

# Core methods
module URLCanonicalize
  autoload :Exception, 'url_canonicalize/exception'
  autoload :HTTP, 'url_canonicalize/http'
  autoload :Request, 'url_canonicalize/request'
  autoload :Response, 'url_canonicalize/response'
  autoload :URI, 'url_canonicalize/uri'
  autoload :VERSION, 'url_canonicalize/version'

  class << self
    def canonicalize(url)
      fetch(url).url
    end

    def fetch(url)
      URLCanonicalize::HTTP.new(url).fetch
    end
  end
end

require 'monkey_patches/uri'
require 'monkey_patches/string'
require 'monkey_patches/addressable/uri'
require 'English' # Needed for $LAST_MATCH_INFO

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
url_canonicalize-0.1.15 lib/url_canonicalize.rb
url_canonicalize-0.1.14 lib/url_canonicalize.rb
url_canonicalize-0.1.13 lib/url_canonicalize.rb
url_canonicalize-0.1.12 lib/url_canonicalize.rb
url_canonicalize-0.1.11 lib/url_canonicalize.rb
url_canonicalize-0.1.10 lib/url_canonicalize.rb
url_canonicalize-0.1.9 lib/url_canonicalize.rb