google-cloud-speech 1.1.0 → 1.1.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/MIGRATING.md +60 -0
- data/lib/google/cloud/speech/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: 739b2fc36b5ef0e935a5aba33a9b9514f6c977f6612ad645bb10284ce6031144
|
4
|
+
data.tar.gz: 9aea715a82dec588f3c92bfd8cd372267caf77da276a138e06dcde9f7c046ed1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b7e8a0c5332a6a12cab3fcf5276d703b44369b8085cd4ee84fc31ce015b87e16534f25845e2062dd7ceb9d8759c7485d0b90aa915950140fc4bdd0a3969e7e0
|
7
|
+
data.tar.gz: deeb990df0900e437ec5bdaf59a4f76fd462cb9129a0830a5b7a6cbf94f805c21788770fa143e61ff50d05f231e9ba9bada466b10184dbdd536f33d357c94743
|
data/MIGRATING.md
CHANGED
@@ -30,6 +30,10 @@ To summarize:
|
|
30
30
|
current client retains this method, but simplifies the interface to match
|
31
31
|
streaming methods in other Ruby clients. See
|
32
32
|
[Streaming Interface](#streaming-interface) for more info.
|
33
|
+
* Previously, clients reported RPC errors by raising instances of
|
34
|
+
`Google::Gax::GaxError` and its subclasses. Now, RPC exceptions are of type
|
35
|
+
`Google::Cloud::Error` and its subclasses. See
|
36
|
+
[Handling Errors](#handling-errors) for more info.
|
33
37
|
* Some classes have moved into different namespaces. See
|
34
38
|
[Class Namespaces](#class-namespaces) for more info.
|
35
39
|
|
@@ -288,6 +292,62 @@ output_stream.each do |response|
|
|
288
292
|
end
|
289
293
|
```
|
290
294
|
|
295
|
+
### Handling Errors
|
296
|
+
|
297
|
+
The client reports standard
|
298
|
+
[gRPC error codes](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)
|
299
|
+
by raising exceptions. In older releases, these exceptions were located in the
|
300
|
+
`Google::Gax` namespace and were subclasses of the `Google::Gax::GaxError` base
|
301
|
+
exception class, defined in the `google-gax` gem. However, these classes were
|
302
|
+
different from the standard exceptions (subclasses of `Google::Cloud::Error`)
|
303
|
+
thrown by other client libraries such as `google-cloud-storage`.
|
304
|
+
|
305
|
+
The 1.0 client library now uses the `Google::Cloud::Error` exception hierarchy,
|
306
|
+
for consistency across all the Google Cloud client libraries. In general, these
|
307
|
+
exceptions have the same name as their counterparts from older releases, but
|
308
|
+
are located in the `Google::Cloud` namespace rather than the `Google::Gax`
|
309
|
+
namespace.
|
310
|
+
|
311
|
+
Old:
|
312
|
+
```
|
313
|
+
client = Google::Cloud::Speech.new
|
314
|
+
|
315
|
+
config = {
|
316
|
+
language_code: "en-US",
|
317
|
+
sample_rate_hertz: 44_100,
|
318
|
+
encoding: :FLAC
|
319
|
+
}
|
320
|
+
audio = {
|
321
|
+
uri: "gs://cloud-samples-data/speech/brooklyn_bridge.flac"
|
322
|
+
}
|
323
|
+
|
324
|
+
begin
|
325
|
+
response = client.recognize config, audio
|
326
|
+
rescue Google::Gax::Error => e
|
327
|
+
# Handle exceptions that subclass Google::Gax::Error
|
328
|
+
end
|
329
|
+
```
|
330
|
+
|
331
|
+
New:
|
332
|
+
```
|
333
|
+
client = Google::Cloud::Speech.speech
|
334
|
+
|
335
|
+
config = {
|
336
|
+
language_code: "en-US",
|
337
|
+
sample_rate_hertz: 44_100,
|
338
|
+
encoding: :FLAC
|
339
|
+
}
|
340
|
+
audio = {
|
341
|
+
uri: "gs://cloud-samples-data/speech/brooklyn_bridge.flac"
|
342
|
+
}
|
343
|
+
|
344
|
+
begin
|
345
|
+
response = client.recognize config: config, audio: audio
|
346
|
+
rescue Google::Cloud::Error => e
|
347
|
+
# Handle exceptions that subclass Google::Cloud::Error
|
348
|
+
end
|
349
|
+
```
|
350
|
+
|
291
351
|
### Class Namespaces
|
292
352
|
|
293
353
|
In older releases, the client object was of classes with names like:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-speech
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|