protobuf 3.7.0.pre2 → 3.7.0.pre3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -1
  3. data/.rubocop_todo.yml +7 -1
  4. data/.travis.yml +8 -1
  5. data/CHANGES.md +25 -1
  6. data/bin/protoc-gen-ruby +2 -2
  7. data/lib/protobuf/cli.rb +29 -17
  8. data/lib/protobuf/code_generator.rb +49 -1
  9. data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +9 -1
  10. data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +14 -1
  11. data/lib/protobuf/encoder.rb +2 -2
  12. data/lib/protobuf/enum.rb +3 -3
  13. data/lib/protobuf/field/base_field.rb +27 -19
  14. data/lib/protobuf/field/bool_field.rb +10 -8
  15. data/lib/protobuf/field/bytes_field.rb +14 -6
  16. data/lib/protobuf/field/float_field.rb +2 -0
  17. data/lib/protobuf/field/string_field.rb +10 -0
  18. data/lib/protobuf/field/varint_field.rb +12 -2
  19. data/lib/protobuf/generators/base.rb +29 -14
  20. data/lib/protobuf/generators/enum_generator.rb +4 -7
  21. data/lib/protobuf/generators/field_generator.rb +17 -4
  22. data/lib/protobuf/generators/file_generator.rb +121 -10
  23. data/lib/protobuf/generators/group_generator.rb +9 -3
  24. data/lib/protobuf/generators/message_generator.rb +8 -2
  25. data/lib/protobuf/generators/option_generator.rb +17 -0
  26. data/lib/protobuf/generators/printable.rb +2 -2
  27. data/lib/protobuf/generators/service_generator.rb +27 -3
  28. data/lib/protobuf/lifecycle.rb +1 -1
  29. data/lib/protobuf/message/fields.rb +13 -15
  30. data/lib/protobuf/message/serialization.rb +9 -9
  31. data/lib/protobuf/message.rb +23 -29
  32. data/lib/protobuf/optionable.rb +10 -10
  33. data/lib/protobuf/rpc/buffer.rb +7 -6
  34. data/lib/protobuf/rpc/client.rb +2 -30
  35. data/lib/protobuf/rpc/connectors/base.rb +168 -6
  36. data/lib/protobuf/rpc/connectors/ping.rb +2 -2
  37. data/lib/protobuf/rpc/connectors/socket.rb +6 -1
  38. data/lib/protobuf/rpc/connectors/zmq.rb +1 -2
  39. data/lib/protobuf/rpc/dynamic_discovery.pb.rb +2 -1
  40. data/lib/protobuf/rpc/error.rb +2 -2
  41. data/lib/protobuf/rpc/middleware/exception_handler.rb +4 -0
  42. data/lib/protobuf/rpc/middleware/logger.rb +4 -0
  43. data/lib/protobuf/rpc/middleware/request_decoder.rb +11 -16
  44. data/lib/protobuf/rpc/middleware/response_encoder.rb +18 -23
  45. data/lib/protobuf/rpc/rpc.pb.rb +2 -1
  46. data/lib/protobuf/rpc/rpc_method.rb +16 -0
  47. data/lib/protobuf/rpc/servers/socket/server.rb +4 -4
  48. data/lib/protobuf/rpc/servers/socket_runner.rb +8 -0
  49. data/lib/protobuf/rpc/servers/zmq/broker.rb +7 -6
  50. data/lib/protobuf/rpc/servers/zmq/server.rb +8 -7
  51. data/lib/protobuf/rpc/servers/zmq/util.rb +6 -6
  52. data/lib/protobuf/rpc/servers/zmq/worker.rb +7 -6
  53. data/lib/protobuf/rpc/servers/zmq_runner.rb +8 -0
  54. data/lib/protobuf/rpc/service.rb +6 -15
  55. data/lib/protobuf/rpc/service_directory.rb +1 -1
  56. data/lib/protobuf/rpc/service_dispatcher.rb +5 -6
  57. data/lib/protobuf/rpc/service_filters.rb +8 -30
  58. data/lib/protobuf/socket.rb +2 -2
  59. data/lib/protobuf/version.rb +1 -1
  60. data/lib/protobuf/zmq.rb +2 -2
  61. data/lib/protobuf.rb +12 -27
  62. data/protobuf.gemspec +5 -3
  63. data/spec/benchmark/tasks.rb +1 -0
  64. data/spec/functional/code_generator_spec.rb +38 -0
  65. data/spec/lib/protobuf/cli_spec.rb +19 -10
  66. data/spec/lib/protobuf/code_generator_spec.rb +28 -0
  67. data/spec/lib/protobuf/enum_spec.rb +6 -2
  68. data/spec/lib/protobuf/field/bool_field_spec.rb +4 -0
  69. data/spec/lib/protobuf/field/double_field_spec.rb +9 -0
  70. data/spec/lib/protobuf/field/fixed32_field_spec.rb +7 -0
  71. data/spec/lib/protobuf/field/fixed64_field_spec.rb +7 -0
  72. data/spec/lib/protobuf/field/float_field_spec.rb +5 -1
  73. data/spec/lib/protobuf/field/int64_field_spec.rb +7 -0
  74. data/spec/lib/protobuf/field/message_field_spec.rb +53 -0
  75. data/spec/lib/protobuf/field/sfixed32_field_spec.rb +9 -0
  76. data/spec/lib/protobuf/field/sfixed64_field_spec.rb +9 -0
  77. data/spec/lib/protobuf/field/sint32_field_spec.rb +9 -0
  78. data/spec/lib/protobuf/field/sint64_field_spec.rb +9 -0
  79. data/spec/lib/protobuf/field/uint32_field_spec.rb +7 -0
  80. data/spec/lib/protobuf/field/uint64_field_spec.rb +7 -0
  81. data/spec/lib/protobuf/generators/base_spec.rb +69 -1
  82. data/spec/lib/protobuf/generators/enum_generator_spec.rb +1 -1
  83. data/spec/lib/protobuf/generators/field_generator_spec.rb +58 -0
  84. data/spec/lib/protobuf/generators/file_generator_spec.rb +47 -0
  85. data/spec/lib/protobuf/generators/service_generator_spec.rb +58 -14
  86. data/spec/lib/protobuf/message_spec.rb +2 -2
  87. data/spec/lib/protobuf/optionable_spec.rb +96 -0
  88. data/spec/lib/protobuf/rpc/connectors/base_spec.rb +151 -0
  89. data/spec/lib/protobuf/rpc/connectors/ping_spec.rb +3 -3
  90. data/spec/lib/protobuf/rpc/connectors/socket_spec.rb +0 -2
  91. data/spec/lib/protobuf/rpc/middleware/logger_spec.rb +2 -2
  92. data/spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb +4 -4
  93. data/spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb +2 -2
  94. data/spec/lib/protobuf/rpc/service_dispatcher_spec.rb +1 -18
  95. data/spec/lib/protobuf/rpc/service_filters_spec.rb +2 -2
  96. data/spec/lib/protobuf/varint_spec.rb +1 -1
  97. data/spec/lib/protobuf_spec.rb +13 -16
  98. data/spec/support/packed_field.rb +3 -2
  99. data/spec/support/protos/enum.pb.rb +2 -1
  100. data/spec/support/protos/enum.proto +1 -0
  101. data/spec/support/protos/google_unittest.pb.rb +69 -58
  102. data/spec/support/protos/google_unittest_custom_options.bin +0 -0
  103. data/spec/support/protos/google_unittest_custom_options.pb.rb +361 -0
  104. data/spec/support/protos/google_unittest_custom_options.proto +424 -0
  105. data/spec/support/protos/google_unittest_import.pb.rb +8 -0
  106. data/spec/support/protos/google_unittest_import_public.pb.rb +6 -0
  107. data/spec/support/protos/resource.pb.rb +54 -2
  108. data/spec/support/protos/resource.proto +42 -2
  109. data/spec/support/server.rb +1 -1
  110. metadata +39 -16
  111. data/lib/protobuf/rpc/connector.rb +0 -19
  112. data/lib/protobuf/rpc/connectors/common.rb +0 -176
  113. data/spec/lib/protobuf/rpc/connector_spec.rb +0 -26
  114. data/spec/lib/protobuf/rpc/connectors/common_spec.rb +0 -170
