Sha256: fe9a5cca46f4cecdfc29972da6b57c9189028e13b5ec081a49c5af5c76695025

Contents?: true

Size: 755 Bytes

Versions: 96

Compression:

Stored size: 755 Bytes

Contents

require "uri/common"
require "uri/generic"

module URI
  @@schemes = {}

  class InvalidURIError < Exception
  end
  
  def self.parse(url)
      # scheme://conn_data/path?query#hash
      match = url.match(%r[(\w+)://([^/]+)([^\?]+)(\?[^\#]+)?(\#.*)?])

      _, scheme, connection_data, path, query, fragment = match.to_a

      connection_data = connection_data.split(/@/)
      userinfo = connection_data.size > 1 ? connection_data.first : nil
      host, port = connection_data.last.split(/:/)

      port = port.to_i
      query = query[1..-1] if query

      registry = opaque = nil

      Generic.new(scheme, userinfo, host, port,
                  registry, path, opaque, query,
                  fragment)
  end
end

Version data entries

96 entries across 96 versions & 2 rubygems

Version Path
isomorfeus-preact-23.9.0.rc12 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc11 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc10 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc9 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc8 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc7 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc6 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc5 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc4 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc3 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc2 opal/iso_uri.rb
isomorfeus-preact-23.9.0.rc1 opal/iso_uri.rb
isomorfeus-preact-23.8.0.rc3 opal/iso_uri.rb
isomorfeus-preact-23.8.0.rc2 opal/iso_uri.rb
isomorfeus-preact-23.8.0.rc1 opal/iso_uri.rb
isomorfeus-preact-23.7.0.rc5 opal/iso_uri.rb
isomorfeus-preact-23.7.0.rc4 opal/iso_uri.rb
isomorfeus-preact-23.7.0.rc3 opal/iso_uri.rb
isomorfeus-preact-23.7.0.rc2 opal/iso_uri.rb
isomorfeus-preact-23.7.0.rc1 opal/iso_uri.rb