google-cloud-translate 1.2.4 → 1.3.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 +11 -0
- data/lib/google/cloud/translate.rb +16 -8
- data/lib/google/cloud/translate/version.rb +1 -1
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4d0b506a28c32a88d04a43a7123d5b808e0a202efb45e8cade5f93547496d62
|
4
|
+
data.tar.gz: 13554671d3c8ac13c2b9d9b65119a402aa4fc5a67135113a99cf222afbebdbd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 198e95d6ffd565ef4d908bc6e34619698c9442e4d50e0321bf54a3fabb87eb5f5858331daa3bbd1a97b6638aaa83d8061c7f1803ebc4015cf4bda6fff7d1fad7
|
7
|
+
data.tar.gz: 2fffd675cdf8335edfe9fd069f8fa29e25c04000652c6fd471bc3f1f6a2b3d2c75fba469be89bb59b03ac3651582d5e814822ab5860c15dba01cd7e8cc090c5e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 1.3.0 / 2019-02-01
|
4
|
+
|
5
|
+
* Make use of Credentials#project_id
|
6
|
+
* Use Credentials#project_id
|
7
|
+
If a project_id is not provided, use the value on the Credentials object.
|
8
|
+
This value was added in googleauth 0.7.0.
|
9
|
+
* Loosen googleauth dependency
|
10
|
+
Allow for new releases up to 0.10.
|
11
|
+
The googleauth devs have committed to maintanining the current API
|
12
|
+
and will not make backwards compatible changes before 0.10.
|
13
|
+
|
3
14
|
### 1.2.4 / 2018-09-20
|
4
15
|
|
5
16
|
* Update documentation.
|
@@ -39,6 +39,8 @@ module Google
|
|
39
39
|
# See {file:OVERVIEW.md Translation Overview}.
|
40
40
|
#
|
41
41
|
module Translate
|
42
|
+
# rubocop:disable Metrics/AbcSize
|
43
|
+
|
42
44
|
##
|
43
45
|
# Creates a new object for connecting to Cloud Translation API. Each call
|
44
46
|
# creates a new connection.
|
@@ -108,27 +110,31 @@ module Google
|
|
108
110
|
def self.new project_id: nil, credentials: nil, key: nil, scope: nil,
|
109
111
|
retries: nil, timeout: nil, project: nil, keyfile: nil
|
110
112
|
project_id ||= (project || default_project_id)
|
111
|
-
|
113
|
+
key ||= configure.key
|
112
114
|
|
113
|
-
key ||= configure.key
|
114
115
|
if key
|
115
116
|
return Google::Cloud::Translate::Api.new(
|
116
117
|
Google::Cloud::Translate::Service.new(
|
117
|
-
project_id, nil, retries: retries, timeout: timeout, key: key
|
118
|
+
project_id.to_s, nil, retries: retries, timeout: timeout, key: key
|
118
119
|
)
|
119
120
|
)
|
120
121
|
end
|
121
122
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
retries ||= configure.retries
|
126
|
-
timeout ||= configure.timeout
|
123
|
+
scope ||= configure.scope
|
124
|
+
retries ||= configure.retries
|
125
|
+
timeout ||= configure.timeout
|
127
126
|
credentials ||= keyfile || default_credentials(scope: scope)
|
127
|
+
|
128
128
|
unless credentials.is_a? Google::Auth::Credentials
|
129
129
|
credentials = Translate::Credentials.new credentials, scope: scope
|
130
130
|
end
|
131
131
|
|
132
|
+
if credentials.respond_to? :project_id
|
133
|
+
project_id ||= credentials.project_id
|
134
|
+
end
|
135
|
+
project_id = project_id.to_s # Always cast to a string
|
136
|
+
raise ArgumentError, "project_id is missing" if project_id.empty?
|
137
|
+
|
132
138
|
Translate::Api.new(
|
133
139
|
Translate::Service.new(
|
134
140
|
project_id, credentials, retries: retries, timeout: timeout
|
@@ -136,6 +142,8 @@ module Google
|
|
136
142
|
)
|
137
143
|
end
|
138
144
|
|
145
|
+
# rubocop:enable Metrics/AbcSize
|
146
|
+
|
139
147
|
##
|
140
148
|
# Configure the Google Cloud Translate library.
|
141
149
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-02-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -43,16 +43,22 @@ dependencies:
|
|
43
43
|
name: googleauth
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: 0.6.2
|
49
|
+
- - "<"
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: 0.10.0
|
49
52
|
type: :runtime
|
50
53
|
prerelease: false
|
51
54
|
version_requirements: !ruby/object:Gem::Requirement
|
52
55
|
requirements:
|
53
|
-
- - "
|
56
|
+
- - ">="
|
54
57
|
- !ruby/object:Gem::Version
|
55
58
|
version: 0.6.2
|
59
|
+
- - "<"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.10.0
|
56
62
|
- !ruby/object:Gem::Dependency
|
57
63
|
name: minitest
|
58
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,14 +149,14 @@ dependencies:
|
|
143
149
|
requirements:
|
144
150
|
- - "~>"
|
145
151
|
- !ruby/object:Gem::Version
|
146
|
-
version: 0.
|
152
|
+
version: 0.61.0
|
147
153
|
type: :development
|
148
154
|
prerelease: false
|
149
155
|
version_requirements: !ruby/object:Gem::Requirement
|
150
156
|
requirements:
|
151
157
|
- - "~>"
|
152
158
|
- !ruby/object:Gem::Version
|
153
|
-
version: 0.
|
159
|
+
version: 0.61.0
|
154
160
|
- !ruby/object:Gem::Dependency
|
155
161
|
name: simplecov
|
156
162
|
requirement: !ruby/object:Gem::Requirement
|
@@ -239,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
245
|
version: '0'
|
240
246
|
requirements: []
|
241
247
|
rubyforge_project:
|
242
|
-
rubygems_version: 2.7.
|
248
|
+
rubygems_version: 2.7.6
|
243
249
|
signing_key:
|
244
250
|
specification_version: 4
|
245
251
|
summary: API Client library for Google Cloud Translation API
|