google-cloud-logging 0.23.2 → 0.24.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
  SHA1:
3
- metadata.gz: bb8784e1fbc741309311311b15651df19b532754
4
- data.tar.gz: 0f1b0d5083403e2b1b9fd33835bafede49994afd
3
+ metadata.gz: b21d81a8dd0345896f6d8614d0fe7cdfe13eb1d4
4
+ data.tar.gz: 376e833691d63e7f868b959c21ac8907ea872d4a
5
5
  SHA512:
6
- metadata.gz: c86a24215d51b9187724572be6f508ae5456f43338e64cde425eef115128763929ba67a7db2bca6eb16a8af8f4ea96e8be2b6acb395cc27f826d840400e946a9
7
- data.tar.gz: aadb70bbe1c9e72728feb947dad30bee4713fe9ac2173d98e9bda4ddd086e7c7c390ac26205588bf7e06abed0d41af52444d0310dc4674565d48977d510e4e59
6
+ metadata.gz: 7c76269efa35b6ac9dcb63e9020bde529907a0c01b894016e9c315dea259d30eae2310b1e402b4f77175898ae9b38aa0139ec92d82bf2c5d966d46d28fc3c83e
7
+ data.tar.gz: 44157406a87996ac911cc0b1fb22a1e41d2ba9aa06b8ed642c015b4cc8aa22dbfb3752b7299c8146b87522f00d94b20e44620b8e0ab4b2a19d011222ddd96f08
data/.yardopts CHANGED
@@ -1,5 +1,6 @@
1
1
  --no-private
2
2
  --title=Stackdriver Logging
3
+ --exclude lib/google/logging/v2
3
4
  --markup markdown
4
5
 
5
6
  ./lib/**/*.rb
@@ -0,0 +1,64 @@
1
+ # Copyright 2017 Google Inc. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ module Google
17
+ module Cloud
18
+ module Logging
19
+ ##
20
+ # @private Conversion to/from Logging GRPC objects.
21
+ module Convert
22
+ ##
23
+ # @private Convert a Hash to a Google::Protobuf::Struct.
24
+ def self.hash_to_struct hash
25
+ # TODO: ArgumentError if hash is not a Hash
26
+ Google::Protobuf::Struct.new fields:
27
+ Hash[hash.map { |k, v| [String(k), object_to_value(v)] }]
28
+ end
29
+
30
+ ##
31
+ # @private Convert an Object to a Google::Protobuf::Value.
32
+ def self.object_to_value obj
33
+ case obj
34
+ when NilClass then Google::Protobuf::Value.new null_value:
35
+ :NULL_VALUE
36
+ when Numeric then Google::Protobuf::Value.new number_value: obj
37
+ when String then Google::Protobuf::Value.new string_value: obj
38
+ when TrueClass then Google::Protobuf::Value.new bool_value: true
39
+ when FalseClass then Google::Protobuf::Value.new bool_value: false
40
+ when Hash then Google::Protobuf::Value.new struct_value:
41
+ hash_to_struct(obj)
42
+ when Array then Google::Protobuf::Value.new list_value:
43
+ Google::Protobuf::ListValue.new(values:
44
+ obj.map { |o| object_to_value(o) })
45
+ else
46
+ # TODO: Could raise ArgumentError here, or convert to a string
47
+ Google::Protobuf::Value.new string_value: obj.to_s
48
+ end
49
+ end
50
+
51
+ ##
52
+ # @private Convert a Google::Protobuf::Map to a Hash
53
+ def self.map_to_hash map
54
+ if map.respond_to? :to_h
55
+ map.to_h
56
+ else
57
+ # Enumerable doesn't have to_h on ruby 2.0...
58
+ Hash[map.to_a]
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -13,7 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
 
16
- require "google/cloud/core/grpc_utils"
16
+ require "google/cloud/logging/convert"
17
17
  require "google/cloud/logging/resource"
18
18
  require "google/cloud/logging/entry/http_request"
19
19
  require "google/cloud/logging/entry/operation"
@@ -390,7 +390,7 @@ module Google
390
390
  e.timestamp = extract_timestamp(grpc)
391
391
  e.severity = grpc.severity
392
392
  e.insert_id = grpc.insert_id
393
- e.labels = Core::GRPCUtils.map_to_hash(grpc.labels)
393
+ e.labels = Convert.map_to_hash(grpc.labels)
394
394
  e.payload = extract_payload(grpc)
395
395
  e.instance_variable_set "@resource",
396
396
  Resource.from_grpc(grpc.resource)
@@ -435,7 +435,7 @@ module Google
435
435
  if payload.is_a? Google::Protobuf::Any
436
436
  grpc.proto_payload = payload
437
437
  elsif payload.respond_to? :to_hash
438
- grpc.json_payload = Core::GRPCUtils.hash_to_struct payload.to_hash
438
+ grpc.json_payload = Convert.hash_to_struct payload.to_hash
439
439
  else
440
440
  grpc.text_payload = payload.to_s
441
441
  end
@@ -76,7 +76,7 @@ module Google
76
76
  return new if grpc.nil?
77
77
  new.tap do |r|
78
78
  r.type = grpc.type
79
- r.labels = Core::GRPCUtils.map_to_hash(grpc.labels)
79
+ r.labels = Convert.map_to_hash(grpc.labels)
80
80
  end
