tarcieri/http — pull request #52 by ixti (2014-01-13 16:55:24+00:00)
Title: Fail when URI given without scheme

This makes errors when invalid URI given less cryptic:

% ruby -I ./lib -r http -e "HTTP.get 'example.com/'"
/home/ixti/Projects/vidiq/http/lib/http/request.rb:65:in `initialize': unknown scheme: (HTTP::Request::UnsupportedSchemeError)
from /home/ixti/Projects/vidiq/http/lib/http/client.rb:37:in `new'
from /home/ixti/Projects/vidiq/http/lib/http/client.rb:37:in `request'
from /home/ixti/Projects/vidiq/http/lib/http/chainable.rb:50:in `request'
from /home/ixti/Projects/vidiq/http/lib/http/chainable.rb:10:in `get'

versus previous behavior:

% ruby -r http -e "HTTP.get 'example.com/'"
/home/ixti/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/http-0.5.0/lib/http/client.rb:67:in `initialize': getaddrinfo: Name or service not known (SocketError)
from /home/ixti/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/http-0.5.0/lib/http/client.rb:67:in `open'
from /home/ixti/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/http-0.5.0/lib/http/client.rb:67:in `perform'
from /home/ixti/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/http-0.5.0/lib/http/client.rb:58:in `request'
from /home/ixti/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/http-0.5.0/lib/http/chainable.rb:50:in `request'
from /home/ixti/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/http-0.5.0/lib/http/chainable.rb:10:in `get'
from -e:1:in `

'