self.user_agent = options[:user_agent] || (
"#{application_string} " +
- "google-api-ruby-client/#{Google::APIClient::VERSION::STRING} #{ENV::OS_VERSION} (gzip)"
+ "google-api-ruby-client/#{Google::APIClient::VERSION::STRING} #{ENV::OS_VERSION}".strip + " (gzip)"
).strip
# The writer method understands a few Symbols and will generate useful
# default authentication mechanisms.
faraday.options.params_encoder = Faraday::FlatParamsEncoder
faraday.ssl.ca_file = ca_file
faraday.ssl.verify = true
- faraday.proxy proxy
+ if faraday.respond_to?(:proxy=)
+ # faraday >= 0.6.2
+ faraday.proxy = proxy
+ else
+ # older versions of faraday
+ faraday.proxy proxy
+ end
faraday.adapter Faraday.default_adapter
if options[:faraday_option].is_a?(Hash)
options[:faraday_option].each_pair do |option, value|
else
check_cached_certs = lambda do
valid = false
- for key, cert in @certificates
+ for _key, cert in @certificates
begin
self.authorization.decoded_id_token(cert.public_key)
valid = true