forked from sporkmonger/addressable
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: svn+ssh://rubyforge.org/var/svn/addressable/trunk@5 43a1db0b-ab41-44e6-b450-8aa639c49ec7
- Loading branch information
1 parent
7e6c417
commit 1808c94
Showing
3 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
Addressable is a replacement for the URI implementation that is part of | ||
Ruby's standard library. It more closely conforms to the relevant RFCs and | ||
adds support for IRIs and URI templates. | ||
|
||
Example usage: | ||
|
||
require 'addressable/uri' | ||
|
||
uri = Addressable::URI.parse("http://example.com/path/to/resource/") | ||
uri.scheme | ||
=> "http" | ||
uri.host | ||
=> "example.com" | ||
uri.path | ||
=> "/path/to/resource/" | ||
|
||
Addressable::URI.expand_template("http://example.com/{query}/", { | ||
"query" => "an+example+query" | ||
}) | ||
=> #<Addressable::URI:0x123456 URI:http://example.com/an+example+query/> | ||
|
||
uri = Addressable::URI.parse("http://www.詹姆斯.com/") | ||
uri.normalize | ||
=> #<Addressable::URI:0x654321 URI:http://www.xn--8ws00zhy3a.com/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters