google-protobuf 3.5.1.2 → 3.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 37f64f11dfb6486d8451a8b642d32edb08303e90
4
- data.tar.gz: bdcf1060e51613646a362b1d58bad14667f750c5
2
+ SHA256:
3
+ metadata.gz: 28049363eebcb842bbc56cbca6225c1459acc909c4f1f116ef0a267fdfad0ef5
4
+ data.tar.gz: 86bdaa737c380e1e7f0629b845503519fbc1d9761e8197efef00c16928bf4a1b
5
5
  SHA512:
6
- metadata.gz: d7d3601d1cc74418451a0ae23660359df2512d2f4243d55959f284878cc941eede85c5e9481bbf3a5f83b72408e2f299585b636f905ea05d9f8f4d002b1c7906
7
- data.tar.gz: 46c454c3942c820a5bea31aeefa1d7c70e4814e660791520b3e2dbe9a29a0e9d5a266535601c8a2ffbc9f494086c3d962718e4ea1cf6326d36b0a33f4b0a7673
6
+ metadata.gz: c1ecf4b286637c8c7212b5e8b8232293aa5094d8d2d6ec919529f0a875cfc36a80bdf36612a74abef2913f1102c31ec261ba3ee87890f3d42899ddeecb0bb9a6
7
+ data.tar.gz: 91e283f37c9cada200e7d0021ab7cf8721ac7a838d17e8b357e58474b8d5c93e1030078b8885dd2ee4c9cef710d629f699ba356893b7c9a47aceeab10e9ebed4
@@ -2,7 +2,9 @@
2
2
 
3
3
  require 'mkmf'
4
4
 
5
- $CFLAGS += " -std=c99 -O3 -DNDEBUG"
5
+ unless RUBY_PLATFORM =~ /mswin|mingw/
6
+ $CFLAGS += " -std=c99 -O3 -DNDEBUG"
7
+ end
6
8
 
7
9
 
8
10
  if RUBY_PLATFORM =~ /linux/
@@ -540,9 +540,9 @@ VALUE build_class_from_descriptor(Descriptor* desc) {
540
540
  get_def_obj(desc->msgdef));
541
541
  rb_define_alloc_func(klass, Message_alloc);
542
542
  rb_require("google/protobuf/message_exts");
543
- rb_include_module(klass, rb_eval_string("Google::Protobuf::MessageExts"));
543
+ rb_include_module(klass, rb_eval_string("::Google::Protobuf::MessageExts"));
544
544
  rb_extend_object(
545
- klass, rb_eval_string("Google::Protobuf::MessageExts::ClassMethods"));
545
+ klass, rb_eval_string("::Google::Protobuf::MessageExts::ClassMethods"));
546
546
 
547
547
  rb_define_method(klass, "method_missing",
548
548
  Message_method_missing, -1);
@@ -606,12 +606,20 @@ static void check_repeated_field_type(VALUE val, const upb_fielddef* field) {
606
606
  rb_raise(rb_eTypeError, "Repeated field array has wrong element type");
607
607
  }
608
608
 
609
- if (self->field_type == UPB_TYPE_MESSAGE ||
610
- self->field_type == UPB_TYPE_ENUM) {
609
+ if (self->field_type == UPB_TYPE_MESSAGE) {
611
610
  if (self->field_type_class !=
612
- get_def_obj(upb_fielddef_subdef(field))) {
611
+ Descriptor_msgclass(get_def_obj(upb_fielddef_subdef(field)))) {
613
612
  rb_raise(rb_eTypeError,
614
- "Repeated field array has wrong message/enum class");
613
+ "Repeated field array has wrong message class");
614
+ }
615
+ }
616
+
617
+
618
+ if (self->field_type == UPB_TYPE_ENUM) {
619
+ if (self->field_type_class !=
620
+ EnumDescriptor_enummodule(get_def_obj(upb_fielddef_subdef(field)))) {
621
+ rb_raise(rb_eTypeError,
622
+ "Repeated field array has wrong enum class");
615
623
  }
616
624
  }
617
625
  }
@@ -60,8 +60,8 @@ module Google
60
60
  msg.to_proto
61
61
  end
62
62
 
63
- def self.encode_json(msg)
64
- msg.to_json
63
+ def self.encode_json(msg, options = {})
64
+ msg.to_json(options)
65
65
  end
66
66
 
67
67
  def self.decode(klass, proto)
@@ -40,8 +40,8 @@ module Google
40
40
  module ClassMethods
41
41
  end
42
42
 
43
- def to_json
44
- self.class.encode_json(self)
43
+ def to_json(options = {})
44
+ self.class.encode_json(self, options)
45
45
  end
46
46
 
47
47
  def to_proto
@@ -150,12 +150,12 @@ module Google
150
150
  end
151
151
 
152
152
 
153
- %w(delete delete_at delete_if shift slice! unshift).each do |method_name|
153
+ %w(delete delete_at shift slice! unshift).each do |method_name|
154
154
  define_array_wrapper_method(method_name)
155
155
  end
156
156
 
157
157
 
158
- %w(collect! compact! fill flatten! insert reverse!
158
+ %w(collect! compact! delete_if fill flatten! insert reverse!
159
159
  rotate! select! shuffle! sort! sort_by! uniq!).each do |method_name|
160
160
  define_array_wrapper_with_result_method(method_name)
161
161
  end
@@ -5,6 +5,7 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
5
5
 
6
6
  require 'generated_code_pb'
7
7
  require 'test_import_pb'
8
+ require 'test_ruby_package_pb'
8
9
  require 'test/unit'
9
10
 
10
11
  class GeneratedCodeTest < Test::Unit::TestCase
@@ -15,5 +16,6 @@ class GeneratedCodeTest < Test::Unit::TestCase
15
16
  # aspect of the extension (basic.rb is for that).
16
17
  m = A::B::C::TestMessage.new()
17
18
  m2 = FooBar::TestImportedMessage.new()
19
+ m3 = A::B::TestRubyPackageMessage.new()
18
20
  end
19
21
  end
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.5.1.2
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Protobuf Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-30 00:00:00.000000000 Z
11
+ date: 2018-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler-dock
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.6.14
131
+ rubygems_version: 2.7.3
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Protocol Buffers