google-cloud-firestore 0.21.1 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a0e9fff59882f2965b8f56086b8627ec80d55275535bd889aa5a87c7c0877ff
4
- data.tar.gz: d9e8f986e2fd220cd68179e6c2cd1e3c3795dcd2f45ba6a8c050d255f01bd99f
3
+ metadata.gz: 96192127f7ee4dafde2959f7d1f463fb7fa24ab09055e7764e6f83fd0aeda8be
4
+ data.tar.gz: 4848935ba22ddc1b1cb9a24825a03802651d9dfc206b3d93a71af91b4e06eb8d
5
5
  SHA512:
6
- metadata.gz: 478dc298a9f6fd09b99c297e84c30e615ab7fe1e9ac6b5fa1b9f6eeb5c427719f96714cb3fc0ecb53bfe230c15b80a6b11a885692028bfdff3ed56b4acec49c9
7
- data.tar.gz: 002bd881ad0a3bbe61ed09e69b3395577a63c1e1a8af8584256dc974d609108b047a8de3f2bd08dcd3dba263be48ae9cb31f30f1294d13cb0cf050cbd1970f62
6
+ metadata.gz: 523e76c8d3829de28395b9fffd54dc2cd098e08cbc204836ae6836f85f29028b36721b2f66ebb455e5d1895b9d19c1cd1c23f5aee4fffae0842a9df897ce227b
7
+ data.tar.gz: 5ec65a1d3ecce996ab3a1d344495df11f84e5cce44d1932c1aea44aa877e5acf7a5e4fec9f7661ff6eb9c49a99db7c2d17109d825a0f5ee2959efe9e6bf73b34
data/README.md CHANGED
@@ -18,7 +18,37 @@ steps:
18
18
  $ gem install google-cloud-firestore
19
19
  ```
20
20
 
21
- ### Supported Ruby Versions
21
+ ### Next Steps
22
+ - Read the [Client Library Documentation][] for Google Cloud Firestore API
23
+ to see other available methods on the client.
24
+ - Read the [Google Cloud Firestore API Product documentation][Product Documentation]
25
+ to learn more about the product and see How-to Guides.
26
+ - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
27
+ to see the full list of Cloud APIs that we cover.
28
+
29
+ ## Enabling Logging
30
+
31
+ 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.
32
+
33
+ Configuring a Ruby stdlib logger:
34
+
35
+ ```ruby
36
+ require "logger"
37
+
38
+ module MyLogger
39
+ LOGGER = Logger.new $stderr, level: Logger::WARN
40
+ def logger
41
+ LOGGER
42
+ end
43
+ end
44
+
45
+ # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
46
+ module GRPC
47
+ extend MyLogger
48
+ end
49
+ ```
50
+
51
+ ## Supported Ruby Versions
22
52
 
23
53
  This library is supported on Ruby 2.0+.
24
54
 
@@ -29,13 +59,5 @@ supported by Ruby Core (that is, Ruby versions that are either in normal
29
59
  maintenance or in security maintenance).
30
60
  See https://www.ruby-lang.org/en/downloads/branches/ for further details.
31
61
 
32
- ### Next Steps
33
- - Read the [Client Library Documentation][] for Google Cloud Firestore API
34
- to see other available methods on the client.
35
- - Read the [Google Cloud Firestore API Product documentation][Product Documentation]
36
- to learn more about the product and see How-to Guides.
37
- - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
38
- to see the full list of Cloud APIs that we cover.
39
-
40
62
  [Client Library Documentation]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-firestore/latest/google/firestore/v1beta1
41
63
  [Product Documentation]: https://cloud.google.com/firestore
@@ -40,6 +40,39 @@ module Google
40
40
  # options for connecting in the [Authentication
41
41
  # Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/guides/authentication).
42
42
  #
43
+ # ## Enabling Logging
44
+ #
45
+ # To enable logging for this library, set the logger for the underlying
46
+ # [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The
47
+ # logger that you set may be a Ruby stdlib
48
+ # [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html)
49
+ # as shown below, or a
50
+ # [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
51
+ # that will write logs to [Stackdriver
52
+ # Logging](https://cloud.google.com/logging/). See
53
+ # [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
54
+ # and the gRPC
55
+ # [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb)
56
+ # for additional information.
57
+ #
58
+ # Configuring a Ruby stdlib logger:
59
+ #
60
+ # ```ruby
61
+ # require "logger"
62
+ #
63
+ # module MyLogger
64
+ # LOGGER = Logger.new $stderr, level: Logger::WARN
65
+ # def logger
66
+ # LOGGER
67
+ # end
68
+ # end
69
+ #
70
+ # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
71
+ # module GRPC
72
+ # extend MyLogger
73
+ # end
74
+ # ```
75
+ #
43
76
  # ## Adding data
44
77
  #
45
78
  # Cloud Firestore stores data in Documents, which are stored in Collections.
@@ -70,7 +70,7 @@ module Google
70
70
  when :string_value
71
71
  value.string_value
72
72
  when :bytes_value
73
- StringIO.new Base64.decode64 value.bytes_value
73
+ StringIO.new value.bytes_value
74
74
  when :reference_value
75
75
  Google::Cloud::Firestore::DocumentReference.from_path \
76
76
  value.reference_value, context
@@ -115,8 +115,7 @@ module Google
115
115
  elsif obj.respond_to?(:read) && obj.respond_to?(:rewind)
116
116
  obj.rewind
117
117
  content = obj.read.force_encoding "ASCII-8BIT"
118
- encoded_content = Base64.strict_encode64 content
119
- Google::Firestore::V1beta1::Value.new bytes_value: encoded_content
118
+ Google::Firestore::V1beta1::Value.new bytes_value: content
120
119
  else
121
120
  raise ArgumentError,
122
121
  "A value of type #{obj.class} is not supported."
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Firestore
19
- VERSION = "0.21.1".freeze
19
+ VERSION = "0.22.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-firestore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-24 00:00:00.000000000 Z
11
+ date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core