google-cloud-translate-v2 0.3.1 → 0.4.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +6 -6
- data/lib/google/cloud/translate/v2/service.rb +6 -6
- data/lib/google/cloud/translate/v2/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 586284e6210ccef2aac0f858f71cd77fc9a8eb0b2528561e9baad2ee7c88adfd
|
4
|
+
data.tar.gz: ec9dccce1565561e285e923c14dcf2de79780a337845421f238c2ab92f293497
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb9067b94440eeb3a010323db2a02b5c4627a160bed4487bedda8f3d7f518831f9329ee1af7f46d292a2345fafbd5a63a35f4e69a4f4e194d859a6719f50523c
|
7
|
+
data.tar.gz: 522718b79198cceb83a123d5e4aea1b026681e0a4011c2ce9355e3c98467b880a03d4f665bdb8510610964e7c04d0eb2709f5d31999d8f246e813ae2e898ffd5
|
data/CHANGELOG.md
CHANGED
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.
|
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
|
49
|
-
security maintenance, and not end of life.
|
50
|
-
|
51
|
-
|
52
|
-
|
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
|
29
|
+
class Service # :nodoc:
|
30
30
|
API_VERSION = "v2".freeze
|
31
31
|
API_HOST = "translate.googleapis.com".freeze
|
32
32
|
|
@@ -161,14 +161,14 @@ module Google
|
|
161
161
|
self.reasons = ["rateLimitExceeded", "userRateLimitExceeded"]
|
162
162
|
self.backoff = ->(retries) { sleep retries.to_i }
|
163
163
|
|
164
|
-
def initialize options = {}
|
164
|
+
def initialize options = {} # :nodoc:
|
165
165
|
@max_retries = (options[:retries] || Backoff.retries).to_i
|
166
166
|
@http_codes = (options[:http_codes] || Backoff.http_codes).to_a
|
167
167
|
@reasons = (options[:reasons] || Backoff.reasons).to_a
|
168
168
|
@backoff = options[:backoff] || Backoff.backoff
|
169
169
|
end
|
170
170
|
|
171
|
-
def execute
|
171
|
+
def execute # :nodoc:
|
172
172
|
current_retries = 0
|
173
173
|
loop do
|
174
174
|
response = yield # Expecting Faraday::Response
|
@@ -181,7 +181,7 @@ module Google
|
|
181
181
|
|
182
182
|
protected
|
183
183
|
|
184
|
-
def retry? result, current_retries
|
184
|
+
def retry? result, current_retries # :nodoc:
|
185
185
|
if current_retries < @max_retries
|
186
186
|
return true if retry_http_code? result
|
187
187
|
return true if retry_error_reason? result
|
@@ -189,11 +189,11 @@ module Google
|
|
189
189
|
false
|
190
190
|
end
|
191
191
|
|
192
|
-
def retry_http_code? response
|
192
|
+
def retry_http_code? response # :nodoc:
|
193
193
|
@http_codes.include? response.status
|
194
194
|
end
|
195
195
|
|
196
|
-
def retry_error_reason? response
|
196
|
+
def retry_error_reason? response # :nodoc:
|
197
197
|
result = JSON.parse response.body
|
198
198
|
if result && result["error"] && result["error"]["errors"]
|
199
199
|
Array(result["error"]["errors"]).each do |error|
|
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.
|
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:
|
11
|
+
date: 2022-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -110,28 +110,28 @@ dependencies:
|
|
110
110
|
requirements:
|
111
111
|
- - "~>"
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version: 1.
|
113
|
+
version: 1.26.1
|
114
114
|
type: :development
|
115
115
|
prerelease: false
|
116
116
|
version_requirements: !ruby/object:Gem::Requirement
|
117
117
|
requirements:
|
118
118
|
- - "~>"
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version: 1.
|
120
|
+
version: 1.26.1
|
121
121
|
- !ruby/object:Gem::Dependency
|
122
122
|
name: minitest
|
123
123
|
requirement: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
125
|
- - "~>"
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version: '5.
|
127
|
+
version: '5.16'
|
128
128
|
type: :development
|
129
129
|
prerelease: false
|
130
130
|
version_requirements: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
132
|
- - "~>"
|
133
133
|
- !ruby/object:Gem::Version
|
134
|
-
version: '5.
|
134
|
+
version: '5.16'
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: minitest-focus
|
137
137
|
requirement: !ruby/object:Gem::Requirement
|
@@ -264,14 +264,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
264
264
|
requirements:
|
265
265
|
- - ">="
|
266
266
|
- !ruby/object:Gem::Version
|
267
|
-
version: '2.
|
267
|
+
version: '2.6'
|
268
268
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
269
269
|
requirements:
|
270
270
|
- - ">="
|
271
271
|
- !ruby/object:Gem::Version
|
272
272
|
version: '0'
|
273
273
|
requirements: []
|
274
|
-
rubygems_version: 3.
|
274
|
+
rubygems_version: 3.3.14
|
275
275
|
signing_key:
|
276
276
|
specification_version: 4
|
277
277
|
summary: API Client library for Cloud Translation V2 API
|