google-ads-common 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ 0.9.2:
2
+ - Fixed issue with boolean value not prefixed in a mixed namespaces case.
3
+
1
4
  0.9.1:
2
5
  - Fixed issues #93, #96, #97.
3
6
 
@@ -110,7 +110,7 @@ module AdsCommon
110
110
  if token.nil?
111
111
  begin
112
112
  credentials = @credential_handler.credentials
113
- token = @auth_handler.get_token(credentials)
113
+ token = auth_handler.get_token(credentials)
114
114
  rescue AdsCommon::Errors::OAuth2VerificationRequired => e
115
115
  verification_code = (block_given?) ? yield(e.oauth_url) : nil
116
116
  # Retry with verification code if one provided.
@@ -87,7 +87,12 @@ module AdsCommon
87
87
  # Refreshes access token from refresh token.
88
88
  def refresh_token!()
89
89
  return nil if @token.nil? or @token[:refresh_token].nil?
90
- @client.refresh!
90
+ begin
91
+ @client.refresh!
92
+ rescue Signet::AuthorizationError => e
93
+ raise AdsCommon::Errors::AuthError.new("OAuth2 token refresh failed",
94
+ e, (e.response.nil?) ? nil : e.response.body)
95
+ end
91
96
  @token = token_from_client(@client)
92
97
  return @token
93
98
  end
@@ -207,8 +212,8 @@ module AdsCommon
207
212
  client.code = verification_code
208
213
  proxy = @config.read('connection.proxy')
209
214
  connection = (proxy.nil?) ? nil : Faraday.new(:proxy => proxy)
210
- token = AdsCommon::Utils.hash_keys_to_sym(
211
- client.fetch_access_token!(:connection => connection))
215
+ client.fetch_access_token!(:connection => connection)
216
+ token = token_from_client(client)
212
217
  end
213
218
  rescue Signet::AuthorizationError => e
214
219
  raise AdsCommon::Errors::AuthError,
@@ -62,7 +62,7 @@ module AdsCommon
62
62
  key = field[:name]
63
63
  item = args_hash[key]
64
64
  check_required_argument_present(item, field)
65
- if item
65
+ unless item.nil?
66
66
  original_name = field[:original_name]
67
67
  if original_name
68
68
  key = handle_name_override(args_hash, key, original_name)
@@ -21,6 +21,6 @@
21
21
 
22
22
  module AdsCommon
23
23
  module ApiConfig
24
- CLIENT_LIB_VERSION = '0.9.1'
24
+ CLIENT_LIB_VERSION = '0.9.2'
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-ads-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-01 00:00:00.000000000 Z
13
+ date: 2013-02-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: savon