google-ads-common 0.12.5 → 0.12.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2db986ad1bd370703b2924e95f491c684118272d
4
- data.tar.gz: 9a7073d4830e50f02fb50f72858ba37947d609b0
3
+ metadata.gz: a4310819d97635131655a65b5d98849c18ec76cb
4
+ data.tar.gz: 63c393bcacd43a3c34763f12c8ec939499dac628
5
5
  SHA512:
6
- metadata.gz: 761e14fe7e3534f325fee15aac89063fc3679b2be21715e7419e9ec124cfac2440080a0ef8d8744860ae80b16159aab5c226ebe2a9336495261cd5631782615d
7
- data.tar.gz: 9f71f9c5d76eb075788f295edd25b549f1d0afc9eb45fc3483d9f4e10efc2e3410c847fb2aa233405451bb64944e379b8a2122130d7df70a280a9e6c1049234c
6
+ metadata.gz: dfc0517f0ad20ba3a4a2e39a7cb11ad711364c67def32b6833adbc873fbad27e994cd96c1b99005589c53cec604c4d28671e540a398a894c387a266c382c2800
7
+ data.tar.gz: 3ac22c22c57f716fa0e5dd822668d24e5c42c03f3cd6e5030650f88d701f2fea3a326f8adf4afd447dded0655c5ccd0280cba4f078b0296c95d76d7241b565b2
data/ChangeLog CHANGED
@@ -1,3 +1,12 @@
1
+ 0.12.6:
2
+ - Added support for config param :oauth2_prompt and removed support for
3
+ :oauth2_approval_prompt, and updated URI parameter name. The expected value
4
+ for this parameter has changed along with this naming change. For example,
5
+ instead of using "force" you should use "consent".
6
+ For more information, see here:
7
+ https://developers.google.com/identity/protocols/OAuth2UserAgent#formingtheurl
8
+ - Fixed issue #7.
9
+
1
10
  0.12.5:
2
11
  - Fixed issue #75.
3
12
 
data/README.md CHANGED
@@ -24,6 +24,11 @@ The following gem libraries are required:
24
24
  - httpclient
25
25
  - signet
26
26
 
27
+ Note: If you're using a version of Ruby lower than 2.2.2, you will need to
28
+ manually install a previous version of Rack, a dependency of our HTTP library.
29
+ You can do this with:
30
+
31
+ $ gem install rack -v 1.6.4
27
32
 
28
33
  # Docs for Developers
29
34
 
@@ -211,7 +211,7 @@ module AdsCommon
211
211
  if verification_code.nil? || verification_code.empty?
212
212
  uri_options = {
213
213
  :access_type => credentials[:oauth2_access_type],
214
- :approval_prompt => credentials[:oauth2_approval_prompt]
214
+ :prompt => credentials[:oauth2_prompt]
215
215
  }.reject {|k, v| v.nil?}
216
216
  oauth_url = client.authorization_uri(uri_options)
217
217
  raise AdsCommon::Errors::OAuth2VerificationRequired.new(oauth_url)
@@ -52,8 +52,8 @@ module AdsCommon
52
52
  def set(property_path, value)
53
53
  if property_path
54
54
  last_node = @config
55
- last_name = property_path.split('.').inject(nil) do |last_name, section|
56
- last_node = last_node[last_name] ||= {} unless last_name.nil?
55
+ last_name = property_path.split('.').inject(nil) do |name, section|
56
+ last_node = last_node[name] ||= {} unless name.nil?
57
57
  section.to_sym
58
58
  end
59
59
  last_node[last_name] = value
@@ -83,11 +83,11 @@ module AdsCommon
83
83
  @config = new_config
84
84
  else
85
85
  raise AdsCommon::Errors::Error,
86
- "Incorrect configuration file: %s" % filename
86
+ "Incorrect configuration file: '%s'" % filename
87
87
  end
88
88
  rescue TypeError => e
89
89
  raise AdsCommon::Errors::Error,
90
- "Error parsing configuration file: %s" % filename
90
+ "Error parsing configuration file: '%s' (%s)" % [filename, e]
91
91
  end
92
92
  return nil
93
93
  end
@@ -49,7 +49,7 @@ module AdsCommon
49
49
  end
50
50
 
51
51
  # Find removed properties.
52
- diff = @credentials.inject(diff) do |result, (key, value)|
52
+ diff = @credentials.inject(diff) do |result, (key, _)|
53
53
  result << [key, nil] unless new_credentials.include?(key)
54
54
  result
55
55
  end
@@ -62,7 +62,7 @@ module AdsCommon
62
62
  # Normalizes output starting with root output node.
63
63
  def normalize_output(output_data, method_definition)
64
64
  fields = method_definition[:output][:fields]
65
- result = normalize_fields(output_data, fields)
65
+ return normalize_fields(output_data, fields)
66
66
  end
67
67
 
68
68
  # Normalizes all fields for the given data based on the fields list
@@ -102,9 +102,9 @@ module AdsCommon
102
102
  result = data
103
103
  # Convert a specific structure to a handy hash if detected.
104
104
  if check_key_value_struct(result)
105
- result = convert_key_value_to_hash(result).inject({}) do |result, (k,v)|
106
- result[k] = normalize_output_field(v, field_def)
107
- result
105
+ result = convert_key_value_to_hash(result).inject({}) do |s, (k,v)|
106
+ s[k] = normalize_output_field(v, field_def)
107
+ s
108
108
  end
