google-ads-common 0.11.3 → 0.12.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 92e8a7a26a88631f6109cecd9748a25907193e88
4
+ data.tar.gz: 115bedb52bd5a55003ffa3ed598ff4a72554df5f
5
+ SHA512:
6
+ metadata.gz: 0b78cdce163e1910a6e8152b3f7b323421d82a3e6b2c2c9200ead0cf43282cdd91ce3e9ba1b3535417399d4dde394bdcf0ce6d9aa4fae9cc453ad98ecacbba26
7
+ data.tar.gz: 5b104c82f29bd4f2031103b1e8897f2e408a5f7a20b03066e677c6787a5232a9d6c82d6c320b77e5481abe0b5a41a1331175f1b0b11d0dda1031fb30707ac75b
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ 0.12.0:
2
+ - Require Ruby version 2.0 or higher from now on. It is recommended to use
3
+ Ruby version 2.1 or higher.
4
+
1
5
  0.11.3:
2
6
  - Fixes Github Issue 81
3
7
  https://github.com/googleads/google-api-ads-ruby/issues/81
@@ -19,6 +19,8 @@
19
19
 
20
20
  require 'logger'
21
21
 
22
+ require 'ads_common/env_check'
23
+
22
24
  require 'ads_common/config'
23
25
  require 'ads_common/errors'
24
26
  require 'ads_common/utils'
@@ -42,6 +44,7 @@ module AdsCommon
42
44
  def initialize(provided_config = nil)
43
45
  @wrappers = {}
44
46
  load_config(provided_config)
47
+ check_version(@logger)
45
48
  end
46
49
 
47
50
  # Sets the logger to use.
@@ -0,0 +1,40 @@
1
+ # Encoding: utf-8
2
+ #
3
+ # Copyright:: Copyright 2016, Google Inc. All Rights Reserved.
4
+ #
5
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14
+ # implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ # Check whether the current version of Ruby is supported by the client library.
19
+
20
+ require 'ads_common/errors'
21
+
22
+ MIN_RUBY_VERSION = Gem::Version.new(2.0)
23
+ MIN_RUBY_RECOMMENDED_VERSION = Gem::Version.new(2.1)
24
+
25
+ if Gem::Version.new(RUBY_VERSION) < MIN_RUBY_VERSION
26
+ raise AdsCommon::Errors::VersionError,
27
+ 'Unsupported Ruby version %s. Upgrade to version %s or later' %
28
+ [RUBY_VERSION, MIN_RUBY_RECOMMENDED_VERSION]
29
+ end
30
+
31
+ # Checks current ruby version to make sure it's supported.
32
+ def check_version(logger)
33
+ if Gem::Version.new(RUBY_VERSION) < MIN_RUBY_RECOMMENDED_VERSION
34
+ logger.warn(
35
+ ('You are using a deprecated version of Ruby (%s). ' +
36
+ 'Consider upgrading to a fully supported version %s or later') %
37
+ [RUBY_VERSION, MIN_RUBY_RECOMMENDED_VERSION]
38
+ )
39
+ end
40
+ end
@@ -111,5 +111,9 @@ module AdsCommon
111
111
  super(message)
112
112
  end
113
113
  end
114
+
115
+ # Raised if current Ruby version is not compatible with the library.
116
+ class VersionError < Error
117
+ end
114
118
  end
115
119
  end
@@ -19,6 +19,6 @@
19
19
 
20
20
  module AdsCommon
21
21
  module ApiConfig
22
- CLIENT_LIB_VERSION = '0.11.3'
22
+ CLIENT_LIB_VERSION = '0.12.0'
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-ads-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
5
- prerelease:
4
+ version: 0.12.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Sergio Gomes
@@ -11,86 +10,76 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2016-03-07 00:00:00.000000000 Z
13
+ date: 2016-04-07 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: google-ads-savon
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
- - - ~>
19
+ - - "~>"
22
20
  - !ruby/object:Gem::Version
23
21
  version: 1.0.1
24
22
  type: :runtime
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
- - - ~>
26
+ - - "~>"
30
27
  - !ruby/object:Gem::Version
31
28
  version: 1.0.1
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: httpi
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
- - - ~>
33
+ - - "~>"
38
34
  - !ruby/object:Gem::Version
39
35
  version: '2.3'
40
36
  type: :runtime
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
- - - ~>
40
+ - - "~>"
46
41
  - !ruby/object:Gem::Version
47
42
  version: '2.3'
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: httpclient
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
- - - ~>
47
+ - - "~>"
54
48
  - !ruby/object:Gem::Version
55
49
  version: '2.7'
56
50
  type: :runtime
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
- - - ~>
54
+ - - "~>"
62
55
  - !ruby/object:Gem::Version
63
56
  version: '2.7'
64
57
  - !ruby/object:Gem::Dependency
65
58
  name: signet
66
59
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
60
  requirements:
69
- - - ~>
61
+ - - "~>"
70
62
  - !ruby/object:Gem::Version
71
63
  version: 0.7.0
72
64
  type: :runtime
73
65
  prerelease: false
74
66
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
67
  requirements:
77
- - - ~>
68
+ - - "~>"
78
69
  - !ruby/object:Gem::Version
