Skip to content

Commit 94b452f

Browse files
committed
Merge pull request #1 from mberube/master
Added configuration to send options (:ssl) to connection
2 parents 6cf6aef + f127b5a commit 94b452f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/zendesk/configuration.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ class Configuration
4141
attr_accessor :retry
4242
# @return [Boolean] Whether to log requests to STDOUT.
4343
attr_accessor :log
44+
# @return [Hash] Client configurations (eg ssh config) to pass to Faraday
45+
attr_accessor :client_options
46+
47+
def initialize
48+
@client_options = {}
49+
end
4450

4551
# Sets accept and user_agent headers, and url.
4652
#
@@ -52,7 +58,7 @@ def options
5258
:user_agent => "Zendesk API #{Zendesk::VERSION}"
5359
},
5460
:url => @url
55-
}
61+
}.merge(client_options)
5662
end
5763
end
5864
end

spec/configuration_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@
1616
it "should set user agent header properly" do
1717
subject.options[:headers][:user_agent].should =~ /Zendesk API/
1818
end
19+
20+
it "should merge options with client_options" do
21+
subject.client_options = {:ssl => false}
22+
subject.options[:ssl].should == false
23+
end
1924
end

0 commit comments

Comments
 (0)