google-cloud-translate-v2 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 690fe6e1f9586e11422cfeaaa400e104c69c995fbe5adc7245d8915e34ddc025
4
- data.tar.gz: 70f2eb7b464bc6e527f9a00fa56173da80086cae482538e86c613babb2307d47
3
+ metadata.gz: 586284e6210ccef2aac0f858f71cd77fc9a8eb0b2528561e9baad2ee7c88adfd
4
+ data.tar.gz: ec9dccce1565561e285e923c14dcf2de79780a337845421f238c2ab92f293497
5
5
  SHA512:
6
- metadata.gz: e13a3af578f211a2816c95ec7fad3773c2759c549b6b0561c2c1e8cf6b575654b800a9dc93e7e2496b628d8e7f09fef25162affe433313fbd4b6d5b2fba49a66
7
- data.tar.gz: 20dfc477fcd3f0c18479d25c8a23ba10ed0c275a8dc1c90a75df95047377ce953fa49ee4ba487a839808170b5918671d97ea5d2d37fd49183f0fd56e3bc8c5e6
6
+ metadata.gz: bb9067b94440eeb3a010323db2a02b5c4627a160bed4487bedda8f3d7f518831f9329ee1af7f46d292a2345fafbd5a63a35f4e69a4f4e194d859a6719f50523c
7
+ data.tar.gz: 522718b79198cceb83a123d5e4aea1b026681e0a4011c2ce9355e3c98467b880a03d4f665bdb8510610964e7c04d0eb2709f5d31999d8f246e813ae2e898ffd5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Release History
2
2
 
