google-cloud-debugger 0.33.1 → 0.33.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28eb0ba3938e8fdf591b9ffa1c53f66fe21005e096f27194f984c951c8c59544
4
- data.tar.gz: 3726320cdb33ef63c2d096a6096f52c9ebad9cf018759e743c2d8ceec76c0893
3
+ metadata.gz: 9003d275442e4a4c3899688e66577856a6642fb4bb6463918e0c223ee81a5b15
4
+ data.tar.gz: 3f00c92ab295af42cf1ba08255a447c74bb61f32d71eda4625d96fda86b483cd
5
5
  SHA512:
6
- metadata.gz: 2e59a8c15c75555308c0ceaa6b2f191650b3ca87091ccae50c0595ca206e7ad64f925539bc39fa9e687c0055d6de664c07220db73b6e85ac60de02ce5b3a5b52
7
- data.tar.gz: c5f87c78fade091d092d6348d3d47a5f6da2f11355c26e15f84e40d93d0e026b99f10124bf7c8f2cb263329e248a7beb7328646187a556ee137796a9305e8c84
6
+ metadata.gz: 0f49a670cbed7af70e6f10ea70a9fba1bff60962d94b93742500c3a1dee04ffcb5fbd266541e23b3f000328a7e41cce66666798fb1f0c79a23158af7ee114a80
7
+ data.tar.gz: ce38de51d533e8265736dd0501d93bf4ed37d6f06116385350d45e3efc55f3dd37b04da23ab41919ec87d09d28b940ea6d4a1bad7fd1b952ac9892061250af29
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 0.33.2 / 2019-02-08
4
+
5
+ * Fix conversion code for ErrorEvent and Debugee.
6
+ * Prepare for changes in JSON serialization coming in
7
+ google-protobuf 3.7.
8
+
3
9
  ### 0.33.1 / 2019-02-07
4
10
 
5
11
  * Update concurrent-ruby dependency
@@ -17,7 +23,7 @@
17
23
  This value was added in googleauth 0.7.0.
18
24
  * Loosen googleauth dependency
19
25
  Allow for new releases up to 0.10.
20
- The googleauth devs have committed to maintanining the current API
26
+ The googleauth devs have committed to maintaining the current API
21
27
  and will not make backwards compatible changes before 0.10.
22
28
 
23
29
  ### 0.32.6 / 2018-11-15
@@ -113,35 +113,33 @@ module Google
113
113
  # Convert this debuggee into a gRPC
114
114
  # Google::Devtools::Clouddebugger::V2::Debuggee struct.
115
115
  def to_grpc
116
- debuggee_args = build_request_arg
117
-
118
- Google::Devtools::Clouddebugger::V2::Debuggee.decode_json \
119
- debuggee_args.to_json
116
+ source_context = source_context_from_json_file "source-context.json"
117
+ Google::Devtools::Clouddebugger::V2::Debuggee.new(
118
+ id: id.to_s,
119
+ project: project_id_for_request_arg.to_s,
120
+ description: description.to_s,
121
+ labels: labels,
122
+ agent_version: agent_version.to_s
123
+ ).tap do |d|
124
+ if source_context
125
+ d.source_contexts << source_context
126
+ d.ext_source_contexts << ext_source_context_grpc(source_context)
127
+ end
128
+ d.uniquifier = compute_uniquifier d
129
+ end
120
130
  end
121
131
 
122
132
  private
123
133
 
124
- ##
125
- # @private Build the parameters for this debuggee
126
- def build_request_arg
127
- debuggee_args = {
128
- project: project_id_for_request_arg,
129
- description: description,
130
- labels: labels,
131
- agent_version: agent_version
132
- }
133
-
134
- debuggee_args[:id] = id if id
135
-
136
- source_context = read_app_json_file "source-context.json"
137
- if source_context
138
- debuggee_args[:source_contexts] = [source_context]
139
- debuggee_args[:ext_source_contexts] = [{ context: source_context }]
140
- end
141
-
142
- debuggee_args[:uniquifier] = compute_uniquifier debuggee_args
134
+ def source_context_from_json_file file_path
135
+ json = File.read file_path
136
+ Devtools::Source::V1::SourceContext.decode_json json
137
+ rescue StandardError
138
+ nil
139
+ end
143
140
 
144
- debuggee_args
141
+ def ext_source_context_grpc source_context
142
+ Devtools::Source::V1::SourceContext.new context: source_context
145
143
  end
146
144
 
147
145
  ##
@@ -197,14 +195,14 @@ module Google
197
195
  ##
198
196
  # @private Generate a debuggee uniquifier from source context
199
197
  # information or application source code
200
- def compute_uniquifier debuggee_args
198
+ def compute_uniquifier partial_debuggee
201
199
  return @computed_uniquifier if @computed_uniquifier
202
200
 
203
201
  sha = Digest::SHA1.new
204
- sha << debuggee_args.to_s
202
+ sha << partial_debuggee.to_s
205
203
 
206
- unless debuggee_args.key?(:source_contexts) ||
207
- debuggee_args.key?(:ext_source_contexts)
204
+ if partial_debuggee.source_contexts.empty? &&
205
+ partial_debuggee.ext_source_contexts.empty?
208
206
  AppUniquifierGenerator.generate_app_uniquifier sha
209
207
  end
210
208
 
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Debugger
19
- VERSION = "0.33.1".freeze
19
+ VERSION = "0.33.2".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-debugger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.1
4
+ version: 0.33.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heng Xiong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-07 00:00:00.000000000 Z
11
+ date: 2019-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller