google-cloud-translate 3.7.3 → 3.8.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/MIGRATING.md +9 -2
- data/lib/google/cloud/translate/helpers.rb +11 -3
- data/lib/google/cloud/translate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fa03e55904f5c90e23c690ea205cdd273bd77fab300efb87781f86f28d5feac1
|
|
4
|
+
data.tar.gz: e01ecde9b386c407b3db1bfa67adccf731447b2b2a4d77bbc666661c76f98407
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca08c0a7467a31503d18fe4650ed284327ca4cdfd37ce7aff920f67cb666215cb75a0aa7f8c3e6b4be0ffed84adc88c783a2f9153e84d8a15a2e3f3cf2b04959
|
|
7
|
+
data.tar.gz: c395919b7a97050451d127498d728aa03a0790f63a841006521970326ccc4cfc88a5ce5b4338d92c712f2160bf0138b48cfc83c7a96aff98b417d86598fa2786
|
data/MIGRATING.md
CHANGED
|
@@ -88,11 +88,18 @@ client = Google::Cloud::Translate.new version: :v2,
|
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
New (V3):
|
|
91
|
-
```
|
|
91
|
+
```ruby
|
|
92
|
+
require "googleauth"
|
|
93
|
+
require "google/cloud/translate"
|
|
94
|
+
|
|
95
|
+
credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
|
|
96
|
+
json_key_io: ::File.open("/path/to/keyfile.json")
|
|
97
|
+
)
|
|
98
|
+
|
|
92
99
|
# Call the translation_service method to create a V3 client,
|
|
93
100
|
# and pass a block to configure the client.
|
|
94
101
|
client = Google::Cloud::Translate.translation_service do |config|
|
|
95
|
-
config.credentials =
|
|
102
|
+
config.credentials = credentials
|
|
96
103
|
end
|
|
97
104
|
|
|
98
105
|
# You can omit the block if you're keeping the default configuration
|
|
@@ -29,8 +29,11 @@ module Google
|
|
|
29
29
|
#
|
|
30
30
|
# @param [String] project_id Project identifier for the Cloud Translation service you are connecting to. If not
|
|
31
31
|
# present, the default project for the credentials is used.
|
|
32
|
-
# @param [
|
|
33
|
-
#
|
|
32
|
+
# @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
|
|
33
|
+
# object.
|
|
34
|
+
# @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
|
|
35
|
+
# is deprecated. Providing an unvalidated credential configuration to
|
|
36
|
+
# Google APIs can compromise the security of your systems and data.
|
|
34
37
|
# @param [String] key a public API access key (not an OAuth 2.0 token)
|
|
35
38
|
# @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the set of resources and operations that
|
|
36
39
|
# the connection can access. See [Using OAuth 2.0 to Access Google
|
|
@@ -48,12 +51,17 @@ module Google
|
|
|
48
51
|
# @return [Google::Cloud::Translate::V2::Api]
|
|
49
52
|
#
|
|
50
53
|
# @example
|
|
54
|
+
# require "googleauth"
|
|
51
55
|
# require "google/cloud/translate/v2"
|
|
52
56
|
#
|
|
57
|
+
# credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
|
|
58
|
+
# json_key_io: ::File.open("/path/to/keyfile.json")
|
|
59
|
+
# )
|
|
60
|
+
#
|
|
53
61
|
# translate = Google::Cloud::Translate::V2.new(
|
|
54
62
|
# version: :v2,
|
|
55
63
|
# project_id: "my-todo-project",
|
|
56
|
-
# credentials:
|
|
64
|
+
# credentials: credentials
|
|
57
65
|
# )
|
|
58
66
|
#
|
|
59
67
|
# translation = translate.translate "Hello world!", to: "la"
|
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: 3.
|
|
4
|
+
version: 3.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Google LLC
|
|
@@ -91,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
91
91
|
requirements:
|
|
92
92
|
- - ">="
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
|
-
version: '3.
|
|
94
|
+
version: '3.2'
|
|
95
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
requirements:
|
|
97
97
|
- - ">="
|