protobuf 3.6.6 → 3.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/protobuf/field/base_field.rb +0 -2
- data/lib/protobuf/field/bytes_field.rb +0 -1
- data/lib/protobuf/field/enum_field.rb +0 -1
- data/lib/protobuf/field/message_field.rb +0 -1
- data/lib/protobuf/message/serialization.rb +4 -6
- data/lib/protobuf/version.rb +1 -1
- data/spec/lib/protobuf/message_spec.rb +0 -58
- metadata +142 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3cf62f23b61199ad1d1767568d1dcfe5a5c5517
|
4
|
+
data.tar.gz: 5becc07ad7520bb37422240800156809b4081371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e970d0602dde01c897b47c312d81f85f8a9defa6227fdf7b5e9b162d2cfc693124b7d6b9fb79a07fbaeab99e59e9783f4b632c5ba610e59e7640d53d94144f7a
|
7
|
+
data.tar.gz: a83cf1545c8dd56238bcf22f96407ed618a97e0532facad53b4bbd38869e413dd68bfa3e167e989dae6dcaf55dfed59c36822be40121600455496fc3a02c0fe3
|
@@ -198,7 +198,6 @@ module Protobuf
|
|
198
198
|
|
199
199
|
message_class.class_eval do
|
200
200
|
define_method(method_name) do |val|
|
201
|
-
@encode = nil
|
202
201
|
if val.is_a?(Array)
|
203
202
|
val = val.dup
|
204
203
|
val.compact!
|
@@ -240,7 +239,6 @@ module Protobuf
|
|
240
239
|
|
241
240
|
message_class.class_eval do
|
242
241
|
define_method(method_name) do |val|
|
243
|
-
@encode = nil
|
244
242
|
if val.nil? || (val.respond_to?(:empty?) && val.empty?)
|
245
243
|
@values.delete(field.name)
|
246
244
|
elsif field.acceptable?(val)
|
@@ -48,12 +48,10 @@ module Protobuf
|
|
48
48
|
# Encode this message
|
49
49
|
#
|
50
50
|
def encode
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
stream.string
|
56
|
-
end
|
51
|
+
stream = ::StringIO.new
|
52
|
+
stream.set_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING)
|
53
|
+
encode_to(stream)
|
54
|
+
stream.string
|
57
55
|
end
|
58
56
|
|
59
57
|
# Encode this message to the given stream.
|
data/lib/protobuf/version.rb
CHANGED
@@ -268,64 +268,6 @@ RSpec.describe Protobuf::Message do
|
|
268
268
|
end
|
269
269
|
end
|
270
270
|
|
271
|
-
describe 'memoization' do
|
272
|
-
it "should memoize enum message" do
|
273
|
-
test_enum = Test::EnumTestMessage.new
|
274
|
-
test_enum.encode
|
275
|
-
expect(test_enum.instance_variable_get(:@encode)).to eq("")
|
276
|
-
test_enum.non_default_enum = 2
|
277
|
-
expect(test_enum.instance_variable_get(:@encode)).to be_nil
|
278
|
-
end
|
279
|
-
|
280
|
-
context "boolean fields" do
|
281
|
-
let(:values) { { :ext_is_searchable => true, :name => "STEPH CURRY" } }
|
282
|
-
let(:test_resource) { ::Test::Resource.new(values) }
|
283
|
-
|
284
|
-
it "should memoize after bool values change " do
|
285
|
-
test_resource.encode
|
286
|
-
expect(test_resource.instance_variable_get(:@encode)).to eq(test_resource.encode)
|
287
|
-
test_resource.ext_is_searchable = false
|
288
|
-
expect(test_resource.instance_variable_get(:@encode)).to be_nil
|
289
|
-
end
|
290
|
-
end
|
291
|
-
|
292
|
-
context "string" do
|
293
|
-
let(:values) { { :ext_is_searchable => true, :name => "STEPH CURRY" } }
|
294
|
-
let(:test_resource) { ::Test::Resource.new(values) }
|
295
|
-
|
296
|
-
it "should memoize after bool values change " do
|
297
|
-
test_resource.encode
|
298
|
-
expect(test_resource.instance_variable_get(:@encode)).to eq(test_resource.encode)
|
299
|
-
test_resource.name = "MVP"
|
300
|
-
expect(test_resource.instance_variable_get(:@encode)).to be_nil
|
301
|
-
end
|
302
|
-
end
|
303
|
-
|
304
|
-
context "string" do
|
305
|
-
let(:values) { { :ext_is_searchable => true, :name => "STEPH CURRY" } }
|
306
|
-
let(:test_resource) { ::Test::Resource.new(values) }
|
307
|
-
|
308
|
-
it "should memoize after string values change " do
|
309
|
-
test_resource.encode
|
310
|
-
expect(test_resource.instance_variable_get(:@encode)).to eq(test_resource.encode)
|
311
|
-
test_resource.name = "MVP"
|
312
|
-
expect(test_resource.instance_variable_get(:@encode)).to be_nil
|
313
|
-
end
|
314
|
-
end
|
315
|
-
|
316
|
-
context "Int64" do
|
317
|
-
let(:values) { { :name => "STEPH CURRY", :date_created => 1454712125 } }
|
318
|
-
let(:test_resource) { ::Test::Resource.new(values) }
|
319
|
-
|
320
|
-
it "should memoize after Int64 values change " do
|
321
|
-
test_resource.encode
|
322
|
-
expect(test_resource.instance_variable_get(:@encode)).to eq(test_resource.encode)
|
323
|
-
test_resource.date_created = 5554712127
|
324
|
-
expect(test_resource.instance_variable_get(:@encode)).to be_nil
|
325
|
-
end
|
326
|
-
end
|
327
|
-
end
|
328
|
-
|
329
271
|
context "when there's no value for a required field" do
|
330
272
|
let(:message) { ::Test::ResourceWithRequiredField.new }
|
331
273
|
|
metadata
CHANGED
@@ -1,181 +1,223 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protobuf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BJ Neilsen
|
8
8
|
- Brandon Dewitt
|
9
9
|
- Devin Christensen
|
10
10
|
- Adam Hutchison
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-02-
|
14
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
|
+
name: activesupport
|
17
18
|
requirement: !ruby/object:Gem::Requirement
|
18
19
|
requirements:
|
19
20
|
- - ">="
|
20
21
|
- !ruby/object:Gem::Version
|
21
22
|
version: '3.2'
|
22
|
-
name: activesupport
|
23
|
-
prerelease: false
|
24
23
|
type: :runtime
|
24
|
+
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '3.2'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
+
name: middleware
|
31
32
|
requirement: !ruby/object:Gem::Requirement
|
32
33
|
requirements:
|
33
34
|
- - ">="
|
34
35
|
- !ruby/object:Gem::Version
|
35
36
|
version: '0'
|
36
|
-
name: middleware
|
37
|
-
prerelease: false
|
38
37
|
type: :runtime
|
38
|
+
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
|
+
name: thor
|
45
46
|
requirement: !ruby/object:Gem::Requirement
|
46
47
|
requirements:
|
47
48
|
- - ">="
|
48
49
|
- !ruby/object:Gem::Version
|
49
50
|
version: '0'
|
50
|
-
name: thor
|
51
|
-
prerelease: false
|
52
51
|
type: :runtime
|
52
|
+
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
|
+
name: thread_safe
|
59
60
|
requirement: !ruby/object:Gem::Requirement
|
60
61
|
requirements:
|
61
62
|
- - ">="
|
62
63
|
- !ruby/object:Gem::Version
|
63
64
|
version: '0'
|
64
|
-
name: thread_safe
|
65
|
-
prerelease: false
|
66
65
|
type: :runtime
|
66
|
+
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - ">="
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
|
+
name: ffi-rzmq
|
73
74
|
requirement: !ruby/object:Gem::Requirement
|
74
75
|
requirements:
|
75
76
|
- - ">="
|
76
77
|
- !ruby/object:Gem::Version
|
77
78
|
version: '0'
|
78
|
-
name: ffi-rzmq
|
79
|
-
prerelease: false
|
80
79
|
type: :development
|
80
|
+
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
83
|
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
- !ruby/object:Gem::Dependency
|
87
|
+
name: rake
|
87
88
|
requirement: !ruby/object:Gem::Requirement
|
88
89
|
requirements:
|
89
90
|
- - ">="
|
90
91
|
- !ruby/object:Gem::Version
|
91
92
|
version: '0'
|
92
|
-
name: rake
|
93
|
-
prerelease: false
|
94
93
|
type: :development
|
94
|
+
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
97
|
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
|
+
name: rspec
|
101
102
|
requirement: !ruby/object:Gem::Requirement
|
102
103
|
requirements:
|
103
104
|
- - ">="
|
104
105
|
- !ruby/object:Gem::Version
|
105
106
|
version: '3.0'
|
106
|
-
name: rspec
|
107
|
-
prerelease: false
|
108
107
|
type: :development
|
108
|
+
prerelease: false
|
109
109
|
version_requirements: !ruby/object:Gem::Requirement
|
110
110
|
requirements:
|
111
111
|
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
113
|
version: '3.0'
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
|
+
name: rubocop
|
115
116
|
requirement: !ruby/object:Gem::Requirement
|
116
117
|
requirements:
|
117
118
|
- - '='
|
118
119
|
- !ruby/object:Gem::Version
|
119
120
|
version: 0.34.2
|
120
|
-
name: rubocop
|
121
|
-
prerelease: false
|
122
121
|
type: :development
|
122
|
+
prerelease: false
|
123
123
|
version_requirements: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
125
|
- - '='
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: 0.34.2
|
128
128
|
- !ruby/object:Gem::Dependency
|
129
|
+
name: simplecov
|
129
130
|
requirement: !ruby/object:Gem::Requirement
|
130
131
|
requirements:
|
131
132
|
- - ">="
|
132
133
|
- !ruby/object:Gem::Version
|
133
134
|
version: '0'
|
134
|
-
name: simplecov
|
135
|
-
prerelease: false
|
136
135
|
type: :development
|
136
|
+
prerelease: false
|
137
137
|
version_requirements: !ruby/object:Gem::Requirement
|
138
138
|
requirements:
|
139
139
|
- - ">="
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
|
+
name: timecop
|
143
144
|
requirement: !ruby/object:Gem::Requirement
|
144
145
|
requirements:
|
145
146
|
- - ">="
|
146
147
|
- !ruby/object:Gem::Version
|
147
148
|
version: '0'
|
148
|
-
|
149
|
+
type: :development
|
149
150
|
prerelease: false
|
151
|
+
version_requirements: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - ">="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
156
|
+
- !ruby/object:Gem::Dependency
|
157
|
+
name: yard
|
158
|
+
requirement: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
150
163
|
type: :development
|
164
|
+
prerelease: false
|
151
165
|
version_requirements: !ruby/object:Gem::Requirement
|
152
166
|
requirements:
|
153
167
|
- - ">="
|
154
168
|
- !ruby/object:Gem::Version
|
155
169
|
version: '0'
|
156
170
|
- !ruby/object:Gem::Dependency
|
171
|
+
name: pry-byebug
|
157
172
|
requirement: !ruby/object:Gem::Requirement
|
158
173
|
requirements:
|
159
174
|
- - ">="
|
160
175
|
- !ruby/object:Gem::Version
|
161
176
|
version: '0'
|
162
|
-
|
177
|
+
type: :development
|
163
178
|
prerelease: false
|
179
|
+
version_requirements: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
- !ruby/object:Gem::Dependency
|
185
|
+
name: pry-stack_explorer
|
186
|
+
requirement: !ruby/object:Gem::Requirement
|
187
|
+
requirements:
|
188
|
+
- - ">="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
164
191
|
type: :development
|
192
|
+
prerelease: false
|
165
193
|
version_requirements: !ruby/object:Gem::Requirement
|
166
194
|
requirements:
|
167
195
|
- - ">="
|
168
196
|
- !ruby/object:Gem::Version
|
169
197
|
version: '0'
|
170
198
|
- !ruby/object:Gem::Dependency
|
199
|
+
name: varint
|
171
200
|
requirement: !ruby/object:Gem::Requirement
|
172
201
|
requirements:
|
173
202
|
- - ">="
|
174
203
|
- !ruby/object:Gem::Version
|
175
204
|
version: '0'
|
176
|
-
|
205
|
+
type: :development
|
177
206
|
prerelease: false
|
207
|
+
version_requirements: !ruby/object:Gem::Requirement
|
208
|
+
requirements:
|
209
|
+
- - ">="
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: '0'
|
212
|
+
- !ruby/object:Gem::Dependency
|
213
|
+
name: ruby-prof
|
214
|
+
requirement: !ruby/object:Gem::Requirement
|
215
|
+
requirements:
|
216
|
+
- - ">="
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: '0'
|
178
219
|
type: :development
|
220
|
+
prerelease: false
|
179
221
|
version_requirements: !ruby/object:Gem::Requirement
|
180
222
|
requirements:
|
181
223
|
- - ">="
|
@@ -377,7 +419,7 @@ homepage: https://github.com/localshred/protobuf
|
|
377
419
|
licenses:
|
378
420
|
- MIT
|
379
421
|
metadata: {}
|
380
|
-
post_install_message:
|
422
|
+
post_install_message:
|
381
423
|
rdoc_options: []
|
382
424
|
require_paths:
|
383
425
|
- lib
|
@@ -392,10 +434,80 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
392
434
|
- !ruby/object:Gem::Version
|
393
435
|
version: '0'
|
394
436
|
requirements: []
|
395
|
-
rubyforge_project:
|
396
|
-
rubygems_version: 2.
|
397
|
-
signing_key:
|
437
|
+
rubyforge_project:
|
438
|
+
rubygems_version: 2.5.1
|
439
|
+
signing_key:
|
398
440
|
specification_version: 4
|
399
441
|
summary: Google Protocol Buffers serialization and RPC implementation for Ruby.
|
400
|
-
test_files:
|
401
|
-
|
442
|
+
test_files:
|
443
|
+
- spec/benchmark/tasks.rb
|
444
|
+
- spec/bin/protoc-gen-ruby_spec.rb
|
445
|
+
- spec/encoding/all_types_spec.rb
|
446
|
+
- spec/encoding/extreme_values_spec.rb
|
447
|
+
- spec/functional/class_inheritance_spec.rb
|
448
|
+
- spec/functional/socket_server_spec.rb
|
449
|
+
- spec/functional/zmq_server_spec.rb
|
450
|
+
- spec/lib/protobuf/cli_spec.rb
|
451
|
+
- spec/lib/protobuf/code_generator_spec.rb
|
452
|
+
- spec/lib/protobuf/enum_spec.rb
|
453
|
+
- spec/lib/protobuf/field/bool_field_spec.rb
|
454
|
+
- spec/lib/protobuf/field/field_array_spec.rb
|
455
|
+
- spec/lib/protobuf/field/float_field_spec.rb
|
456
|
+
- spec/lib/protobuf/field/int32_field_spec.rb
|
457
|
+
- spec/lib/protobuf/field/string_field_spec.rb
|
458
|
+
- spec/lib/protobuf/field_spec.rb
|
459
|
+
- spec/lib/protobuf/generators/base_spec.rb
|
460
|
+
- spec/lib/protobuf/generators/enum_generator_spec.rb
|
461
|
+
- spec/lib/protobuf/generators/extension_generator_spec.rb
|
462
|
+
- spec/lib/protobuf/generators/field_generator_spec.rb
|
463
|
+
- spec/lib/protobuf/generators/file_generator_spec.rb
|
464
|
+
- spec/lib/protobuf/generators/message_generator_spec.rb
|
465
|
+
- spec/lib/protobuf/generators/service_generator_spec.rb
|
466
|
+
- spec/lib/protobuf/lifecycle_spec.rb
|
467
|
+
- spec/lib/protobuf/message_spec.rb
|
468
|
+
- spec/lib/protobuf/optionable_spec.rb
|
469
|
+
- spec/lib/protobuf/rpc/client_spec.rb
|
470
|
+
- spec/lib/protobuf/rpc/connector_spec.rb
|
471
|
+
- spec/lib/protobuf/rpc/connectors/base_spec.rb
|
472
|
+
- spec/lib/protobuf/rpc/connectors/common_spec.rb
|
473
|
+
- spec/lib/protobuf/rpc/connectors/ping_spec.rb
|
474
|
+
- spec/lib/protobuf/rpc/connectors/socket_spec.rb
|
475
|
+
- spec/lib/protobuf/rpc/connectors/zmq_spec.rb
|
476
|
+
- spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb
|
477
|
+
- spec/lib/protobuf/rpc/middleware/logger_spec.rb
|
478
|
+
- spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb
|
479
|
+
- spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb
|
480
|
+
- spec/lib/protobuf/rpc/servers/socket_server_spec.rb
|
481
|
+
- spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
|
482
|
+
- spec/lib/protobuf/rpc/servers/zmq/util_spec.rb
|
483
|
+
- spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb
|
484
|
+
- spec/lib/protobuf/rpc/service_directory_spec.rb
|
485
|
+
- spec/lib/protobuf/rpc/service_dispatcher_spec.rb
|
486
|
+
- spec/lib/protobuf/rpc/service_filters_spec.rb
|
487
|
+
- spec/lib/protobuf/rpc/service_spec.rb
|
488
|
+
- spec/lib/protobuf/rpc/stat_spec.rb
|
489
|
+
- spec/lib/protobuf/varint_spec.rb
|
490
|
+
- spec/lib/protobuf_spec.rb
|
491
|
+
- spec/spec_helper.rb
|
492
|
+
- spec/support/all.rb
|
493
|
+
- spec/support/packed_field.rb
|
494
|
+
- spec/support/protos/all_types.data.bin
|
495
|
+
- spec/support/protos/all_types.data.txt
|
496
|
+
- spec/support/protos/enum.pb.rb
|
497
|
+
- spec/support/protos/enum.proto
|
498
|
+
- spec/support/protos/extreme_values.data.bin
|
499
|
+
- spec/support/protos/google_unittest.bin
|
500
|
+
- spec/support/protos/google_unittest.pb.rb
|
501
|
+
- spec/support/protos/google_unittest.proto
|
502
|
+
- spec/support/protos/google_unittest_import.pb.rb
|
503
|
+
- spec/support/protos/google_unittest_import.proto
|
504
|
+
- spec/support/protos/google_unittest_import_public.pb.rb
|
505
|
+
- spec/support/protos/google_unittest_import_public.proto
|
506
|
+
- spec/support/protos/multi_field_extensions.pb.rb
|
507
|
+
- spec/support/protos/multi_field_extensions.proto
|
508
|
+
- spec/support/protos/resource.pb.rb
|
509
|
+
- spec/support/protos/resource.proto
|
510
|
+
- spec/support/resource_service.rb
|
511
|
+
- spec/support/server.rb
|
512
|
+
- spec/support/test_app_file.rb
|
513
|
+
has_rdoc:
|