google-cloud-translate-v2 1.0.1 → 1.2.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 +13 -0
- data/README.md +1 -1
- data/lib/google/cloud/translate/v2/version.rb +1 -1
- data/lib/google/cloud/translate/v2.rb +15 -5
- metadata +4 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6233b6c5abbe1755b641bc67fcc0df85b8ef03a00c3f1f6d2779690cbc3b1e9
|
|
4
|
+
data.tar.gz: 13fdbee9d9964c238de146727050c4c82721969d8a4c9d056d43e67e4cb18899
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7838f8d5b6bfc861031a7518e3d68c95cfa454bc713166c9bbe58a8104aab647d9e27daf9d3779b5cdc566ce731abf52bfe386422fce8a283a21b7ae5b221737
|
|
7
|
+
data.tar.gz: 856dd85681bedba41249f4c82b9d69900a017a622223dcc2f7722f606762a8d63a65deecc661334be17d7a0ff8f42a13253b4fc3278a1b48ee22042ab327a196
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
+
### 1.2.0 (2026-06-11)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* enable self-signed JWT by default ([#33974](https://github.com/googleapis/google-cloud-ruby/issues/33974))
|
|
8
|
+
* Update minimum Ruby to 3.2 ([#33981](https://github.com/googleapis/google-cloud-ruby/issues/33981))
|
|
9
|
+
|
|
10
|
+
### 1.1.0 (2025-03-04)
|
|
11
|
+
|
|
12
|
+
#### Features
|
|
13
|
+
|
|
14
|
+
* Update minimum Ruby version to 3.0 ([#29261](https://github.com/googleapis/google-cloud-ruby/issues/29261))
|
|
15
|
+
|
|
3
16
|
### 1.0.1 (2024-12-12)
|
|
4
17
|
|
|
5
18
|
#### Bug Fixes
|
data/README.md
CHANGED
|
@@ -42,7 +42,7 @@ 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 3.2+.
|
|
46
46
|
|
|
47
47
|
Google provides official support for Ruby versions that are actively supported
|
|
48
48
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
|
@@ -63,6 +63,8 @@ module Google
|
|
|
63
63
|
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
|
64
64
|
# @param [String] endpoint Override of the endpoint host name. Optional. If the param is nil, uses the default
|
|
65
65
|
# endpoint.
|
|
66
|
+
# @param [Boolean] enable_self_signed_jwt Whether to enable self-signed JWT. Optional. If the param is nil,
|
|
67
|
+
# it is computed based on the endpoint.
|
|
66
68
|
#
|
|
67
69
|
# @return [Google::Cloud::Translate::V2::Api]
|
|
68
70
|
#
|
|
@@ -98,7 +100,7 @@ module Google
|
|
|
98
100
|
# translation = translate.translate "Hello world!", to: "la"
|
|
99
101
|
# translation.text #=> "Salve mundi!"
|
|
100
102
|
#
|
|
101
|
-
def self.new project_id: nil, credentials: nil, key: nil, scope: nil, retries: nil, timeout: nil, endpoint: nil
|
|
103
|
+
def self.new project_id: nil, credentials: nil, key: nil, scope: nil, retries: nil, timeout: nil, endpoint: nil, enable_self_signed_jwt: nil
|
|
102
104
|
project_id ||= default_project_id
|
|
103
105
|
|
|
104
106
|
configuration = translation_config
|
|
@@ -116,10 +118,18 @@ module Google
|
|
|
116
118
|
end
|
|
117
119
|
|
|
118
120
|
scope ||= configuration&.scope
|
|
119
|
-
|
|
121
|
+
|
|
122
|
+
if enable_self_signed_jwt.nil?
|
|
123
|
+
# Use self-signed JWT if the endpoint is unchanged from default (nil or default host).
|
|
124
|
+
# This logic is adapted from gapic-generator-ruby templates,
|
|
125
|
+
# simplified here since the default host is known to be global.
|
|
126
|
+
enable_self_signed_jwt = endpoint.nil? || endpoint == Service::API_HOST
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
credentials ||= default_credentials scope: scope, enable_self_signed_jwt: enable_self_signed_jwt
|
|
120
130
|
|
|
121
131
|
unless credentials.is_a? Google::Auth::Credentials
|
|
122
|
-
credentials = Google::Cloud::Translate::V2::Credentials.new credentials, scope: scope
|
|
132
|
+
credentials = Google::Cloud::Translate::V2::Credentials.new credentials, { scope: scope, enable_self_signed_jwt: enable_self_signed_jwt }
|
|
123
133
|
end
|
|
124
134
|
|
|
125
135
|
project_id = resolve_project_id project_id, credentials
|
|
@@ -143,13 +153,13 @@ module Google
|
|
|
143
153
|
|
|
144
154
|
##
|
|
145
155
|
# @private Default credentials.
|
|
146
|
-
def self.default_credentials scope: nil
|
|
156
|
+
def self.default_credentials scope: nil, enable_self_signed_jwt: nil
|
|
147
157
|
translation_config&.credentials ||
|
|
148
158
|
Google::Cloud::Config.credentials_from_env(
|
|
149
159
|
"TRANSLATE_CREDENTIALS", "TRANSLATE_CREDENTIALS_JSON", "TRANSLATE_KEYFILE", "TRANSLATE_KEYFILE_JSON"
|
|
150
160
|
) ||
|
|
151
161
|
Google::Cloud.configure.credentials ||
|
|
152
|
-
Google::Cloud::Translate::V2::Credentials.default(scope: scope)
|
|
162
|
+
Google::Cloud::Translate::V2::Credentials.default({ scope: scope, enable_self_signed_jwt: enable_self_signed_jwt })
|
|
153
163
|
end
|
|
154
164
|
|
|
155
165
|
##
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-cloud-translate-v2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Google LLC
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: faraday
|
|
@@ -130,7 +129,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
|
|
|
130
129
|
licenses:
|
|
131
130
|
- Apache-2.0
|
|
132
131
|
metadata: {}
|
|
133
|
-
post_install_message:
|
|
134
132
|
rdoc_options: []
|
|
135
133
|
require_paths:
|
|
136
134
|
- lib
|
|
@@ -138,15 +136,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
138
136
|
requirements:
|
|
139
137
|
- - ">="
|
|
140
138
|
- !ruby/object:Gem::Version
|
|
141
|
-
version: '2
|
|
139
|
+
version: '3.2'
|
|
142
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
141
|
requirements:
|
|
144
142
|
- - ">="
|
|
145
143
|
- !ruby/object:Gem::Version
|
|
146
144
|
version: '0'
|
|
147
145
|
requirements: []
|
|
148
|
-
rubygems_version: 3.
|
|
149
|
-
signing_key:
|
|
146
|
+
rubygems_version: 3.6.9
|
|
150
147
|
specification_version: 4
|
|
151
148
|
summary: API Client library for Cloud Translation V2 API
|
|
152
149
|
test_files: []
|