Merge pull request #229 from nel/master

Fix discrepency around faraday_option and add it to APIClient::Service
This commit is contained in:
Steve Bazyl 2015-05-26 13:35:38 -07:00
commit da25513e06
3 changed files with 5 additions and 3 deletions

View File

@ -27,7 +27,7 @@
* Batch requests with the service interface now inherit the service's connection
* `register_discover_document` now returns the API instance
* Added `:proxy` option to set Faraday's HTTP proxy setting
* Added `:faraday_options` option to allow passthrough settings to Faraday connection
* Added `:faraday_option` option to allow passthrough settings to Faraday connection
* Drop 1.8.x support
* This will be the last release with 1.9.x support

View File

@ -82,7 +82,7 @@ module Google
# @options options[Hash] :force_encoding
# Experimental option. True if response body should be force encoded into the charset
# specified in the Content-Type header. Mostly intended for compressed content.
# @options options[Hash] :faraday_options
# @options options[Hash] :faraday_option
# Pass through of options to set on the Faraday connection
def initialize(options={})
logger.debug { "#{self.class} - Initializing client with options #{options}" }

View File

@ -82,6 +82,8 @@ module Google
# authenticated, `false` otherwise.
# @option options [TrueClass, FalseClass] :gzip (default: true)
# `true` if gzip enabled, `false` otherwise.
# @options options[Hash] :faraday_option
# Pass through of options to set on the Faraday connection
# @option options [Faraday::Connection] :connection
# A custom connection to be used for all requests.
# @option options [ActiveSupport::Cache::Store, :default] :discovery_cache
@ -103,7 +105,7 @@ module Google
params = {}
[:application_name, :application_version, :authorization, :host, :port,
:discovery_path, :auto_refresh_token, :key, :user_ip,
:ca_file].each do |option|
:ca_file, :faraday_option].each do |option|
if options.include? option
params[option] = options[option]
end