google-cloud-translate 3.2.3 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +6 -32
- data/lib/google/cloud/translate/version.rb +1 -1
- data/lib/google/cloud/translate.rb +11 -7
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51bd5e653d4c3476abd9267064934779ee1caf3f876f5cfa5cbd5baa1c4fad85
|
4
|
+
data.tar.gz: 4ebce7145427b27b4aef6cdfb5c32de11aa2092682b822dc339f6d69789fa6a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97ac9b8093beb217efde9ffc21d5a22b75698eb88a09a38b9e74923220c6e4571c3d4cb8578e1ce24f2c2ee2ce90f3ac0ea0355c16d7ba94afb2529b9896fe40
|
7
|
+
data.tar.gz: 9f327d21918ae9ba7594d0d0c61f144c4192c5c5aa487dc3504cb625bcfe53f66d32ed6ea8a922930fb3f0a55cd3fe498e958b06cbd1bb0ef518f72a9cdfabcc
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ verisoned gems in as dependencies, and provides high-level methods for
|
|
11
11
|
constructing clients. More information on versioned clients can be found below
|
12
12
|
in the section titled *Which client should I use?*.
|
13
13
|
|
14
|
-
View the [Client Library Documentation](https://
|
14
|
+
View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-translate/latest)
|
15
15
|
for this library, google-cloud-translate, to see the convenience methods for
|
16
16
|
constructing client objects. Reference documentation for the client objects
|
17
17
|
themselves can be found in the client library documentation for the versioned
|
@@ -43,42 +43,16 @@ and includes substantial interface changes. Existing code written for earlier
|
|
43
43
|
versions of this library will likely require updates to use this version.
|
44
44
|
See the {file:MIGRATING.md MIGRATING.md} document for more information.
|
45
45
|
|
46
|
-
## Enabling Logging
|
47
|
-
|
48
|
-
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
50
|
-
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
51
|
-
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
52
|
-
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
53
|
-
|
54
|
-
Configuring a Ruby stdlib logger:
|
55
|
-
|
56
|
-
```ruby
|
57
|
-
require "logger"
|
58
|
-
|
59
|
-
module MyLogger
|
60
|
-
LOGGER = Logger.new $stderr, level: Logger::WARN
|
61
|
-
def logger
|
62
|
-
LOGGER
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
67
|
-
module GRPC
|
68
|
-
extend MyLogger
|
69
|
-
end
|
70
|
-
```
|
71
|
-
|
72
46
|
## Supported Ruby Versions
|
73
47
|
|
74
|
-
This library is supported on Ruby 2.
|
48
|
+
This library is supported on Ruby 2.6+.
|
75
49
|
|
76
50
|
Google provides official support for Ruby versions that are actively supported
|
77
51
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
78
|
-
in security maintenance, and not end of life.
|
79
|
-
|
80
|
-
|
81
|
-
|
52
|
+
in security maintenance, and not end of life. Older versions of Ruby _may_
|
53
|
+
still work, but are unsupported and not recommended. See
|
54
|
+
https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
|
55
|
+
support schedule.
|
82
56
|
|
83
57
|
## Which client should I use?
|
84
58
|
|
@@ -49,11 +49,13 @@ module Google
|
|
49
49
|
#
|
50
50
|
# By default, this returns an instance of
|
51
51
|
# [Google::Cloud::Translate::V3::TranslationService::Client](https://googleapis.dev/ruby/google-cloud-translate-v3/latest/Google/Cloud/Translate/V3/TranslationService/Client.html)
|
52
|
-
# for version V3 of the API.
|
53
|
-
# However, you can specify
|
52
|
+
# for a gRPC client for version V3 of the API.
|
53
|
+
# However, you can specify a different API version by passing it in the
|
54
54
|
# `version` parameter. If the TranslationService service is
|
55
55
|
# supported by that API version, and the corresponding gem is available, the
|
56
56
|
# appropriate versioned client will be returned.
|
57
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
58
|
+
# the `transport` parameter.
|
57
59
|
#
|
58
60
|
# ## About TranslationService
|
59
61
|
#
|
@@ -61,17 +63,19 @@ module Google
|
|
61
63
|
#
|
62
64
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
63
65
|
# Defaults to `:v3`.
|
64
|
-
# @
|
66
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
67
|
+
# @return [::Object] A client object for the specified version.
|
65
68
|
#
|
66
|
-
def self.translation_service version: :v3, &block
|
69
|
+
def self.translation_service version: :v3, transport: :grpc, &block
|
67
70
|
require "google/cloud/translate/#{version.to_s.downcase}"
|
68
71
|
|
69
72
|
package_name = Google::Cloud::Translate
|
70
73
|
.constants
|
71
74
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
72
75
|
.first
|
73
|
-
|
74
|
-
|
76
|
+
service_module = Google::Cloud::Translate.const_get(package_name).const_get(:TranslationService)
|
77
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
78
|
+
service_module.const_get(:Client).new(&block)
|
75
79
|
end
|
76
80
|
|
77
81
|
##
|
@@ -91,7 +95,7 @@ module Google
|
|
91
95
|
# * `timeout` (*type:* `Numeric`) -
|
92
96
|
# Default timeout in seconds.
|
93
97
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
94
|
-
# Additional
|
98
|
+
# Additional headers to be sent with the call.
|
95
99
|
# * `retry_policy` (*type:* `Hash`) -
|
96
100
|
# The retry policy. The value is a hash with the following keys:
|
97
101
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.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: 2023-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
53
|
+
version: '0.6'
|
54
54
|
- - "<"
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: 2.a
|
@@ -60,7 +60,7 @@ dependencies:
|
|
60
60
|
requirements:
|
61
61
|
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '0.
|
63
|
+
version: '0.6'
|
64
64
|
- - "<"
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: 2.a
|
@@ -70,28 +70,28 @@ dependencies:
|
|
70
70
|
requirements:
|
71
71
|
- - "~>"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: 1.
|
73
|
+
version: 1.26.1
|
74
74
|
type: :development
|
75
75
|
prerelease: false
|
76
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
78
|
- - "~>"
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: 1.
|
80
|
+
version: 1.26.1
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: minitest
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '5.
|
87
|
+
version: '5.16'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
92
|
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: '5.
|
94
|
+
version: '5.16'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: minitest-focus
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,14 +126,14 @@ dependencies:
|
|
126
126
|
requirements:
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: '
|
129
|
+
version: '13.0'
|
130
130
|
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
134
|
- - ">="
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: '
|
136
|
+
version: '13.0'
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: redcarpet
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,14 +205,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
205
205
|
requirements:
|
206
206
|
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: '2.
|
208
|
+
version: '2.6'
|
209
209
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
210
210
|
requirements:
|
211
211
|
- - ">="
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: '0'
|
214
214
|
requirements: []
|
215
|
-
rubygems_version: 3.
|
215
|
+
rubygems_version: 3.4.2
|
216
216
|
signing_key:
|
217
217
|
specification_version: 4
|
218
218
|
summary: API Client library for the Cloud Translation API
|