79
70
  version: 0.7.0
80
71
  - !ruby/object:Gem::Dependency
81
72
  name: rake
82
73
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
74
  requirements:
85
- - - ! '>='
75
+ - - ">="
86
76
  - !ruby/object:Gem::Version
87
77
  version: 10.4.2
88
78
  type: :development
89
79
  prerelease: false
90
80
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
81
  requirements:
93
- - - ! '>='
82
+ - - ">="
94
83
  - !ruby/object:Gem::Version
95
84
  version: 10.4.2
96
85
  description: Essential utilities shared by all Ads Ruby client libraries
@@ -100,72 +89,72 @@ executables: []
100
89
  extensions: []
101
90
  extra_rdoc_files: []
102
91
  files:
92
+ - COPYING
93
+ - ChangeLog
94
+ - README.md
103
95
  - lib/ads_common/api.rb
104
- - lib/ads_common/version.rb
105
- - lib/ads_common/errors.rb
96
+ - lib/ads_common/api_config.rb
106
97
  - lib/ads_common/auth/base_handler.rb
107
- - lib/ads_common/auth/oauth2_service_account_handler.rb
108
98
  - lib/ads_common/auth/oauth2_handler.rb
109
- - lib/ads_common/credential_handler.rb
110
- - lib/ads_common/api_config.rb
111
- - lib/ads_common/utils.rb
112
- - lib/ads_common/build/savon_service_generator.rb
113
- - lib/ads_common/build/savon_registry.rb
114
- - lib/ads_common/build/savon_registry_generator.rb
99
+ - lib/ads_common/auth/oauth2_service_account_handler.rb
115
100
  - lib/ads_common/build/savon_abstract_generator.rb
116
101
  - lib/ads_common/build/savon_generator.rb
102
+ - lib/ads_common/build/savon_registry.rb
103
+ - lib/ads_common/build/savon_registry_generator.rb
104
+ - lib/ads_common/build/savon_service_generator.rb
117
105
  - lib/ads_common/config.rb
106
+ - lib/ads_common/credential_handler.rb
107
+ - lib/ads_common/env_check.rb
108
+ - lib/ads_common/errors.rb
109
+ - lib/ads_common/http.rb
118
110
  - lib/ads_common/parameters_validator.rb
111
+ - lib/ads_common/results_extractor.rb
119
112
  - lib/ads_common/savon_headers/base_header_handler.rb
120
113
  - lib/ads_common/savon_headers/oauth_header_handler.rb
121
- - lib/ads_common/results_extractor.rb
122
- - lib/ads_common/http.rb
123
114
  - lib/ads_common/savon_service.rb
124
- - test/test_env.rb
125
- - test/suite_unittests.rb
115
+ - lib/ads_common/utils.rb
116
+ - lib/ads_common/version.rb
126
117
  - test/coverage.rb
127
- - test/test_results_extractor.rb
118
+ - test/suite_unittests.rb
128
119
  - test/test_config.rb
129
- - test/test_utils.rb
120
+ - test/test_config.yml
130
121
  - test/test_credential_handler.rb
122
+ - test/test_env.rb
131
123
  - test/test_oauth2_handler.rb
132
- - test/test_savon_service.rb
133
- - test/test_config.yml
134
124
  - test/test_parameters_validator.rb
135
- - COPYING
136
- - README.md
137
- - ChangeLog
125
+ - test/test_results_extractor.rb
126
+ - test/test_savon_service.rb
127
+ - test/test_utils.rb
138
128
  homepage: https://github.com/googleads/google-api-ads-ruby
139
129
  licenses:
140
130
  - Apache-2.0
131
+ metadata: {}
141
132
  post_install_message:
142
133
  rdoc_options: []
143
134
  require_paths:
144
135
  - lib
145
136
  required_ruby_version: !ruby/object:Gem::Requirement
146
- none: false
147
137
  requirements:
148
- - - ! '>='
138
+ - - ">="
149
139
  - !ruby/object:Gem::Version
150
140
  version: '0'
151
141
  required_rubygems_version: !ruby/object:Gem::Requirement
152
- none: false
153
142
  requirements:
154
- - - ! '>='
143
+ - - ">="
155
144
  - !ruby/object:Gem::Version
156
145
  version: 1.3.6
157
146
  requirements: []
158
147
  rubyforge_project: google-ads-common
159
- rubygems_version: 1.8.23
148
+ rubygems_version: 2.4.8
160
149
  signing_key:
161
- specification_version: 3
150
+ specification_version: 4
162
151
  summary: Common code for Google Ads APIs
163
152
  test_files:
164
- - test/test_env.rb
165
- - test/test_results_extractor.rb
153
+ - test/test_savon_service.rb
166
154
  - test/test_config.rb
167
- - test/test_utils.rb
168
155
  - test/test_credential_handler.rb
169
- - test/test_oauth2_handler.rb
170
- - test/test_savon_service.rb
156
+ - test/test_utils.rb
171
157
  - test/test_parameters_validator.rb
158
+ - test/test_oauth2_handler.rb
159
+ - test/test_env.rb
160
+ - test/test_results_extractor.rb