propublica/upton — pull request #14 by dannguyen (2013-08-09 13:06:19+00:00)
Title: Added Utils.resolve_url and some tests

Added a way to deal with relative urls and a slightly-altered test in the upton_spec suite to show that it works. However, I think in the long run, some changes will have to be made to the Upton API, which currently assumes a single kind of @index_url (as an instance variable created at initialization).

There may be some extreme edge cases that resolve_url doesn't work on. Compare its shortness versus the version by Mechanize:

https://github.com/sparklemotion/mechanize/blob/5ac3970a1b1475e8325bbf29b54abf0f7b3ecb60/lib/mechanize/http/agent.rb