Sha256: e92060c2c646add45191802cc98e1edeec7ddd506e3e4161705291f30a8632cc

Contents?: true

Size: 510 Bytes

Versions: 1

Compression:

Stored size: 510 Bytes

Contents

# frozen_string_literal: true

module Excon
  module Addressable
    # Parser
    #
    # Parses a url using `Addressable`, setting the port to the inferred_port.
    #
    # @see : https://github.com/excon/excon/issues/384#issuecomment-42645517
    # @see : https://github.com/excon/excon/issues/384#issuecomment-362618298
    #
    class Parser
      def self.parse(url)
        uri = ::Addressable::URI.parse(url)
        uri.port = uri.inferred_port unless uri.port
        uri
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
excon-addressable-0.4.0 lib/excon/addressable/parser.rb