109
109
  else
110
110
  result = data.map {|item| normalize_output_field(item, field_def)}
@@ -109,7 +109,7 @@ module AdsCommon
109
109
  original_action_name = action if original_action_name.nil?
110
110
  response = @client.request(original_action_name) do |soap, wsdl, http|
111
111
  soap.body = args
112
- header_handler.prepare_request(http, soap)
112
+ @header_handler.prepare_request(http, soap)
113
113
  soap.namespaces.merge!(extra_namespaces) unless extra_namespaces.nil?
114
114
  return soap.to_xml if xml_only
115
115
  end
@@ -19,6 +19,6 @@
19
19
 
20
20
  module AdsCommon
21
21
  module ApiConfig
22
- CLIENT_LIB_VERSION = '0.12.5'
22
+ CLIENT_LIB_VERSION = '0.12.6'
23
23
  end
24
24
  end
data/test/test_config.rb CHANGED
@@ -63,7 +63,7 @@ class TestConfig < Test::Unit::TestCase
63
63
  # Test initializer with an incorrect existing file.
64
64
  def test_initialize_filename_incorrect
65
65
  assert_raises (AdsCommon::Errors::Error) do
66
- config = AdsCommon::Config.new('/dev/null')
66
+ AdsCommon::Config.new('/dev/null')
67
67
  end
68
68
  end
69
69
 
data/test/test_env.rb CHANGED
@@ -35,4 +35,9 @@ class TestEnv < Test::Unit::TestCase
35
35
  puts "\nUsing OpenSSL %s with %d methods.\n" %
36
36
  [OpenSSL::OPENSSL_VERSION, OpenSSL::SSL::SSLContext::METHODS.count]
37
37
  end
38
+
39
+ # Output rake version to the tests log.
40
+ def test_rake_version
41
+ puts "\nRunning with rake %s.\n" % Rake::VERSION if defined?(Rake)
42
+ end
38
43
  end
@@ -69,7 +69,7 @@ class TestOAuth < Test::Unit::TestCase
69
69
 
70
70
  # Make sure that we are still able to refresh the token.
71
71
  assert_nothing_raised do
72
- token = handler.refresh_token!();
72
+ handler.refresh_token!();
73
73
  end
74
74
  end
75
75
 
@@ -82,8 +82,7 @@ class TestResultsExtractor < Test::Unit::TestCase
82
82
  end
83
83
 
84
84
  def test_normalize_item_long()
85
- result1 = @extractor.normalize_item(2147483648,
86
- {:type => 'long'})
85
+ result1 = @extractor.normalize_item(2147483648, {:type => 'long'})
87
86
  assert_kind_of(Integer, result1)
88
87
  assert_equal(2147483648, result1, 'bad conversion')
89
88
 
@@ -102,26 +101,21 @@ class TestResultsExtractor < Test::Unit::TestCase
102
101
  result3 = @extractor.normalize_item('true', {:type => 'boolean'})
103
102
  assert_kind_of(TrueClass, result3)
104
103
 
105
- result4 = @extractor.normalize_item('false',
106
- {:type => 'boolean'})
104
+ result4 = @extractor.normalize_item('false', {:type => 'boolean'})
107
105
  assert_kind_of(FalseClass, result4)
108
106
 
109
- result5 = @extractor.normalize_item('True',
110
- {:type => 'boolean'})
111
- assert_kind_of(TrueClass, result3)
107
+ result5 = @extractor.normalize_item('True', {:type => 'boolean'})
108
+ assert_kind_of(TrueClass, result5)
112
109
 
113
- result6 = @extractor.normalize_item('False',
114
- {:type => 'boolean'})
115
- assert_kind_of(FalseClass, result4)
110
+ result6 = @extractor.normalize_item('False', {:type => 'boolean'})
111
+ assert_kind_of(FalseClass, result6)
116
112
  end
117
113
 
118
114
  def test_normalize_item_object()
119
- result1 = @extractor.normalize_item({:a => 'b'},
120
- {:type => 'StubClass'})
115
+ result1 = @extractor.normalize_item({:a => 'b'}, {:type => 'StubClass'})
121
116
  assert_equal('b', result1[:a], 'object corrupted')
122
117
 
123
- result2 = @extractor.normalize_item(@extractor,
124
- {:type => 'SavonService'})
118
+ result2 = @extractor.normalize_item(@extractor, {:type => 'SavonService'})
125
119
  assert_equal(@extractor.hash, result2.hash, 'object corrupted')
126
120
  end
127
121
 
@@ -20,10 +20,6 @@
20
20
 
21
21
  require 'test/unit'
22
22
 
23
- # Work around jruby <= 1.7.8 issue with OpenSSL definition.
24
- require 'openssl'
25
- OpenSSL::SSL::SSLContext::METHODS = []
26
-
27
23
  require 'ads_common/config'
28
24
  require 'ads_common/savon_service'
29
25
 
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.12.5
4
+ version: 0.12.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Gomes
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-10-20 00:00:00.000000000 Z
13
+ date: 2016-12-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: google-ads-savon
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.0'
21
+ version: 1.0.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '1.0'
28
+ version: 1.0.2
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: httpi
31
31
  requirement: !ruby/object:Gem::Requirement