Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow user to switch underlying http client.

  • Loading branch information...
commit 710fceae40b580ef112da1c1beeafd5082765c6b 1 parent 94ecd70
Felix Holmgren authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/tempodb/client.rb
View
5 lib/tempodb/client.rb
@@ -2,12 +2,15 @@
module TempoDB
class Client
+ attr_accessor :http_adapter
+
def initialize(key, secret, host=TempoDB::API_HOST, port=TempoDB::API_PORT, secure=true)
@key = key
@secret = secret
@host = host
@port = port
@secure = secure
+ @http_adapter = :patron
end
def create_series(key=nil)
@@ -199,7 +202,7 @@ def build_client
ssl_options = {:cert_store => cert_store}
@http_client = Faraday::Connection.new(:headers => headers, :ssl => ssl_options) do |conn|
- conn.adapter :patron
+ conn.adapter @http_adapter
conn.basic_auth(@key, @secret)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.