google-protobuf 3.0.0.alpha.5.0.3 → 3.0.0.alpha.5.0.4

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
2
  SHA1:
3
- metadata.gz: 9eb86dcaf6349c8e30b9b83c5a824fefbe6323f5
4
- data.tar.gz: 32964e889f51b060e31e9f7a653d994fa20d982e
3
+ metadata.gz: 73c37e7b4462fee8a1db0b1ae497bbfb69feec51
4
+ data.tar.gz: aa12274e2475e9bd27d3a7d551f33a3562709892
5
5
  SHA512:
6
- metadata.gz: 1428fc7845f3e6a5a444b5eb862273823c4b975b24d7751e07fd8ca65697214b9b8a0556ff272f53b6265d58c47d93f9d4aba6d45b6256d6fb2dda5d5e163a15
7
- data.tar.gz: c6aa198b8a4e480271926db7ad24d4da8e068cf182ef6e774a67cf2a93e113fae621a1aafb219015593dd88c0122cd869a55d750268bf816f688ec6dd7391943
6
+ metadata.gz: 4ea6e9dcd638b5be38062e1a0f70cd47d0c90d1681c6c865dc0e0d4b878b2c90c908cd9d3d7f97fe5a69f12b0ac27901a3984a1f9ccaa39c938a26de262a95b7
7
+ data.tar.gz: 6a280268f8869683c85698c6b1a6410188dfb557641c149b2e34b8ebc54ae61aab20f18b3c816bc299e01fb8c2359b8bf5fb89f51683a3de2f08e73524ac844a
@@ -166,7 +166,7 @@ VALUE Message_method_missing(int argc, VALUE* argv, VALUE _self) {
166
166
  name, name_len);
167
167
 
168
168
  if (f == NULL) {
169
- rb_raise(rb_eArgError, "Unknown field");
169
+ return rb_call_super(argc, argv);
170
170
  }
171
171
 
