google-protobuf 3.8.0-x86-mingw32 → 3.9.0.rc.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of google-protobuf might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ext/google/protobuf_c/encode_decode.c +3 -0
- data/ext/google/protobuf_c/map.c +0 -1
- data/ext/google/protobuf_c/message.c +0 -1
- data/ext/google/protobuf_c/upb.c +29 -12
- data/lib/google/2.3/protobuf_c.so +0 -0
- data/lib/google/2.4/protobuf_c.so +0 -0
- data/lib/google/2.5/protobuf_c.so +0 -0
- data/lib/google/2.6/protobuf_c.so +0 -0
- data/tests/basic.rb +19 -13
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b05d6e8340bd86c86ee24658649b78dbaaaed52912ebba1530bd98c41ca72956
|
4
|
+
data.tar.gz: 82182a76fbcb473c50416073783cebfc123c3c9fe6722ac3c78c9799849770c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3867bbbe216646a7288d1547d851a5b0825e827433a7ccc4fecd660d5f84769b37b9121baeedbbf3047dbde307a9fba54dc8c5cfa05205472ba86af71026869d
|
7
|
+
data.tar.gz: 10e5f9f090f35fe98ff54036ff7f7f2bc13d2e19ff34ea5c173217b36eadfc5b6dbf00bf39c481b3fd050cbbce2ac0eea911f1c51994c8815fc9ddf68768279e
|
@@ -389,6 +389,9 @@ static bool endmap_handler(void *closure, const void *hd, upb_status* s) {
|
|
389
389
|
if (mapdata->value_field_type == UPB_TYPE_MESSAGE ||
|
390
390
|
mapdata->value_field_type == UPB_TYPE_ENUM) {
|
391
391
|
value_field_typeclass = get_def_obj(mapdata->value_field_subdef);
|
392
|
+
if (mapdata->value_field_type == UPB_TYPE_ENUM) {
|
393
|
+
value_field_typeclass = EnumDescriptor_enummodule(value_field_typeclass);
|
394
|
+
}
|
392
395
|
}
|
393
396
|
|
394
397
|
value = native_slot_get(
|
data/ext/google/protobuf_c/map.c
CHANGED
@@ -847,7 +847,6 @@ void Map_register(VALUE module) {
|
|
847
847
|
rb_define_method(klass, "dup", Map_dup, 0);
|
848
848
|
rb_define_method(klass, "==", Map_eq, 1);
|
849
849
|
rb_define_method(klass, "hash", Map_hash, 0);
|
850
|
-
rb_define_method(klass, "to_hash", Map_to_h, 0);
|
851
850
|
rb_define_method(klass, "to_h", Map_to_h, 0);
|
852
851
|
rb_define_method(klass, "inspect", Map_inspect, 0);
|
853
852
|
rb_define_method(klass, "merge", Map_merge, 1);
|
@@ -737,7 +737,6 @@ VALUE build_class_from_descriptor(Descriptor* desc) {
|
|
737
737
|
rb_define_method(klass, "eql?", Message_eq, 1);
|
738
738
|
rb_define_method(klass, "hash", Message_hash, 0);
|
739
739
|
rb_define_method(klass, "to_h", Message_to_h, 0);
|
740
|
-
rb_define_method(klass, "to_hash", Message_to_h, 0);
|
741
740
|
rb_define_method(klass, "inspect", Message_inspect, 0);
|
742
741
|
rb_define_method(klass, "to_s", Message_inspect, 0);
|
743
742
|
rb_define_method(klass, "[]", Message_index, 1);
|
data/ext/google/protobuf_c/upb.c
CHANGED
@@ -16289,18 +16289,32 @@ static size_t fmt_bool(bool val, char* buf, size_t length) {
|
|
16289
16289
|
return n;
|
16290
16290
|
}
|
16291
16291
|
|
16292
|
-
static size_t
|
16293
|
-
size_t n = _upb_snprintf(buf, length, "%
|
16292
|
+
static size_t fmt_int64_as_number(long long val, char* buf, size_t length) {
|
16293
|
+
size_t n = _upb_snprintf(buf, length, "%lld", val);
|
16294
16294
|
CHKLENGTH(n > 0 && n < length);
|
16295
16295
|
return n;
|
16296
16296
|
}
|
16297
16297
|
|
16298
|
-
static size_t
|
16298
|
+
static size_t fmt_uint64_as_number(
|
16299
|
+
unsigned long long val, char* buf, size_t length) {
|
16299
16300
|
size_t n = _upb_snprintf(buf, length, "%llu", val);
|
16300
16301
|
CHKLENGTH(n > 0 && n < length);
|
16301
16302
|
return n;
|
16302
16303
|
}
|
16303
16304
|
|
16305
|
+
static size_t fmt_int64_as_string(long long val, char* buf, size_t length) {
|
16306
|
+
size_t n = _upb_snprintf(buf, length, "\"%lld\"", val);
|
16307
|
+
CHKLENGTH(n > 0 && n < length);
|
16308
|
+
return n;
|
16309
|
+
}
|
16310
|
+
|
16311
|
+
static size_t fmt_uint64_as_string(
|
16312
|
+
unsigned long long val, char* buf, size_t length) {
|
16313
|
+
size_t n = _upb_snprintf(buf, length, "\"%llu\"", val);
|
16314
|
+
CHKLENGTH(n > 0 && n < length);
|
16315
|
+
return n;
|
16316
|
+
}
|
16317
|
+
|
16304
16318
|
/* Print a map key given a field name. Called by scalar field handlers and by
|
16305
16319
|
* startseq for repeated fields. */
|
16306
16320
|
static bool putkey(void *closure, const void *handler_data) {
|
@@ -16344,8 +16358,11 @@ static bool putkey(void *closure, const void *handler_data) {
|
|
16344
16358
|
static bool putmapkey_##type(void *closure, const void *handler_data, \
|
16345
16359
|
type val) { \
|
16346
16360
|
upb_json_printer *p = closure; \
|
16361
|
+
char data[64]; \
|
16362
|
+
size_t length = fmt_func(val, data, sizeof(data)); \
|
16363
|
+
UPB_UNUSED(handler_data); \
|
16347
16364
|
print_data(p, "\"", 1); \
|
16348
|
-
|
16365
|
+
print_data(p, data, length); \
|
16349
16366
|
print_data(p, "\":", 2); \
|
16350
16367
|
return true; \
|
16351
16368
|
}
|
@@ -16353,17 +16370,17 @@ static bool putkey(void *closure, const void *handler_data) {
|
|
16353
16370
|
TYPE_HANDLERS(double, fmt_double)
|
16354
16371
|
TYPE_HANDLERS(float, fmt_float)
|
16355
16372
|
TYPE_HANDLERS(bool, fmt_bool)
|
16356
|
-
TYPE_HANDLERS(int32_t,
|
16357
|
-
TYPE_HANDLERS(uint32_t,
|
16358
|
-
TYPE_HANDLERS(int64_t,
|
16359
|
-
TYPE_HANDLERS(uint64_t,
|
16373
|
+
TYPE_HANDLERS(int32_t, fmt_int64_as_number)
|
16374
|
+
TYPE_HANDLERS(uint32_t, fmt_int64_as_number)
|
16375
|
+
TYPE_HANDLERS(int64_t, fmt_int64_as_string)
|
16376
|
+
TYPE_HANDLERS(uint64_t, fmt_uint64_as_string)
|
16360
16377
|
|
16361
16378
|
/* double and float are not allowed to be map keys. */
|
16362
16379
|
TYPE_HANDLERS_MAPKEY(bool, fmt_bool)
|
16363
|
-
TYPE_HANDLERS_MAPKEY(int32_t,
|
16364
|
-
TYPE_HANDLERS_MAPKEY(uint32_t,
|
16365
|
-
TYPE_HANDLERS_MAPKEY(int64_t,
|
16366
|
-
TYPE_HANDLERS_MAPKEY(uint64_t,
|
16380
|
+
TYPE_HANDLERS_MAPKEY(int32_t, fmt_int64_as_number)
|
16381
|
+
TYPE_HANDLERS_MAPKEY(uint32_t, fmt_int64_as_number)
|
16382
|
+
TYPE_HANDLERS_MAPKEY(int64_t, fmt_int64_as_number)
|
16383
|
+
TYPE_HANDLERS_MAPKEY(uint64_t, fmt_uint64_as_number)
|
16367
16384
|
|
16368
16385
|
#undef TYPE_HANDLERS
|
16369
16386
|
#undef TYPE_HANDLERS_MAPKEY
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/tests/basic.rb
CHANGED
@@ -170,10 +170,12 @@ module BasicTest
|
|
170
170
|
m = MapMessage.new(
|
171
171
|
:map_string_int32 => {"a" => 1, "b" => 2},
|
172
172
|
:map_string_msg => {"a" => TestMessage2.new(:foo => 1),
|
173
|
-
"b" => TestMessage2.new(:foo => 2)}
|
173
|
+
"b" => TestMessage2.new(:foo => 2)},
|
174
|
+
:map_string_enum => {"a" => :A, "b" => :B})
|
174
175
|
assert m.map_string_int32.keys.sort == ["a", "b"]
|
175
176
|
assert m.map_string_int32["a"] == 1
|
176
177
|
assert m.map_string_msg["b"].foo == 2
|
178
|
+
assert m.map_string_enum["a"] == :A
|
177
179
|
|
178
180
|
m.map_string_int32["c"] = 3
|
179
181
|
assert m.map_string_int32["c"] == 3
|
@@ -206,8 +208,9 @@ module BasicTest
|
|
206
208
|
m = MapMessage.new(
|
207
209
|
:map_string_int32 => {"a" => 1, "b" => 2},
|
208
210
|
:map_string_msg => {"a" => TestMessage2.new(:foo => 1),
|
209
|
-
"b" => TestMessage2.new(:foo => 2)}
|
210
|
-
|
211
|
+
"b" => TestMessage2.new(:foo => 2)},
|
212
|
+
:map_string_enum => {"a" => :A, "b" => :B})
|
213
|
+
expected = "<BasicTest::MapMessage: map_string_int32: {\"b\"=>2, \"a\"=>1}, map_string_msg: {\"b\"=><BasicTest::TestMessage2: foo: 2>, \"a\"=><BasicTest::TestMessage2: foo: 1>}, map_string_enum: {\"b\"=>:B, \"a\"=>:A}>"
|
211
214
|
assert_equal expected, m.inspect
|
212
215
|
end
|
213
216
|
|
@@ -237,7 +240,8 @@ module BasicTest
|
|
237
240
|
m = MapMessage.new(
|
238
241
|
:map_string_int32 => {"a" => 1, "b" => 2},
|
239
242
|
:map_string_msg => {"a" => TestMessage2.new(:foo => 1),
|
240
|
-
"b" => TestMessage2.new(:foo => 2)}
|
243
|
+
"b" => TestMessage2.new(:foo => 2)},
|
244
|
+
:map_string_enum => {"a" => :A, "b" => :B})
|
241
245
|
m2 = MapMessage.decode(MapMessage.encode(m))
|
242
246
|
assert m == m2
|
243
247
|
|
@@ -298,10 +302,12 @@ module BasicTest
|
|
298
302
|
m = MapMessage.new(
|
299
303
|
:map_string_int32 => {"a" => 1, "b" => 2},
|
300
304
|
:map_string_msg => {"a" => TestMessage2.new(:foo => 1),
|
301
|
-
"b" => TestMessage2.new(:foo => 2)}
|
305
|
+
"b" => TestMessage2.new(:foo => 2)},
|
306
|
+
:map_string_enum => {"a" => :A, "b" => :B})
|
302
307
|
expected_result = {
|
303
308
|
:map_string_int32 => {"a" => 1, "b" => 2},
|
304
|
-
:map_string_msg => {"a" => {:foo => 1}, "b" => {:foo => 2}}
|
309
|
+
:map_string_msg => {"a" => {:foo => 1}, "b" => {:foo => 2}},
|
310
|
+
:map_string_enum => {"a" => :A, "b" => :B}
|
305
311
|
}
|
306
312
|
assert_equal expected_result, m.to_h
|
307
313
|
end
|
@@ -311,26 +317,26 @@ module BasicTest
|
|
311
317
|
# TODO: Fix JSON in JRuby version.
|
312
318
|
return if RUBY_PLATFORM == "java"
|
313
319
|
m = MapMessage.new(:map_string_int32 => {"a" => 1})
|
314
|
-
expected = {mapStringInt32: {a: 1}, mapStringMsg: {}}
|
315
|
-
expected_preserve = {map_string_int32: {a: 1}, map_string_msg: {}}
|
316
|
-
|
320
|
+
expected = {mapStringInt32: {a: 1}, mapStringMsg: {}, mapStringEnum: {}}
|
321
|
+
expected_preserve = {map_string_int32: {a: 1}, map_string_msg: {}, map_string_enum: {}}
|
322
|
+
assert_equal JSON.parse(MapMessage.encode_json(m), :symbolize_names => true), expected
|
317
323
|
|
318
324
|
json = MapMessage.encode_json(m, :preserve_proto_fieldnames => true)
|
319
|
-
|
325
|
+
assert_equal JSON.parse(json, :symbolize_names => true), expected_preserve
|
320
326
|
|
321
327
|
m2 = MapMessage.decode_json(MapMessage.encode_json(m))
|
322
|
-
|
328
|
+
assert_equal m, m2
|
323
329
|
end
|
324
330
|
|
325
331
|
def test_json_maps_emit_defaults_submsg
|
326
332
|
# TODO: Fix JSON in JRuby version.
|
327
333
|
return if RUBY_PLATFORM == "java"
|
328
334
|
m = MapMessage.new(:map_string_msg => {"a" => TestMessage2.new})
|
329
|
-
expected = {mapStringInt32: {}, mapStringMsg: {a: {foo: 0}}}
|
335
|
+
expected = {mapStringInt32: {}, mapStringMsg: {a: {foo: 0}}, mapStringEnum: {}}
|
330
336
|
|
331
337
|
actual = MapMessage.encode_json(m, :emit_defaults => true)
|
332
338
|
|
333
|
-
|
339
|
+
assert_equal JSON.parse(actual, :symbolize_names => true), expected
|
334
340
|
end
|
335
341
|
|
336
342
|
def test_respond_to
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-protobuf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.0.rc.1
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Protobuf Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler-dock
|
@@ -126,12 +126,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '2.3'
|
127
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - "
|
129
|
+
- - ">"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 1.3.1
|
132
132
|
requirements: []
|
133
133
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.7.
|
134
|
+
rubygems_version: 2.7.9
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Protocol Buffers
|