google-protobuf 3.8.0-x64-mingw32 → 3.9.0.rc.1-x64-mingw32

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.

Potentially problematic release.


This version of google-protobuf might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26a6d5a451daaf785102825ade0c307c32785b4687d0838f2ad03838e1fd279a
4
- data.tar.gz: 0b0a0f1df697e9d971a3950236d7ccd5a758b1cc42e383a18143300dcaab1d12
3
+ metadata.gz: f7b666a9da5319e45665777e41792659e16161f5c970c5804da4248561ca6f5e
4
+ data.tar.gz: f64f87a72244ec4344c03c1da006156ec985192648ef5e3c7e577a4140b9ba04
5
5
  SHA512:
6
- metadata.gz: 524186c7a6d155458f1549117cb22b850bc75e80671a82c8d0c6f49676afc1edb230bbf197613aaafc6919a7c7b89e2a135dacbb2b6bec9681d734d367515472
7
- data.tar.gz: 2b297a273eb7bcbbc5d3c5f25a31370c54b9241ee7ac15949d4b88b98ebe32f6acd466773e58aaff8015e038603246c46afb330bbb1875a42c33f69d45c6bac0
6
+ metadata.gz: c2612772d228a667fd1575cd6b6824d2d450bb7e917ebadb395c01692c45d86503fa37c4381bf533a72cc7fbd3457ab55da2e649d3325de3a792206b814cd5fb
7
+ data.tar.gz: 3385ec15b4265cd2e3c5a4c1df991916dcea6ce2e15443145614802ee74137289ac72632c3906730bcb585170071675fa3d59466201910e00551c5366a2f7dbb
@@ -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(
@@ -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);
@@ -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 fmt_int64(long val, char* buf, size_t length) {
16293
- size_t n = _upb_snprintf(buf, length, "%ld", val);
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 fmt_uint64(unsigned long long val, char* buf, size_t length) {
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
- CHK(put##type(closure, handler_data, val)); \
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, fmt_int64)
16357
- TYPE_HANDLERS(uint32_t, fmt_int64)
16358
- TYPE_HANDLERS(int64_t, fmt_int64)
16359
- TYPE_HANDLERS(uint64_t, fmt_uint64)
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, fmt_int64)
16364
- TYPE_HANDLERS_MAPKEY(uint32_t, fmt_int64)
16365
- TYPE_HANDLERS_MAPKEY(int64_t, fmt_int64)
16366
- TYPE_HANDLERS_MAPKEY(uint64_t, fmt_uint64)
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
- expected = "<BasicTest::MapMessage: map_string_int32: {\"b\"=>2, \"a\"=>1}, map_string_msg: {\"b\"=><BasicTest::TestMessage2: foo: 2>, \"a\"=><BasicTest::TestMessage2: foo: 1>}>"
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
- assert JSON.parse(MapMessage.encode_json(m), :symbolize_names => true) == expected
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
- assert JSON.parse(json, :symbolize_names => true) == expected_preserve
325
+ assert_equal JSON.parse(json, :symbolize_names => true), expected_preserve
320
326
 
321
327
  m2 = MapMessage.decode_json(MapMessage.encode_json(m))
322
- assert m == m2
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
- assert JSON.parse(actual, :symbolize_names => true) == expected
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.8.0
4
+ version: 3.9.0.rc.1
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Protobuf Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-28 00:00:00.000000000 Z
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: '0'
131
+ version: 1.3.1
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.7.8
134
+ rubygems_version: 2.7.9
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Protocol Buffers