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 +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +6 -6
- data/lib/google/cloud/translate/v2/service.rb +8 -10
- data/lib/google/cloud/translate/v2/version.rb +1 -1
- metadata +34 -28
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
@@ -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.
|
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
|
|
@@ -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
|
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 = {}
|
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
|
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
|
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
|
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
|
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|
|
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
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 0.17.3
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
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:
|
32
|
+
version: 2.a
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
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:
|
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:
|
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.
|
59
|
+
version: 1.0.5
|
54
60
|
- - "<"
|
55
61
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
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.
|
69
|
+
version: 1.0.5
|
64
70
|
- - "<"
|
65
71
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
72
|
+
version: 2.a
|
67
73
|
- !ruby/object:Gem::Dependency
|
68
|
-
name:
|
74
|
+
name: googleauth
|
69
75
|
requirement: !ruby/object:Gem::Requirement
|
70
76
|
requirements:
|
71
77
|
- - ">="
|
72
78
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
79
|
+
version: 0.16.2
|
74
80
|
- - "<"
|
75
81
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
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:
|
89
|
+
version: 0.16.2
|
84
90
|
- - "<"
|
85
91
|
- !ruby/object:Gem::Version
|
86
|
-
version:
|
92
|
+
version: 2.a
|
87
93
|
- !ruby/object:Gem::Dependency
|
88
|
-
name:
|
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: '
|
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: '
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|