require 'addressable/uri'
# URI Templates
uri = Addressable::URI.expand_template("http://example.com/?q={query}", {
"query" => "an example query"
})
puts uri
http://example.com/?q=an%20example%20query# heuristic_parse / normalize
uri = Addressable::URI.heuristic_parse('http:///example.com/"')
puts uri.normalize
http://example.com/%22# extract_mapping
uri = Addressable::URI.parse('http://intertwingly.net/blog/2007/12/21/foo')
p uri.extract_mapping('http://{host}/blog/{date}/{slug}')
{"slug"=>"foo", "date"=>"2007/12/21", "host"=>"intertwingly.net"}# IRI
uri = Addressable::URI.parse("http://www.詹姆斯.com/")
puts uri.normalize
http://www.xn--8ws00zhy3a.com/
So, I don’t recognize the cool SVG icon? Doesn’t seem to parse into easily recognizable characters either.
I actually don’t know the history of that icon. From what I gather, it dates back to the *IETF* HTML Working Group, and still appears on the w3 protocols page.
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. [via Sam Ruby]......
Addressable. Bog Aman’s better URI library for Ruby (via Sam Ruby) Er.js. Erlang-style concurrency with JavaScript. (Mini-rant: I wish people would stop calling it Erlang-style, just give Erlang credit for popularizing and it’s...
The Wisdom of Ganesh: Paying the RESTafarians Back in Their Own Coin One of the best anti-REST rant I’ve come across. Check out Steve Vinoski’s blog for a response (in short, it’s the constraints, stupid). (tags: blog post article critique REST...