3
+ ### 0.4.0 (2022-07-28)
4
+
5
+ #### Features
6
+
7
+ * Update minimum Ruby version to 2.6 ([#18868](https://github.com/googleapis/google-cloud-ruby/issues/18868))
8
+
9
+ ### 0.3.1 / 2021-06-17
10
+
11
+ #### Bug Fixes
12
+
13
+ * Expand googleauth dependency to support future 1.x versions
14
+
15
+ ### 0.3.0 / 2021-03-10
16
+
17
+ #### Features
18
+
19
+ * Drop support for Ruby 2.4 and add support for Ruby 3.0
20
+
3
21
  ### 0.2.0 / 2020-09-16
4
22
 
5
23
  #### Features
data/README.md CHANGED
@@ -42,11 +42,11 @@ for class and method documentation.
42
42
 
43
43
  ## Supported Ruby Versions
44
44
 
45
- This library is supported on Ruby 2.4+.
45
+ This library is supported on Ruby 2.6+.
46
46
 
47
47
  Google provides official support for Ruby versions that are actively supported
48
- by Ruby Core—that is, Ruby versions that are either in normal maintenance or in
49
- security maintenance, and not end of life. Currently, this means Ruby 2.4 and
50
- later. Older versions of Ruby _may_ still work, but are unsupported and not
51
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
52
- about the Ruby support schedule.
48
+ by Ruby Core—that is, Ruby versions that are either in normal maintenance or
49
+ in security maintenance, and not end of life. Older versions of Ruby _may_
50
+ still work, but are unsupported and not recommended. See
51
+ https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
52
+ support schedule.
@@ -26,7 +26,7 @@ module Google
26
26
  ##
27
27
  # @private
28
28
  # Represents the Translation API REST service, exposing the API calls.
29
- class Service #:nodoc:
29
+ class Service # :nodoc:
30
30
  API_VERSION = "v2".freeze
31
31
  API_HOST = "translate.googleapis.com".freeze
32
32
 
@@ -127,11 +127,9 @@ module Google
127
127
 
128
128
  ##
129
129
  # Make a request and apply incremental backoff
130
- def execute
130
+ def execute &block
131
131
  backoff = Backoff.new retries: retries
132
- backoff.execute do
133
- yield
134
- end
132
+ backoff.execute(&block)
135
133
  rescue Faraday::ConnectionFailed
136
134
  raise Google::Cloud::ResourceExhaustedError
137
135
  end
@@ -163,14 +161,14 @@ module Google
163
161
  self.reasons = ["rateLimitExceeded", "userRateLimitExceeded"]
164
162
  self.backoff = ->(retries) { sleep retries.to_i }
165
163
 
166
- def initialize options = {} #:nodoc:
164
+ def initialize options = {} # :nodoc:
167
165
  @max_retries = (options[:retries] || Backoff.retries).to_i
168
166
  @http_codes = (options[:http_codes] || Backoff.http_codes).to_a
169
167
  @reasons = (options[:reasons] || Backoff.reasons).to_a
170
168
  @backoff = options[:backoff] || Backoff.backoff
171
169
  end
172
170
 
173
- def execute #:nodoc:
171
+ def execute # :nodoc:
174
172
  current_retries = 0
175
173
  loop do
176
174
  response = yield # Expecting Faraday::Response
@@ -183,7 +181,7 @@ module Google
183
181
 
184
182
  protected
185
183
 
186
- def retry? result, current_retries #:nodoc:
184
+ def retry? result, current_retries # :nodoc:
187
185
  if current_retries < @max_retries
188
186
  return true if retry_http_code? result
189
187
  return true if retry_error_reason? result
@@ -191,11 +189,11 @@ module Google
191
189
  false
192
190
  end
193
191
 
194
- def retry_http_code? response #:nodoc:
192
+ def retry_http_code? response # :nodoc:
195
193
  @http_codes.include? response.status
196
194
  end
197
195
 
198
- def retry_error_reason? response #:nodoc:
196
+ def retry_error_reason? response # :nodoc:
199
197
  result = JSON.parse response.body
200
198
  if result && result["error"] && result["error"]["errors"]
201
199
  Array(result["error"]["errors"]).each do |error|
@@ -17,7 +17,7 @@ module Google
17
17
  module Cloud
18
18
  module Translate
19
19
  module V2
20
- VERSION = "0.2.0".freeze
20
+ VERSION = "0.4.0".freeze
21
21
  end
22
22
  end
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-translate-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-16 00:00:00.000000000 Z
11
+ date: 2022-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 0.17.3
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '2.0'
22
+ version: 2.a
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,103 +29,109 @@ dependencies:
29
29
  version: 0.17.3
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '2.0'
32
+ version: 2.a
33
33
  - !ruby/object:Gem::Dependency
34
- name: google-cloud-core
34
+ name: googleapis-common-protos
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 1.3.10
40
+ - - "<"
38
41
  - !ruby/object:Gem::Version
39
- version: '1.5'
42
+ version: 2.a
40
43
  type: :runtime
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
44
- - - "~>"
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 1.3.10
50
+ - - "<"
45
51
  - !ruby/object:Gem::Version
46
- version: '1.5'
52
+ version: 2.a
47
53
  - !ruby/object:Gem::Dependency
48
- name: googleapis-common-protos
54
+ name: googleapis-common-protos-types
49
55
  requirement: !ruby/object:Gem::Requirement
50
56
  requirements:
51
57
  - - ">="
52
58
  - !ruby/object:Gem::Version
53
- version: 1.3.10
59
+ version: 1.0.5
54
60
  - - "<"
55
61
  - !ruby/object:Gem::Version
56
- version: '2.0'
62
+ version: 2.a
57
63
  type: :runtime
58
64
  prerelease: false
59
65
  version_requirements: !ruby/object:Gem::Requirement
60
66
  requirements:
61
67
  - - ">="
62
68
  - !ruby/object:Gem::Version
63
- version: 1.3.10
69
+ version: 1.0.5
64
70
  - - "<"
65
71
  - !ruby/object:Gem::Version
66
- version: '2.0'
72
+ version: 2.a
67
73
  - !ruby/object:Gem::Dependency
68
- name: googleapis-common-protos-types
74
+ name: googleauth
69
75
  requirement: !ruby/object:Gem::Requirement
70
76
  requirements:
71
77
  - - ">="
72
78
  - !ruby/object:Gem::Version
73
- version: 1.0.5
79
+ version: 0.16.2
74
80
  - - "<"
75
81
  - !ruby/object:Gem::Version
76
- version: '2.0'
82
+ version: 2.a
77
83
  type: :runtime
78
84
  prerelease: false
79
85
  version_requirements: !ruby/object:Gem::Requirement
80
86
  requirements:
81
87
  - - ">="
82
88
  - !ruby/object:Gem::Version
83
- version: 1.0.5
89
+ version: 0.16.2
84
90
  - - "<"
85
91
  - !ruby/object:Gem::Version
86
- version: '2.0'
92
+ version: 2.a
87
93
  - !ruby/object:Gem::Dependency
88
- name: googleauth
94
+ name: google-cloud-core
89
95
  requirement: !ruby/object:Gem::Requirement
90
96
  requirements:
91
97
  - - "~>"
92
98
  - !ruby/object:Gem::Version
93
- version: '0.12'
99
+ version: '1.6'
94
100
  type: :runtime
95
101
  prerelease: false
96
102
  version_requirements: !ruby/object:Gem::Requirement
97
103
  requirements:
98
104
  - - "~>"
99
105
  - !ruby/object:Gem::Version
100
- version: '0.12'
106
+ version: '1.6'
101
107
  - !ruby/object:Gem::Dependency
102
108
  name: google-style
103
109
  requirement: !ruby/object:Gem::Requirement
104
110
  requirements:
105
111
  - - "~>"
106
112
  - !ruby/object:Gem::Version
107
- version: 1.24.0
113
+ version: 1.26.1
108
114
  type: :development
109
115
  prerelease: false
110
116
  version_requirements: !ruby/object:Gem::Requirement
111
117
  requirements:
112
118
  - - "~>"
113
119
  - !ruby/object:Gem::Version
114
- version: 1.24.0
120
+ version: 1.26.1
115
121
  - !ruby/object:Gem::Dependency
116
122
  name: minitest
117
123
  requirement: !ruby/object:Gem::Requirement
118
124
  requirements:
119
125
  - - "~>"
120
126
  - !ruby/object:Gem::Version
121
- version: '5.14'
127
+ version: '5.16'
122
128
  type: :development
123
129
  prerelease: false
124
130
  version_requirements: !ruby/object:Gem::Requirement
125
131
  requirements:
126
132
  - - "~>"
127
133
  - !ruby/object:Gem::Version
128
- version: '5.14'
134
+ version: '5.16'
129
135
  - !ruby/object:Gem::Dependency
130
136
  name: minitest-focus
131
137
  requirement: !ruby/object:Gem::Requirement
@@ -258,14 +264,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
258
264
  requirements:
259
265
  - - ">="
260
266
  - !ruby/object:Gem::Version
261
- version: '2.4'
267
+ version: '2.6'
262
268
  required_rubygems_version: !ruby/object:Gem::Requirement
263
269
  requirements:
264
270
  - - ">="
265
271
  - !ruby/object:Gem::Version
266
272
  version: '0'
267
273
  requirements: []
268
- rubygems_version: 3.1.4
274
+ rubygems_version: 3.3.14
269
275
  signing_key:
270
276
  specification_version: 4
271
277
  summary: API Client library for Cloud Translation V2 API