172
172
  if (setter) {
@@ -197,7 +197,7 @@ int Message_initialize_kwarg(VALUE key, VALUE val, VALUE _self) {
197
197
  f = upb_msgdef_ntofz(self->descriptor->msgdef, name);
198
198
  if (f == NULL) {
199
199
  rb_raise(rb_eArgError,
200
- "Unknown field name in initialization map entry.");
200
+ "Unknown field name '%s' in initialization map entry.", name);
201
201
  }
202
202
 
203
203
  if (is_map_field(f)) {
@@ -205,7 +205,7 @@ int Message_initialize_kwarg(VALUE key, VALUE val, VALUE _self) {
205
205
 
206
206
  if (TYPE(val) != T_HASH) {
207
207
  rb_raise(rb_eArgError,
208
- "Expected Hash object as initializer value for map field.");
208
+ "Expected Hash object as initializer value for map field '%s'.", name);
209
209
  }
210
210
  map = layout_get(self->descriptor->layout, Message_data(self), f);
211
211
  Map_merge_into_self(map, val);
@@ -214,7 +214,7 @@ int Message_initialize_kwarg(VALUE key, VALUE val, VALUE _self) {
214
214
 
215
215
  if (TYPE(val) != T_ARRAY) {
216
216
  rb_raise(rb_eArgError,
217
- "Expected array as initializer value for repeated field.");
217
+ "Expected array as initializer value for repeated field '%s'.", name);
218
218
  }
219
219
  ary = layout_get(self->descriptor->layout, Message_data(self), f);
220
220
  for (int i = 0; i < RARRAY_LEN(val); i++) {
@@ -8537,7 +8537,7 @@ bool upb_pbdecoder_setmaxnesting(upb_pbdecoder *d, size_t max) {
8537
8537
  ** to perfectly match the output of reference encoders that always use the
8538
8538
  ** optimal amount of space for each length.
8539
8539
  **
8540
- ** (2) requires guessing the the size upfront, and if multiple lengths are
8540
+ ** (2) requires guessing the size upfront, and if multiple lengths are
8541
8541
  ** guessed wrong the minimum required number of memmove() operations may
8542
8542
  ** be complicated to compute correctly. Implemented properly, it may have
8543
8543
  ** a useful amortized or average cost, but more investigation is required
@@ -0,0 +1,17 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/any.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "google.protobuf.Any" do
8
+ optional :type_url, :string, 1
9
+ optional :value, :bytes, 2
10
+ end
11
+ end
12
+
13
+ module Google
14
+ module Protobuf
15
+ Any = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Any").msgclass
16
+ end
17
+ end
@@ -0,0 +1,39 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/api.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/protobuf/source_context'
7
+ require 'google/protobuf/type'
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_message "google.protobuf.Api" do
10
+ optional :name, :string, 1
11
+ repeated :methods, :message, 2, "google.protobuf.Method"
12
+ repeated :options, :message, 3, "google.protobuf.Option"
13
+ optional :version, :string, 4
14
+ optional :source_context, :message, 5, "google.protobuf.SourceContext"
15
+ repeated :mixins, :message, 6, "google.protobuf.Mixin"
16
+ optional :syntax, :enum, 7, "google.protobuf.Syntax"
17
+ end
18
+ add_message "google.protobuf.Method" do
19
+ optional :name, :string, 1
20
+ optional :request_type_url, :string, 2
21
+ optional :request_streaming, :bool, 3
22
+ optional :response_type_url, :string, 4
23
+ optional :response_streaming, :bool, 5
24
+ repeated :options, :message, 6, "google.protobuf.Option"
25
+ optional :syntax, :enum, 7, "google.protobuf.Syntax"
26
+ end
27
+ add_message "google.protobuf.Mixin" do
28
+ optional :name, :string, 1
29
+ optional :root, :string, 2
30
+ end
31
+ end
32
+
33
+ module Google
34
+ module Protobuf
35
+ Api = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Api").msgclass
36
+ Method = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Method").msgclass
37
+ Mixin = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Mixin").msgclass
38
+ end
39
+ end
@@ -0,0 +1,17 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/duration.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "google.protobuf.Duration" do
8
+ optional :seconds, :int64, 1
9
+ optional :nanos, :int32, 2
10
+ end
11
+ end
12
+
13
+ module Google
14
+ module Protobuf
15
+ Duration = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Duration").msgclass
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/empty.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "google.protobuf.Empty" do
8
+ end
9
+ end
10
+
11
+ module Google
12
+ module Protobuf
13
+ Empty = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Empty").msgclass
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/field_mask.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "google.protobuf.FieldMask" do
8
+ repeated :paths, :string, 1
9
+ end
10
+ end
11
+
12
+ module Google
13
+ module Protobuf
14
+ FieldMask = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldMask").msgclass
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/source_context.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "google.protobuf.SourceContext" do
8
+ optional :file_name, :string, 1
9
+ end
10
+ end
11
+
12
+ module Google
13
+ module Protobuf
14
+ SourceContext = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceContext").msgclass
15
+ end
16
+ end
@@ -0,0 +1,35 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/struct.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "google.protobuf.Struct" do
8
+ map :fields, :string, :message, 1, "google.protobuf.Value"
9
+ end
10
+ add_message "google.protobuf.Value" do
11
+ oneof :kind do
12
+ optional :null_value, :enum, 1, "google.protobuf.NullValue"
13
+ optional :number_value, :double, 2
14
+ optional :string_value, :string, 3
15
+ optional :bool_value, :bool, 4
16
+ optional :struct_value, :message, 5, "google.protobuf.Struct"
17
+ optional :list_value, :message, 6, "google.protobuf.ListValue"
18
+ end
19
+ end
20
+ add_message "google.protobuf.ListValue" do
21
+ repeated :values, :message, 1, "google.protobuf.Value"
22
+ end
23
+ add_enum "google.protobuf.NullValue" do
24
+ value :NULL_VALUE, 0
25
+ end
26
+ end
27
+
28
+ module Google
29
+ module Protobuf
30
+ Struct = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Struct").msgclass
31
+ Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Value").msgclass
32
+ ListValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ListValue").msgclass
33
+ NullValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.NullValue").enummodule
34
+ end
35
+ end
@@ -0,0 +1,17 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/timestamp.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "google.protobuf.Timestamp" do
8
+ optional :seconds, :int64, 1
9
+ optional :nanos, :int32, 2
10
+ end
11
+ end
12
+
13
+ module Google
14
+ module Protobuf
15
+ Timestamp = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Timestamp").msgclass
16
+ end
17
+ end
@@ -0,0 +1,89 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/type.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/protobuf/any'
7
+ require 'google/protobuf/source_context'
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_message "google.protobuf.Type" do
10
+ optional :name, :string, 1
11
+ repeated :fields, :message, 2, "google.protobuf.Field"
12
+ repeated :oneofs, :string, 3
13
+ repeated :options, :message, 4, "google.protobuf.Option"
14
+ optional :source_context, :message, 5, "google.protobuf.SourceContext"
15
+ optional :syntax, :enum, 6, "google.protobuf.Syntax"
16
+ end
17
+ add_message "google.protobuf.Field" do
18
+ optional :kind, :enum, 1, "google.protobuf.Field.Kind"
19
+ optional :cardinality, :enum, 2, "google.protobuf.Field.Cardinality"
20
+ optional :number, :int32, 3
21
+ optional :name, :string, 4
22
+ optional :type_url, :string, 6
23
+ optional :oneof_index, :int32, 7
24
+ optional :packed, :bool, 8
25
+ repeated :options, :message, 9, "google.protobuf.Option"
26
+ optional :json_name, :string, 10
27
+ optional :default_value, :string, 11
28
+ end
29
+ add_enum "google.protobuf.Field.Kind" do
30
+ value :TYPE_UNKNOWN, 0
31
+ value :TYPE_DOUBLE, 1
32
+ value :TYPE_FLOAT, 2
33
+ value :TYPE_INT64, 3
34
+ value :TYPE_UINT64, 4
35
+ value :TYPE_INT32, 5
36
+ value :TYPE_FIXED64, 6
37
+ value :TYPE_FIXED32, 7
38
+ value :TYPE_BOOL, 8
39
+ value :TYPE_STRING, 9
40
+ value :TYPE_GROUP, 10
41
+ value :TYPE_MESSAGE, 11
42
+ value :TYPE_BYTES, 12
43
+ value :TYPE_UINT32, 13
44
+ value :TYPE_ENUM, 14
45
+ value :TYPE_SFIXED32, 15
46
+ value :TYPE_SFIXED64, 16
47
+ value :TYPE_SINT32, 17
48
+ value :TYPE_SINT64, 18
49
+ end
50
+ add_enum "google.protobuf.Field.Cardinality" do
51
+ value :CARDINALITY_UNKNOWN, 0
52
+ value :CARDINALITY_OPTIONAL, 1
53
+ value :CARDINALITY_REQUIRED, 2
54
+ value :CARDINALITY_REPEATED, 3
55
+ end
56
+ add_message "google.protobuf.Enum" do
57
+ optional :name, :string, 1
58
+ repeated :enumvalue, :message, 2, "google.protobuf.EnumValue"
59
+ repeated :options, :message, 3, "google.protobuf.Option"
60
+ optional :source_context, :message, 4, "google.protobuf.SourceContext"
61
+ optional :syntax, :enum, 5, "google.protobuf.Syntax"
62
+ end
63
+ add_message "google.protobuf.EnumValue" do
64
+ optional :name, :string, 1
65
+ optional :number, :int32, 2
66
+ repeated :options, :message, 3, "google.protobuf.Option"
67
+ end
68
+ add_message "google.protobuf.Option" do
69
+ optional :name, :string, 1
70
+ optional :value, :message, 2, "google.protobuf.Any"
71
+ end
72
+ add_enum "google.protobuf.Syntax" do
73
+ value :SYNTAX_PROTO2, 0
74
+ value :SYNTAX_PROTO3, 1
75
+ end
76
+ end
77
+
78
+ module Google
79
+ module Protobuf
80
+ Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Type").msgclass
81
+ Field = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field").msgclass
82
+ Field::Kind = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field.Kind").enummodule
83
+ Field::Cardinality = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field.Cardinality").enummodule
84
+ Enum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Enum").msgclass
85
+ EnumValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValue").msgclass
86
+ Option = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Option").msgclass
87
+ Syntax = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Syntax").enummodule
88
+ end
89
+ end
@@ -0,0 +1,48 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/wrappers.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "google.protobuf.DoubleValue" do
8
+ optional :value, :double, 1
9
+ end
10
+ add_message "google.protobuf.FloatValue" do
11
+ optional :value, :float, 1
12
+ end
13
+ add_message "google.protobuf.Int64Value" do
14
+ optional :value, :int64, 1
15
+ end
16
+ add_message "google.protobuf.UInt64Value" do
17
+ optional :value, :uint64, 1
18
+ end
19
+ add_message "google.protobuf.Int32Value" do
20
+ optional :value, :int32, 1
21
+ end
22
+ add_message "google.protobuf.UInt32Value" do
23
+ optional :value, :uint32, 1
24
+ end
25
+ add_message "google.protobuf.BoolValue" do
26
+ optional :value, :bool, 1
27
+ end
28
+ add_message "google.protobuf.StringValue" do
29
+ optional :value, :string, 1
30
+ end
31
+ add_message "google.protobuf.BytesValue" do
32
+ optional :value, :bytes, 1
33
+ end
34
+ end
35
+
36
+ module Google
37
+ module Protobuf
38
+ DoubleValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DoubleValue").msgclass
39
+ FloatValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FloatValue").msgclass
40
+ Int64Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Int64Value").msgclass
41
+ UInt64Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UInt64Value").msgclass
42
+ Int32Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Int32Value").msgclass
43
+ UInt32Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UInt32Value").msgclass
44
+ BoolValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.BoolValue").msgclass
45
+ StringValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.StringValue").msgclass
46
+ BytesValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.BytesValue").msgclass
47
+ end
48
+ end
@@ -191,6 +191,35 @@ module BasicTest
191
191
  assert m1.hash != m2.hash
192
192
  end
193
193
 
194
+ def test_unknown_field_errors
195
+ e = assert_raise NoMethodError do
196
+ TestMessage.new.hello
197
+ end
198
+ assert_match(/hello/, e.message)
199
+
200
+ e = assert_raise NoMethodError do
201
+ TestMessage.new.hello = "world"
202
+ end
203
+ assert_match(/hello/, e.message)
204
+ end
205
+
206
+ def test_initialization_map_errors
207
+ e = assert_raise ArgumentError do
208
+ TestMessage.new(:hello => "world")
209
+ end
210
+ assert_match(/hello/, e.message)
211
+
212
+ e = assert_raise ArgumentError do
213
+ MapMessage.new(:map_string_int32 => "hello")
214
+ end
215
+ assert_equal e.message, "Expected Hash object as initializer value for map field 'map_string_int32'."
216
+
217
+ e = assert_raise ArgumentError do
218
+ TestMessage.new(:repeated_uint32 => "hello")
219
+ end
220
+ assert_equal e.message, "Expected array as initializer value for repeated field 'repeated_uint32'."
221
+ end
222
+
194
223
  def test_type_errors
195
224
  m = TestMessage.new
196
225
  assert_raise TypeError do
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.0.0.alpha.5.0.3
4
+ version: 3.0.0.alpha.5.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Protobuf Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-11 00:00:00.000000000 Z
11
+ date: 2016-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler-dock
@@ -85,8 +85,18 @@ files:
85
85
  - ext/google/protobuf_c/upb.c
86
86
  - ext/google/protobuf_c/upb.h
87
87
  - lib/google/protobuf.rb
88
+ - lib/google/protobuf/any.rb
89
+ - lib/google/protobuf/api.rb
90
+ - lib/google/protobuf/duration.rb
91
+ - lib/google/protobuf/empty.rb
92
+ - lib/google/protobuf/field_mask.rb
88
93
  - lib/google/protobuf/message_exts.rb
89
94
  - lib/google/protobuf/repeated_field.rb
95
+ - lib/google/protobuf/source_context.rb
96
+ - lib/google/protobuf/struct.rb
97
+ - lib/google/protobuf/timestamp.rb
98
+ - lib/google/protobuf/type.rb
99
+ - lib/google/protobuf/wrappers.rb
90
100
  - tests/basic.rb
91
101
  - tests/generated_code_test.rb
92
102
  - tests/stress.rb