Addressable 是 Ruby 标准库中 URI 实现的一个替代实现。它灵活、提供启发式解析,并提供了可扩展性。
uri = Addressable::URI.parse("http://example.com/path/to/resource/") uri.scheme #=> "http" uri.host #=> "example.com" uri.path #=> "/path/to/resource/"
uri = Addressable::URI.parse("http://www.詹姆斯.com/") uri.normalize #=> #<Addressable::URI:0xc9a4c8 URI:http://www.xn--8ws00zhy3a.com/>
## URI 模板
如需详细信息,请参阅[RFC 6570](https://www.rfc-editor.org/rfc/rfc6570.txt)。
[][gem]
[][actions]
[][coveralls]
[][inch]
[gem]: https://rubygems.org/gems/addressable
[actions]: https://github.com/sporkmonger/addressable/actions
[coveralls]: https://coveralls.io/r/sporkmonger/addressable
[inch]: https://inch-ci.org/github/sporkmonger/addressable暂无开放 Issues,或尚未同步最近议题。