Parse & components ready
URI.parse(s) splitting scheme / userinfo / host / port / path / query / fragment, with the per-scheme generic/HTTP/HTTPS/FTP/LDAP shapes Ruby’s URI uses.
Ruby's URI parse, build & normalize in pure Go โ MRI-compatible, no cgo.
go-ruby-uri is a pure-Go (no cgo) reimplementation of Ruby's URI library โ a parser, builder and normalizer that match reference Ruby's behaviour byte-for-byte. It splits a URI into scheme / userinfo / host / port / path / query / fragment with the per-scheme generic/HTTP/HTTPS/FTP/LDAP shapes Ruby uses, resolves relative references with merge / + per RFC 3986, normalizes scheme and host, and does encode_www_form and escape / unescape with Ruby's reserved-character tables โ raising the URI::InvalidURIError / URI::InvalidComponentError / URI::BadURIError taxonomy on the same inputs. It was extracted from rbgo's prelude/internals into a reusable standalone library: no dependency on the Ruby runtime, the dependency runs the other way. It is the URI backend for go-embedded-ruby, bound by rbgo as a native module just like go-ruby-regexp and go-ruby-erb โ differential-tested against MRI, 100% coverage, CI green across 6 arches and 3 OSes.
URI.parse(s) splitting scheme / userinfo / host / port / path / query / fragment, with the per-scheme generic/HTTP/HTTPS/FTP/LDAP shapes Ruby’s URI uses.
Constructing a URI from components and merge / + for relative-reference resolution, following RFC 3986 the way reference Ruby does.
normalize lower-casing the scheme and host, collapsing default ports and dot-segments, matching MRI byte-for-byte.
Form encoding/decoding and escape/unescape with Ruby’s reserved-character tables.
The URI::InvalidURIError / URI::InvalidComponentError / URI::BadURIError hierarchy, raised on the same inputs as reference Ruby.
A wide URI corpus parsed, built and normalized both here and by the system ruby/uri, compared byte-for-byte; 100% coverage, gofmt + go vet clean, green across all six 64-bit Go arches and three OSes.
A faithful port of Ruby's URI parser, builder and normalizer in pure Go, cgo disabled, so it cross-compiles and embeds anywhere. It splits and rebuilds URIs across the generic and HTTP/HTTPS/FTP/LDAP shapes, resolves relative references with merge per RFC 3986, normalizes scheme and host, and does encode_www_form and escape / unescape with Ruby's reserved-character tables. Validated differentially against the system ruby binary โ parsed, built and normalized URIs compared against Ruby's uri. It is a standalone, reusable module extracted from rbgo's internals, and the URI backend for the sibling org github.com/go-embedded-ruby.