@@ -0,0 +1,361 @@
1
+ # encoding: utf-8
2
+
3
+ ##
4
+ # This file is auto-generated. DO NOT EDIT!
5
+ #
6
+ require 'protobuf'
7
+ require 'protobuf/rpc/service'
8
+
9
+
10
+ ##
11
+ # Imports
12
+ #
13
+ require 'google/protobuf/descriptor.pb'
14
+
15
+ module Protobuf_unittest
16
+ ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::FileOptions }
17
+
18
+ ##
19
+ # Enum Classes
20
+ #
21
+ class MethodOpt1 < ::Protobuf::Enum
22
+ define :METHODOPT1_VAL1, 1
23
+ define :METHODOPT1_VAL2, 2
24
+ end
25
+
26
+ class AggregateEnum < ::Protobuf::Enum
27
+ set_option :".protobuf_unittest.enumopt", { :s => "EnumAnnotation" }
28
+
29
+ define :VALUE, 1
30
+ end
31
+
32
+
33
+ ##
34
+ # Message Classes
35
+ #
36
+ class TestMessageWithCustomOptions < ::Protobuf::Message
37
+ class AnEnum < ::Protobuf::Enum
38
+ set_option :".protobuf_unittest.enum_opt1", -789
39
+
40
+ define :ANENUM_VAL1, 1
41
+ define :ANENUM_VAL2, 2
42
+ end
43
+
44
+ end
45
+
46
+ class CustomOptionFooRequest < ::Protobuf::Message; end
47
+ class CustomOptionFooResponse < ::Protobuf::Message; end
48
+ class CustomOptionFooClientMessage < ::Protobuf::Message; end
49
+ class CustomOptionFooServerMessage < ::Protobuf::Message; end
50
+ class DummyMessageContainingEnum < ::Protobuf::Message
51
+ class TestEnumType < ::Protobuf::Enum
52
+ define :TEST_OPTION_ENUM_TYPE1, 22
53
+ define :TEST_OPTION_ENUM_TYPE2, -23
54
+ end
55
+
56
+ end
57
+
58
+ class DummyMessageInvalidAsOptionType < ::Protobuf::Message; end
59
+ class CustomOptionMinIntegerValues < ::Protobuf::Message; end
60
+ class CustomOptionMaxIntegerValues < ::Protobuf::Message; end
61
+ class CustomOptionOtherValues < ::Protobuf::Message; end
62
+ class SettingRealsFromPositiveInts < ::Protobuf::Message; end
63
+ class SettingRealsFromNegativeInts < ::Protobuf::Message; end
64
+ class ComplexOptionType1 < ::Protobuf::Message; end
65
+ class ComplexOptionType2 < ::Protobuf::Message
66
+ class ComplexOptionType4 < ::Protobuf::Message; end
67
+
68
+ end
69
+
70
+ class ComplexOptionType3 < ::Protobuf::Message; end
71
+ class VariousComplexOptions < ::Protobuf::Message; end
72
+ class AggregateMessageSet < ::Protobuf::Message; end
73
+ class AggregateMessageSetElement < ::Protobuf::Message; end
74
+ class Aggregate < ::Protobuf::Message; end
75
+ class AggregateMessage < ::Protobuf::Message; end
76
+ class NestedOptionType < ::Protobuf::Message
77
+ class NestedEnum < ::Protobuf::Enum
78
+ set_option :".protobuf_unittest.enum_opt1", 1003
79
+
80
+ define :NESTED_ENUM_VALUE, 1
81
+ end
82
+
83
+ class NestedMessage < ::Protobuf::Message; end
84
+
85
+ end
86
+
87
+ class OldOptionType < ::Protobuf::Message
88
+ class TestEnum < ::Protobuf::Enum
89
+ define :OLD_VALUE, 0
90
+ end
91
+
92
+ end
93
+
94
+ class NewOptionType < ::Protobuf::Message
95
+ class TestEnum < ::Protobuf::Enum
96
+ define :OLD_VALUE, 0
97
+ define :NEW_VALUE, 1
98
+ end
99
+
100
+ end
101
+
102
+ class TestMessageWithRequiredEnumOption < ::Protobuf::Message; end
103
+
104
+
105
+ ##
106
+ # File Options
107
+ #
108
+ set_option :cc_generic_services, true
109
+ set_option :java_generic_services, true
110
+ set_option :py_generic_services, true
111
+ set_option :".protobuf_unittest.file_opt1", 9876543210
112
+ set_option :".protobuf_unittest.fileopt", { :i => 100, :s => "FileAnnotation", :sub => { :s => "NestedFileAnnotation" }, :file => { :".protobuf_unittest.fileopt" => { :s => "FileExtensionAnnotation" } }, :mset => { :".protobuf_unittest.AggregateMessageSetElement.message_set_extension" => { :s => "EmbeddedMessageSetElement" } } }
113
+
114
+
115
+ ##
116
+ # Message Fields
117
+ #
118
+ class TestMessageWithCustomOptions
119
+ # Message Options
120
+ set_option :message_set_wire_format, false
121
+ set_option :".protobuf_unittest.message_opt1", -56
122
+
123
+ optional :string, :field1, 1, :ctype => ::Google::Protobuf::FieldOptions::CType::CORD, :".protobuf_unittest.field_opt1" => 8765432109
124
+ end
125
+
126
+ class CustomOptionMinIntegerValues
127
+ # Message Options
128
+ set_option :".protobuf_unittest.sfixed64_opt", -9223372036854775808
129
+ set_option :".protobuf_unittest.sfixed32_opt", -2147483648
130
+ set_option :".protobuf_unittest.fixed64_opt", 0
131
+ set_option :".protobuf_unittest.fixed32_opt", 0
132
+ set_option :".protobuf_unittest.sint64_opt", -9223372036854775808
133
+ set_option :".protobuf_unittest.sint32_opt", -2147483648
134
+ set_option :".protobuf_unittest.uint64_opt", 0
135
+ set_option :".protobuf_unittest.uint32_opt", 0
136
+ set_option :".protobuf_unittest.int64_opt", -9223372036854775808
137
+ set_option :".protobuf_unittest.int32_opt", -2147483648
138
+ set_option :".protobuf_unittest.bool_opt", false
139
+
140
+ end
141
+
142
+ class CustomOptionMaxIntegerValues
143
+ # Message Options
144
+ set_option :".protobuf_unittest.sfixed64_opt", 9223372036854775807
145
+ set_option :".protobuf_unittest.sfixed32_opt", 2147483647
146
+ set_option :".protobuf_unittest.fixed64_opt", 18446744073709551615
147
+ set_option :".protobuf_unittest.fixed32_opt", 4294967295
148
+ set_option :".protobuf_unittest.sint64_opt", 9223372036854775807
149
+ set_option :".protobuf_unittest.sint32_opt", 2147483647
150
+ set_option :".protobuf_unittest.uint64_opt", 18446744073709551615
151
+ set_option :".protobuf_unittest.uint32_opt", 4294967295
152
+ set_option :".protobuf_unittest.int64_opt", 9223372036854775807
153
+ set_option :".protobuf_unittest.int32_opt", 2147483647
154
+ set_option :".protobuf_unittest.bool_opt", true
155
+
156
+ end
157
+
158
+ class CustomOptionOtherValues
159
+ # Message Options
160
+ set_option :".protobuf_unittest.enum_opt", ::Protobuf_unittest::DummyMessageContainingEnum::TestEnumType::TEST_OPTION_ENUM_TYPE2
161
+ set_option :".protobuf_unittest.bytes_opt", "Hello\x00World"
162
+ set_option :".protobuf_unittest.string_opt", "Hello, \"World\""
163
+ set_option :".protobuf_unittest.double_opt", 1.2345678901234567
164
+ set_option :".protobuf_unittest.float_opt", 12.34567928314209
165
+ set_option :".protobuf_unittest.int32_opt", -100
166
+
167
+ end
168
+
169
+ class SettingRealsFromPositiveInts
170
+ # Message Options
171
+ set_option :".protobuf_unittest.double_opt", 154.0
172
+ set_option :".protobuf_unittest.float_opt", 12.0
173
+
174
+ end
175
+
176
+ class SettingRealsFromNegativeInts
177
+ # Message Options
178
+ set_option :".protobuf_unittest.double_opt", -154.0
179
+ set_option :".protobuf_unittest.float_opt", -12.0
180
+
181
+ end
182
+
183
+ class ComplexOptionType1
184
+ optional :int32, :foo, 1
185
+ optional :int32, :foo2, 2
186
+ optional :int32, :foo3, 3
187
+ repeated :int32, :foo4, 4
188
+ # Extension Fields
189
+ extensions 100...536870912
190
+ optional :int32, :".protobuf_unittest.quux", 7663707, :extension => true
191
+ optional ::Protobuf_unittest::ComplexOptionType3, :".protobuf_unittest.corge", 7663442, :extension => true
192
+ end
193
+
194
+ class ComplexOptionType2
195
+ class ComplexOptionType4
196
+ optional :int32, :waldo, 1
197
+ end
198
+
199
+ optional ::Protobuf_unittest::ComplexOptionType1, :bar, 1
200
+ optional :int32, :baz, 2
201
+ optional ::Protobuf_unittest::ComplexOptionType2::ComplexOptionType4, :fred, 3
202
+ repeated ::Protobuf_unittest::ComplexOptionType2::ComplexOptionType4, :barney, 4
203
+ # Extension Fields
204
+ extensions 100...536870912
205
+ optional :int32, :".protobuf_unittest.grault", 7650927, :extension => true
206
+ optional ::Protobuf_unittest::ComplexOptionType1, :".protobuf_unittest.garply", 7649992, :extension => true
207
+ end
208
+
209
+ class ComplexOptionType3
210
+ optional :int32, :qux, 1
211
+ end
212
+
213
+ class VariousComplexOptions
214
+ # Message Options
215
+ set_option :".protobuf_unittest.ComplexOptionType2.ComplexOptionType4.complex_opt4", { :waldo => 1971 }
216
+ set_option :".protobuf_unittest.complex_opt3", { :qux => 9 }
217
+ set_option :".protobuf_unittest.repeated_opt1", [1, 2]
218
+ set_option :".protobuf_unittest.repeated_opt2", [{ :qux => 3 }, { :qux => 4 }]
219
+ set_option :".protobuf_unittest.complex_opt2", { :bar => { :foo => 743, :".protobuf_unittest.corge" => { :qux => 2008 }, :".protobuf_unittest.quux" => 1999 }, :baz => 987, :fred => { :waldo => 321 }, :barney => [{ :waldo => 101 }, { :waldo => 212 }], :".protobuf_unittest.garply" => { :foo => 741, :".protobuf_unittest.corge" => { :qux => 2121 }, :".protobuf_unittest.quux" => 1998 }, :".protobuf_unittest.grault" => 654 }
220
+ set_option :".protobuf_unittest.complex_opt1", { :foo => 42, :foo4 => [99, 88], :".protobuf_unittest.corge" => { :qux => 876 }, :".protobuf_unittest.quux" => 324 }
221
+
222
+ end
223
+
224
+ class AggregateMessageSet
225
+ # Message Options
226
+ set_option :message_set_wire_format, false
227
+
228
+ # Extension Fields
229
+ extensions 4...536870912
230
+ optional ::Protobuf_unittest::AggregateMessageSetElement, :".protobuf_unittest.AggregateMessageSetElement.message_set_extension", 15447542, :extension => true
231
+ end
232
+
233
+ class AggregateMessageSetElement
234
+ optional :string, :s, 1
235
+ end
236
+
237
+ class Aggregate
238
+ optional :int32, :i, 1
239
+ optional :string, :s, 2
240
+ optional ::Protobuf_unittest::Aggregate, :sub, 3
241
+ optional ::Google::Protobuf::FileOptions, :file, 4
242
+ optional ::Protobuf_unittest::AggregateMessageSet, :mset, 5
243
+ end
244
+
245
+ class AggregateMessage
246
+ # Message Options
247
+ set_option :".protobuf_unittest.msgopt", { :i => 101, :s => "MessageAnnotation" }
248
+
249
+ optional :int32, :fieldname, 1, :".protobuf_unittest.fieldopt" => { :s => "FieldAnnotation" }
250
+ end
251
+
252
+ class NestedOptionType
253
+ class NestedMessage
254
+ # Message Options
255
+ set_option :".protobuf_unittest.message_opt1", 1001
256
+
257
+ optional :int32, :nested_field, 1, :".protobuf_unittest.field_opt1" => 1002
258
+ end
259
+
260
+ end
261
+
262
+ class OldOptionType
263
+ required ::Protobuf_unittest::OldOptionType::TestEnum, :value, 1
264
+ end
265
+
266
+ class NewOptionType
267
+ required ::Protobuf_unittest::NewOptionType::TestEnum, :value, 1
268
+ end
269
+
270
+ class TestMessageWithRequiredEnumOption
271
+ # Message Options
272
+ set_option :".protobuf_unittest.required_enum_opt", { :value => ::Protobuf_unittest::OldOptionType::TestEnum::OLD_VALUE }
273
+
274
+ end
275
+
276
+
277
+ ##
278
+ # Extended Message Fields
279
+ #
280
+ class ::Google::Protobuf::FileOptions < ::Protobuf::Message
281
+ optional :uint64, :".protobuf_unittest.file_opt1", 7736974, :extension => true
282
+ optional ::Protobuf_unittest::Aggregate, :".protobuf_unittest.fileopt", 15478479, :extension => true
283
+ optional ::Protobuf_unittest::Aggregate, :".protobuf_unittest.Aggregate.nested", 15476903, :extension => true
284
+ optional :int32, :".protobuf_unittest.NestedOptionType.nested_extension", 7912573, :extension => true, :".protobuf_unittest.field_opt2" => 1005
285
+ end
286
+
287
+ class ::Google::Protobuf::MessageOptions < ::Protobuf::Message
288
+ optional :int32, :".protobuf_unittest.message_opt1", 7739036, :extension => true
289
+ optional :bool, :".protobuf_unittest.bool_opt", 7706090, :extension => true
290
+ optional :int32, :".protobuf_unittest.int32_opt", 7705709, :extension => true
291
+ optional :int64, :".protobuf_unittest.int64_opt", 7705542, :extension => true
292
+ optional :uint32, :".protobuf_unittest.uint32_opt", 7704880, :extension => true
293
+ optional :uint64, :".protobuf_unittest.uint64_opt", 7702367, :extension => true
294
+ optional :sint32, :".protobuf_unittest.sint32_opt", 7701568, :extension => true
295
+ optional :sint64, :".protobuf_unittest.sint64_opt", 7700863, :extension => true
296
+ optional :fixed32, :".protobuf_unittest.fixed32_opt", 7700307, :extension => true
297
+ optional :fixed64, :".protobuf_unittest.fixed64_opt", 7700194, :extension => true
298
+ optional :sfixed32, :".protobuf_unittest.sfixed32_opt", 7698645, :extension => true
299
+ optional :sfixed64, :".protobuf_unittest.sfixed64_opt", 7685475, :extension => true
300
+ optional :float, :".protobuf_unittest.float_opt", 7675390, :extension => true
301
+ optional :double, :".protobuf_unittest.double_opt", 7673293, :extension => true
302
+ optional :string, :".protobuf_unittest.string_opt", 7673285, :extension => true
303
+ optional :bytes, :".protobuf_unittest.bytes_opt", 7673238, :extension => true
304
+ optional ::Protobuf_unittest::DummyMessageContainingEnum::TestEnumType, :".protobuf_unittest.enum_opt", 7673233, :extension => true
305
+ optional ::Protobuf_unittest::DummyMessageInvalidAsOptionType, :".protobuf_unittest.message_type_opt", 7665967, :extension => true
306
+ optional ::Protobuf_unittest::ComplexOptionType1, :".protobuf_unittest.complex_opt1", 7646756, :extension => true
307
+ optional ::Protobuf_unittest::ComplexOptionType2, :".protobuf_unittest.complex_opt2", 7636949, :extension => true
308
+ optional ::Protobuf_unittest::ComplexOptionType3, :".protobuf_unittest.complex_opt3", 7636463, :extension => true
309
+ repeated :int32, :".protobuf_unittest.repeated_opt1", 7636464, :extension => true
310
+ repeated ::Protobuf_unittest::ComplexOptionType3, :".protobuf_unittest.repeated_opt2", 7636465, :extension => true
311
+ optional ::Protobuf_unittest::Aggregate, :".protobuf_unittest.msgopt", 15480088, :extension => true
312
+ optional ::Protobuf_unittest::OldOptionType, :".protobuf_unittest.required_enum_opt", 106161807, :extension => true
313
+ optional ::Protobuf_unittest::ComplexOptionType2::ComplexOptionType4, :".protobuf_unittest.ComplexOptionType2.ComplexOptionType4.complex_opt4", 7633546, :extension => true
314
+ end
315
+
316
+ class ::Google::Protobuf::FieldOptions < ::Protobuf::Message
317
+ optional :fixed64, :".protobuf_unittest.field_opt1", 7740936, :extension => true
318
+ optional :int32, :".protobuf_unittest.field_opt2", 7753913, :default => 42, :extension => true
319
+ optional ::Protobuf_unittest::Aggregate, :".protobuf_unittest.fieldopt", 15481374, :extension => true
320
+ end
321
+
322
+ class ::Google::Protobuf::EnumOptions < ::Protobuf::Message
323
+ optional :sfixed32, :".protobuf_unittest.enum_opt1", 7753576, :extension => true
324
+ optional ::Protobuf_unittest::Aggregate, :".protobuf_unittest.enumopt", 15483218, :extension => true
325
+ end
326
+
327
+ class ::Google::Protobuf::EnumValueOptions < ::Protobuf::Message
328
+ optional :int32, :".protobuf_unittest.enum_value_opt1", 1560678, :extension => true
329
+ optional ::Protobuf_unittest::Aggregate, :".protobuf_unittest.enumvalopt", 15486921, :extension => true
330
+ end
331
+
332
+ class ::Google::Protobuf::ServiceOptions < ::Protobuf::Message
333
+ optional :sint64, :".protobuf_unittest.service_opt1", 7887650, :extension => true
334
+ optional ::Protobuf_unittest::Aggregate, :".protobuf_unittest.serviceopt", 15497145, :extension => true
335
+ end
336
+
337
+ class ::Google::Protobuf::MethodOptions < ::Protobuf::Message
338
+ optional ::Protobuf_unittest::MethodOpt1, :".protobuf_unittest.method_opt1", 7890860, :extension => true
339
+ optional ::Protobuf_unittest::Aggregate, :".protobuf_unittest.methodopt", 15512713, :extension => true
340
+ end
341
+
342
+
343
+ ##
344
+ # Service Classes
345
+ #
346
+ class TestServiceWithCustomOptions < ::Protobuf::Rpc::Service
347
+ set_option :".protobuf_unittest.service_opt1", -9876543210
348
+ rpc :foo, ::Protobuf_unittest::CustomOptionFooRequest, ::Protobuf_unittest::CustomOptionFooResponse do
349
+ set_option :".protobuf_unittest.method_opt1", ::Protobuf_unittest::MethodOpt1::METHODOPT1_VAL2
350
+ end
351
+ end
352
+
353
+ class AggregateService < ::Protobuf::Rpc::Service
354
+ set_option :".protobuf_unittest.serviceopt", { :s => "ServiceAnnotation" }
355
+ rpc :method, ::Protobuf_unittest::AggregateMessage, ::Protobuf_unittest::AggregateMessage do
356
+ set_option :".protobuf_unittest.methodopt", { :s => "MethodAnnotation" }
357
+ end
358
+ end
359
+
360
+ end
361
+