Permalink
Browse files

Simpler http proxy config code

  • Loading branch information...
1 parent 7fcd154 commit 8284fd8eaf1fc291db4769f5db6948292ba23ad2 @mloughran mloughran committed Nov 12, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/pusher/client.rb
  2. +1 −1 spec/client_spec.rb
View
4 lib/pusher/client.rb
@@ -16,7 +16,7 @@ def initialize(options = {})
@scheme, @host, @port, @app_id, @key, @secret = options.values_at(
:scheme, :host, :port, :app_id, :key, :secret
)
- http_proxy = options.values_at(:http_proxy) if options.key?(:http_proxy)
+ self.http_proxy = options[:http_proxy] if options[:http_proxy]
end
# @private Returns the authentication token for the client
@@ -50,7 +50,7 @@ def url=(url)
@port = uri.port
end
- def http_proxy= http_proxy
+ def http_proxy=(http_proxy)
@http_proxy = http_proxy
uri = URI.parse(http_proxy)
@proxy = {
View
2 spec/client_spec.rb
@@ -131,7 +131,7 @@
end
end
- describe 'configuration using http_proxy' do
+ describe 'configuring a http proxy' do
it "should be possible to configure everything by setting the http_proxy" do
@client.http_proxy = 'http://someuser:somepassword@proxy.host.com:8080'

0 comments on commit 8284fd8

Please sign in to comment.