URLGrey
This attempts to copy chomium's algorithm for making sense of things
typed into the url bar. You can download the chromium source to play
along, but note that it is currently 2.1 GB.
The ported code is very similar to how it is written in the original
C++. It is a great example of the imperative style of programming by
state mutation. I'm not gonna lie, it's pretty gross. But hey, it passes
the tests.
Usage
Some examples from the tests:
URLGrey.new("google.com").fixed
URLGrey.new("www.google.com#foo").fixed
URLGrey.new("\u6C34.com").fixed
URLGrey.new("http://foo.com/s?q=\uC5C5").fixed
URLGrey.new("http;/www.google.com/").fixed
URLGrey.new(" foo.com/asdf bar").fixed
URLGrey.new("[::]:80/path").fixed