81
81
  end
82
82
  end
@@ -2,13 +2,11 @@
2
2
  "interfaces": {
3
3
  "google.logging.v2.ConfigServiceV2": {
4
4
  "retry_codes": {
5
- "retry_codes_def": {
6
5
  "idempotent": [
7
6
  "DEADLINE_EXCEEDED",
8
7
  "UNAVAILABLE"
9
8
  ],
10
9
  "non_idempotent": []
11
- }
12
10
  },
13
11
  "retry_params": {
14
12
  "default": {
@@ -2,13 +2,11 @@
2
2
  "interfaces": {
3
3
  "google.logging.v2.LoggingServiceV2": {
4
4
  "retry_codes": {
5
- "retry_codes_def": {
6
5
  "idempotent": [
7
6
  "DEADLINE_EXCEEDED",
8
7
  "UNAVAILABLE"
9
8
  ],
10
9
  "non_idempotent": []
11
- }
12
10
  },
13
11
  "retry_params": {
14
12
  "default": {
@@ -2,13 +2,11 @@
2
2
  "interfaces": {
3
3
  "google.logging.v2.MetricsServiceV2": {
4
4
  "retry_codes": {
5
- "retry_codes_def": {
6
5
  "idempotent": [
7
6
  "DEADLINE_EXCEEDED",
8
7
  "UNAVAILABLE"
9
8
  ],
10
9
  "non_idempotent": []
11
- }
12
10
  },
13
11
  "retry_params": {
14
12
  "default": {
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Logging
19
- VERSION = "0.23.2"
19
+ VERSION = "0.24.0"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.2
4
+ version: 0.24.0
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: 2016-12-27 00:00:00.000000000 Z
12
+ date: 2017-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -26,61 +26,33 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  version: 0.21.1
28
28
  - !ruby/object:Gem::Dependency
29
- name: grpc
29
+ name: stackdriver-core
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '1.0'
34
+ version: 0.21.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '1.0'
41
+ version: 0.21.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: google-gax
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 0.6.0
48
+ version: 0.8.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 0.6.0
56
- - !ruby/object:Gem::Dependency
57
- name: google-protobuf
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: '3.0'
63
- type: :runtime
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '3.0'
70
- - !ruby/object:Gem::Dependency
71
- name: googleapis-common-protos
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '1.3'
77
- type: :runtime
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '1.3'
55
+ version: 0.8.0
84
56
  - !ruby/object:Gem::Dependency
85
57
  name: orderedhash
86
58
  requirement: !ruby/object:Gem::Requirement
@@ -95,34 +67,20 @@ dependencies:
95
67
  - - '='
96
68
  - !ruby/object:Gem::Version
97
69
  version: 0.0.6
98
- - !ruby/object:Gem::Dependency
99
- name: stackdriver-core
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - "~>"
103
- - !ruby/object:Gem::Version
104
- version: 0.21.0
105
- type: :runtime
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - "~>"
110
- - !ruby/object:Gem::Version
111
- version: 0.21.0
112
70
  - !ruby/object:Gem::Dependency
113
71
  name: minitest
114
72
  requirement: !ruby/object:Gem::Requirement
115
73
  requirements:
116
74
  - - "~>"
117
75
  - !ruby/object:Gem::Version
118
- version: '5.9'
76
+ version: '5.10'
119
77
  type: :development
120
78
  prerelease: false
121
79
  version_requirements: !ruby/object:Gem::Requirement
122
80
  requirements:
123
81
  - - "~>"
124
82
  - !ruby/object:Gem::Version
125
- version: '5.9'
83
+ version: '5.10'
126
84
  - !ruby/object:Gem::Dependency
127
85
  name: minitest-autotest
128
86
  requirement: !ruby/object:Gem::Requirement
@@ -225,14 +183,14 @@ dependencies:
225
183
  name: yard-doctest
226
184
  requirement: !ruby/object:Gem::Requirement
227
185
  requirements:
228
- - - "~>"
186
+ - - "<="
229
187
  - !ruby/object:Gem::Version
230
188
  version: 0.1.8
231
189
  type: :development
232
190
  prerelease: false
233
191
  version_requirements: !ruby/object:Gem::Requirement
234
192
  requirements:
235
- - - "~>"
193
+ - - "<="
236
194
  - !ruby/object:Gem::Version
237
195
  version: 0.1.8
238
196
  - !ruby/object:Gem::Dependency
@@ -277,6 +235,7 @@ files:
277
235
  - lib/google-cloud-logging.rb
278
236
  - lib/google/cloud/logging.rb
279
237
  - lib/google/cloud/logging/async_writer.rb
238
+ - lib/google/cloud/logging/convert.rb
280
239
  - lib/google/cloud/logging/credentials.rb
281
240
  - lib/google/cloud/logging/entry.rb
282
241
  - lib/google/cloud/logging/entry/http_request.rb
@@ -339,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
298
  version: '0'
340
299
  requirements: []
341
300
  rubyforge_project:
342
- rubygems_version: 2.6.8
301
+ rubygems_version: 2.6.10
343
302
  signing_key:
344
303
  specification_version: 4
345
304
  summary: API Client library for Stackdriver Logging