chrisle/gattica — pull request #24 by whatthewhat (2013-02-13 10:24:42+00:00)
Title: Add http proxy support

Hello, thanks for supporting this useful gem!

This pull request adds http proxy support with this configs:

```ruby
ga = Gattica.new({
...
:http_proxy => { :host => 'proxy.example.com', :port => 8080, :user => 'username', :password => 'password' }
})
```

I've tried to add some tests around this feature, i.e. something like:
```ruby
def test_setting_http_proxy
ga = Gattica.new((GatticaTest::DEFAULT_AUTH).merge!(:http_proxy => { host: "proxy.example.com", port: "8080", user: "user", password: "password" }))
http = ga.instance_variable_get('@http')
assert http.proxy_host == "proxy.example.com", "proxy_host should be 'proxy.example.com'"
assert http.proxy_port == "8080", "proxy_port should be '8080'"
assert http.proxy_user == "user", "proxy_user should be 'user'"
assert http.proxy_pass == "password", "proxy_user should be 'password'"
end
```
but since Gattica.new starts real http connection this approach didn't really work out.. so I left out the tests for now, but the code is very simple and i've tested it manually in couple environments.