google-cloud-translate 1.2.0 → 1.2.1
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/.yardopts +1 -0
- data/README.md +30 -1
- data/lib/google/cloud/translate.rb +33 -0
- data/lib/google/cloud/translate/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 255d2fe2c7ab9d9324f2b2c0b71b69a68f3e11abd5ce2f1866a189098ff4fd0c
|
|
4
|
+
data.tar.gz: adbeb37379bab6faae3b0e7fff4a9ceff972e7f38f98c398937fcbba35eb964f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 519126ed69768a715327ccb20e6fb2c8d574155010f9cbf5c12584f23977ffc822ceab954cd8ffc51c3b3236421cdf03dbb426ffcd98821c522b78b45c6ec8eb
|
|
7
|
+
data.tar.gz: b39dec563bbe53682c7493792b869eaa9dfb9b09ddd8fcd1901f67047e451fee529935af8a0404637bc4ad3e3278735a25cc6c6a47033f272b143ada9fadf02c
|
data/.yardopts
CHANGED
data/README.md
CHANGED
|
@@ -40,9 +40,38 @@ translation.to #=> "la"
|
|
|
40
40
|
translation.text #=> "Salve mundi!"
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
## Enabling Logging
|
|
44
|
+
|
|
45
|
+
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below, or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger) that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
|
46
|
+
|
|
47
|
+
Configuring a Ruby stdlib logger:
|
|
48
|
+
|
|
49
|
+
```ruby
|
|
50
|
+
require "logger"
|
|
51
|
+
|
|
52
|
+
module MyLogger
|
|
53
|
+
LOGGER = Logger.new $stderr, level: Logger::WARN
|
|
54
|
+
def logger
|
|
55
|
+
LOGGER
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
|
60
|
+
module GRPC
|
|
61
|
+
extend MyLogger
|
|
62
|
+
end
|
|
63
|
+
```
|
|
64
|
+
|
|
43
65
|
## Supported Ruby Versions
|
|
44
66
|
|
|
45
|
-
This library is supported on Ruby 2.
|
|
67
|
+
This library is supported on Ruby 2.3+.
|
|
68
|
+
|
|
69
|
+
Google provides official support for Ruby versions that are actively supported
|
|
70
|
+
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
|
71
|
+
in security maintenance, and not end of life. Currently, this means Ruby 2.3
|
|
72
|
+
and later. Older versions of Ruby _may_ still work, but are unsupported and not
|
|
73
|
+
recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
|
|
74
|
+
about the Ruby support schedule.
|
|
46
75
|
|
|
47
76
|
## Versioning
|
|
48
77
|
|
|
@@ -45,6 +45,39 @@ module Google
|
|
|
45
45
|
# will be used.) Instructions and configuration options are covered in the
|
|
46
46
|
# [Authentication Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-translate/guides/authentication).
|
|
47
47
|
#
|
|
48
|
+
# ## Enabling Logging
|
|
49
|
+
#
|
|
50
|
+
# To enable logging for this library, set the logger for the underlying
|
|
51
|
+
# [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The
|
|
52
|
+
# logger that you set may be a Ruby stdlib
|
|
53
|
+
# [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html)
|
|
54
|
+
# as shown below, or a
|
|
55
|
+
# [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
|
|
56
|
+
# that will write logs to [Stackdriver
|
|
57
|
+
# Logging](https://cloud.google.com/logging/). See
|
|
58
|
+
# [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
|
59
|
+
# and the gRPC
|
|
60
|
+
# [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb)
|
|
61
|
+
# for additional information.
|
|
62
|
+
#
|
|
63
|
+
# Configuring a Ruby stdlib logger:
|
|
64
|
+
#
|
|
65
|
+
# ```ruby
|
|
66
|
+
# require "logger"
|
|
67
|
+
#
|
|
68
|
+
# module MyLogger
|
|
69
|
+
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
|
70
|
+
# def logger
|
|
71
|
+
# LOGGER
|
|
72
|
+
# end
|
|
73
|
+
# end
|
|
74
|
+
#
|
|
75
|
+
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
|
76
|
+
# module GRPC
|
|
77
|
+
# extend MyLogger
|
|
78
|
+
# end
|
|
79
|
+
# ```
|
|
80
|
+
#
|
|
48
81
|
# ## Translating texts
|
|
49
82
|
#
|
|
50
83
|
# Translating text from one language to another is easy (and extremely
|
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.2.
|
|
4
|
+
version: 1.2.1
|
|
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: 2018-
|
|
12
|
+
date: 2018-08-21 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: google-cloud-core
|
|
@@ -123,6 +123,20 @@ dependencies:
|
|
|
123
123
|
- - "~>"
|
|
124
124
|
- !ruby/object:Gem::Version
|
|
125
125
|
version: '1.1'
|
|
126
|
+
- !ruby/object:Gem::Dependency
|
|
127
|
+
name: redcarpet
|
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
|
129
|
+
requirements:
|
|
130
|
+
- - "~>"
|
|
131
|
+
- !ruby/object:Gem::Version
|
|
132
|
+
version: '3.0'
|
|
133
|
+
type: :development
|
|
134
|
+
prerelease: false
|
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
136
|
+
requirements:
|
|
137
|
+
- - "~>"
|
|
138
|
+
- !ruby/object:Gem::Version
|
|
139
|
+
version: '3.0'
|
|
126
140
|
- !ruby/object:Gem::Dependency
|
|
127
141
|
name: rubocop
|
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -220,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
220
234
|
version: '0'
|
|
221
235
|
requirements: []
|
|
222
236
|
rubyforge_project:
|
|
223
|
-
rubygems_version: 2.7.
|
|
237
|
+
rubygems_version: 2.7.7
|
|
224
238
|
signing_key:
|
|
225
239
|
specification_version: 4
|
|
226
240
|
summary: API Client library for Google Cloud Translation API
|