google-protobuf 3.4.0.2 → 3.19.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.

Files changed (41) hide show
  1. checksums.yaml +5 -5
  2. data/ext/google/protobuf_c/convert.c +348 -0
  3. data/ext/google/protobuf_c/convert.h +72 -0
  4. data/ext/google/protobuf_c/defs.c +709 -1188
  5. data/ext/google/protobuf_c/defs.h +107 -0
  6. data/ext/google/protobuf_c/extconf.rb +7 -4
  7. data/ext/google/protobuf_c/map.c +316 -463
  8. data/ext/google/protobuf_c/map.h +67 -0
  9. data/ext/google/protobuf_c/message.c +993 -296
  10. data/ext/google/protobuf_c/message.h +101 -0
  11. data/ext/google/protobuf_c/protobuf.c +403 -50
  12. data/ext/google/protobuf_c/protobuf.h +47 -473
  13. data/ext/google/protobuf_c/repeated_field.c +314 -309
  14. data/ext/google/protobuf_c/repeated_field.h +63 -0
  15. data/ext/google/protobuf_c/ruby-upb.c +9171 -0
  16. data/ext/google/protobuf_c/ruby-upb.h +4704 -0
  17. data/ext/google/protobuf_c/wrap_memcpy.c +1 -1
  18. data/lib/google/protobuf/any_pb.rb +6 -4
  19. data/lib/google/protobuf/api_pb.rb +27 -24
  20. data/lib/google/protobuf/descriptor_dsl.rb +458 -0
  21. data/lib/google/protobuf/descriptor_pb.rb +268 -0
  22. data/lib/google/protobuf/duration_pb.rb +6 -4
  23. data/lib/google/protobuf/empty_pb.rb +4 -2
  24. data/lib/google/protobuf/field_mask_pb.rb +5 -3
  25. data/lib/google/protobuf/message_exts.rb +2 -2
  26. data/lib/google/protobuf/repeated_field.rb +3 -3
  27. data/lib/google/protobuf/source_context_pb.rb +5 -3
  28. data/lib/google/protobuf/struct_pb.rb +23 -21
  29. data/lib/google/protobuf/timestamp_pb.rb +6 -4
  30. data/lib/google/protobuf/type_pb.rb +77 -74
  31. data/lib/google/protobuf/well_known_types.rb +25 -2
  32. data/lib/google/protobuf/wrappers_pb.rb +37 -35
  33. data/lib/google/protobuf.rb +7 -4
  34. data/tests/basic.rb +432 -1115
  35. data/tests/generated_code_test.rb +6 -2
  36. data/tests/stress.rb +1 -1
  37. metadata +22 -30
  38. data/ext/google/protobuf_c/encode_decode.c +0 -1311
  39. data/ext/google/protobuf_c/storage.c +0 -893
  40. data/ext/google/protobuf_c/upb.c +0 -13911
  41. data/ext/google/protobuf_c/upb.h +0 -8872
@@ -0,0 +1,268 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/descriptor.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ descriptor_data = File.binread(__FILE__).split("\n__END__\n", 2)[1]
7
+ Google::Protobuf::DescriptorPool.generated_pool.add_serialized_file(descriptor_data)
8
+
9
+ module Google
10
+ module Protobuf
11
+ FileDescriptorSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileDescriptorSet").msgclass
12
+ FileDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileDescriptorProto").msgclass
13
+ DescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DescriptorProto").msgclass
14
+ DescriptorProto::ExtensionRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DescriptorProto.ExtensionRange").msgclass
15
+ DescriptorProto::ReservedRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DescriptorProto.ReservedRange").msgclass
16
+ ExtensionRangeOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ExtensionRangeOptions").msgclass
17
+ FieldDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldDescriptorProto").msgclass
18
+ FieldDescriptorProto::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldDescriptorProto.Type").enummodule
19
+ FieldDescriptorProto::Label = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldDescriptorProto.Label").enummodule
20
+ OneofDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.OneofDescriptorProto").msgclass
21
+ EnumDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumDescriptorProto").msgclass
22
+ EnumDescriptorProto::EnumReservedRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumDescriptorProto.EnumReservedRange").msgclass
23
+ EnumValueDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValueDescriptorProto").msgclass
24
+ ServiceDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ServiceDescriptorProto").msgclass
25
+ MethodDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MethodDescriptorProto").msgclass
26
+ FileOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileOptions").msgclass
27
+ FileOptions::OptimizeMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileOptions.OptimizeMode").enummodule
28
+ MessageOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MessageOptions").msgclass
29
+ FieldOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldOptions").msgclass
30
+ FieldOptions::CType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldOptions.CType").enummodule
31
+ FieldOptions::JSType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldOptions.JSType").enummodule
32
+ OneofOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.OneofOptions").msgclass
33
+ EnumOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumOptions").msgclass
34
+ EnumValueOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValueOptions").msgclass
35
+ ServiceOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ServiceOptions").msgclass
36
+ MethodOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MethodOptions").msgclass
37
+ MethodOptions::IdempotencyLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MethodOptions.IdempotencyLevel").enummodule
38
+ UninterpretedOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UninterpretedOption").msgclass
39
+ UninterpretedOption::NamePart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UninterpretedOption.NamePart").msgclass
40
+ SourceCodeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceCodeInfo").msgclass
41
+ SourceCodeInfo::Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceCodeInfo.Location").msgclass
42
+ GeneratedCodeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.GeneratedCodeInfo").msgclass
43
+ GeneratedCodeInfo::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.GeneratedCodeInfo.Annotation").msgclass
44
+ end
45
+ end
46
+
47
+ __END__
48
+
49
+ google/protobuf/descriptor.protogoogle.protobuf"G
50
+ FileDescriptorSet2
51
+ file ( 2$.google.protobuf.FileDescriptorProto"�
52
+ FileDescriptorProto
53
+ name ( 
54
+ package ( 
55
+
56
+ dependency ( 
57
+ public_dependency
58
+ (
59
+ weak_dependency (6
60
+ message_type ( 2 .google.protobuf.DescriptorProto7
61
+ enum_type ( 2$.google.protobuf.EnumDescriptorProto8
62
+ service ( 2'.google.protobuf.ServiceDescriptorProto8
63
+ extension ( 2%.google.protobuf.FieldDescriptorProto-
64
+ options ( 2.google.protobuf.FileOptions9
65
+ source_code_info ( 2.google.protobuf.SourceCodeInfo
66
+ syntax ( "�
67
+ DescriptorProto
68
+ name ( 4
69
+ field ( 2%.google.protobuf.FieldDescriptorProto8
70
+ extension ( 2%.google.protobuf.FieldDescriptorProto5
71
+ nested_type ( 2 .google.protobuf.DescriptorProto7
72
+ enum_type ( 2$.google.protobuf.EnumDescriptorProtoH
73
+ extension_range ( 2/.google.protobuf.DescriptorProto.ExtensionRange9
74
+
75
+ oneof_decl ( 2%.google.protobuf.OneofDescriptorProto0
76
+ options ( 2.google.protobuf.MessageOptionsF
77
+ reserved_range ( 2..google.protobuf.DescriptorProto.ReservedRange
78
+
79
+ ( e
80
+ ExtensionRange
81
+ start (
82
+ end (7
83
+ options ( 2&.google.protobuf.ExtensionRangeOptions+
84
+
85
+ start (
86
+ end ("g
87
+ ExtensionRangeOptionsC
88
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����"�
89
+ FieldDescriptorProto
90
+ name ( 
91
+ number (:
92
+ label (2+.google.protobuf.FieldDescriptorProto.Label8
93
+ type (2*.google.protobuf.FieldDescriptorProto.Type
94
+ type_name ( 
95
+ extendee ( 
96
+
97
+ oneof_index (
98
+ json_name
99
+ ( .
100
+ options ( 2.google.protobuf.FieldOptions
101
+ proto3_optional ("�
102
+ Type
103
+ TYPE_DOUBLE
104
+
105
+ TYPE_FLOAT
106
+
107
+ TYPE_INT64
108
+ TYPE_UINT64
109
+
110
+ TYPE_INT32
111
+ TYPE_FIXED64
112
+ TYPE_FIXED32
113
+ TYPE_BOOL
114
+ TYPE_STRING 
115
+
116
+ TYPE_GROUP
117
+ 
118
+ TYPE_MESSAGE 
119
+
120
+ TYPE_BYTES 
121
+ TYPE_UINT32
122
+ TYPE_ENUM
123
+
124
+
125
+ TYPE_SINT32
126
+ TYPE_SINT64"C
127
+ Label
128
+ LABEL_OPTIONAL
129
+ LABEL_REQUIRED
130
+ LABEL_REPEATED"T
131
+ OneofDescriptorProto
132
+ name ( .
133
+ options ( 2.google.protobuf.OneofOptions"�
134
+ EnumDescriptorProto
135
+ name ( 8
136
+ value ( 2).google.protobuf.EnumValueDescriptorProto-
137
+ options ( 2.google.protobuf.EnumOptionsN
138
+ reserved_range ( 26.google.protobuf.EnumDescriptorProto.EnumReservedRange
139
+
140
+ EnumReservedRange
141
+ start (
142
+ end ("l
143
+ EnumValueDescriptorProto
144
+ name ( 
145
+ number (2
146
+ options ( 2!.google.protobuf.EnumValueOptions"�
147
+ ServiceDescriptorProto
148
+ name ( 6
149
+ method ( 2&.google.protobuf.MethodDescriptorProto0
150
+ options ( 2.google.protobuf.ServiceOptions"�
151
+ MethodDescriptorProto
152
+ name ( 
153
+
154
+ input_type ( 
155
+ output_type ( /
156
+ options ( 2.google.protobuf.MethodOptions
157
+ client_streaming (:false
158
+ server_streaming (:false"�
159
+ FileOptions
160
+ java_package ( 
161
+ java_outer_classname ( "
162
+ java_multiple_files
163
+ (:false)
164
+ java_generate_equals_and_hash (B%
165
+ java_string_check_utf8 (:falseF
166
+ optimize_for (2).google.protobuf.FileOptions.OptimizeMode:SPEED
167
+
168
+ go_package ( "
169
+ cc_generic_services (:false$
170
+ java_generic_services (:false"
171
+ py_generic_services (:false#
172
+ php_generic_services* (:false
173
+
174
+ deprecated (:false
175
+ cc_enable_arenas (:true
176
+ objc_class_prefix$ ( 
177
+ csharp_namespace% ( 
178
+ swift_prefix' ( 
179
+ php_class_prefix( ( 
180
+
181
+ php_metadata_namespace, ( 
182
+ ruby_package- ( C
183
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption":
184
+ OptimizeMode
185
+ SPEED
186
+ CODE_SIZE
187
+ LITE_RUNTIME* �����J&'"�
188
+ MessageOptions&
189
+ message_set_wire_format (:false.
190
+ no_standard_descriptor_accessor (:false
191
+
192
+ deprecated (:false
193
+ map_entry (C
194
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����JJJJ J 
195
+ "�
196
+ FieldOptions:
197
+ ctype (2#.google.protobuf.FieldOptions.CType:STRING
198
+ packed (?
199
+ jstype (2$.google.protobuf.FieldOptions.JSType: JS_NORMAL
200
+ lazy (:false
201
+
202
+ deprecated (:false
203
+ weak
204
+ (:falseC
205
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption"/
206
+ CType
207
+
208
+ STRING
209
+ CORD
210
+ STRING_PIECE"5
211
+ JSType
212
+ JS_NORMAL
213
+ JS_STRING
214
+ JS_NUMBER* �����J"^
215
+ OneofOptionsC
216
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����"�
217
+ EnumOptions
218
+ allow_alias (
219
+
220
+ deprecated (:falseC
221
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����J"}
222
+ EnumValueOptions
223
+
224
+ deprecated (:falseC
225
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����"{
226
+ ServiceOptions
227
+
228
+ deprecated! (:falseC
229
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����"�
230
+
231
+
232
+ deprecated! (:false_
233
+ idempotency_level" (2/.google.protobuf.MethodOptions.IdempotencyLevel:IDEMPOTENCY_UNKNOWNC
234
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption"P
235
+ IdempotencyLevel
236
+ IDEMPOTENCY_UNKNOWN
237
+ NO_SIDE_EFFECTS
238
+
239
+ IDEMPOTENT* �����"�
240
+ UninterpretedOption;
241
+ name ( 2-.google.protobuf.UninterpretedOption.NamePart
242
+ identifier_value ( 
243
+ positive_int_value (
244
+ negative_int_value (
245
+ double_value (
246
+ string_value ( 
247
+ aggregate_value ( 3
248
+ NamePart
249
+ name_part ( 
250
+ is_extension ("�
251
+ SourceCodeInfo:
252
+ location ( 2(.google.protobuf.SourceCodeInfo.Location�
253
+ Location
254
+ path (B
255
+ span (B
256
+ leading_comments ( 
257
+ trailing_comments ( !
258
+ leading_detached_comments ( "�
259
+ GeneratedCodeInfoA
260
+
261
+ annotation ( 2-.google.protobuf.GeneratedCodeInfo.AnnotationO
262
+
263
+ Annotation
264
+ path (B
265
+ source_file ( 
266
+ begin (
267
+ end (B~
268
+ com.google.protobufBDescriptorProtosHZ-google.golang.org/protobuf/types/descriptorpb��GPB�Google.Protobuf.Reflection
@@ -4,14 +4,16 @@
4
4
  require 'google/protobuf'
5
5
 
6
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
7
+ add_file("google/protobuf/duration.proto", :syntax => :proto3) do
8
+ add_message "google.protobuf.Duration" do
9
+ optional :seconds, :int64, 1
10
+ optional :nanos, :int32, 2
11
+ end
10
12
  end
11
13
  end
12
14
 
13
15
  module Google
14
16
  module Protobuf
15
- Duration = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Duration").msgclass
17
+ Duration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Duration").msgclass
16
18
  end
17
19
  end
@@ -4,12 +4,14 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "google.protobuf.Empty" do
7
+ add_file("google/protobuf/empty.proto", :syntax => :proto3) do
8
+ add_message "google.protobuf.Empty" do
9
+ end
8
10
  end
9
11
  end
10
12
 
11
13
  module Google
12
14
  module Protobuf
13
- Empty = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Empty").msgclass
15
+ Empty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Empty").msgclass
14
16
  end
15
17
  end
@@ -4,13 +4,15 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "google.protobuf.FieldMask" do
8
- repeated :paths, :string, 1
7
+ add_file("google/protobuf/field_mask.proto", :syntax => :proto3) do
8
+ add_message "google.protobuf.FieldMask" do
9
+ repeated :paths, :string, 1
10
+ end
9
11
  end
10
12
  end
11
13
 
12
14
  module Google
13
15
  module Protobuf
14
- FieldMask = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldMask").msgclass
16
+ FieldMask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldMask").msgclass
15
17
  end
16
18
  end
@@ -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
@@ -79,7 +79,7 @@ module Google
79
79
 
80
80
 
81
81
  def first(n=nil)
82
- n ? self[0..n] : self[0]
82
+ n ? self[0...n] : self[0]
83
83
  end
84
84
 
85
85
 
@@ -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
@@ -4,13 +4,15 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "google.protobuf.SourceContext" do
8
- optional :file_name, :string, 1
7
+ add_file("google/protobuf/source_context.proto", :syntax => :proto3) do
8
+ add_message "google.protobuf.SourceContext" do
9
+ optional :file_name, :string, 1
10
+ end
9
11
  end
10
12
  end
11
13
 
12
14
  module Google
13
15
  module Protobuf
14
- SourceContext = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceContext").msgclass
16
+ SourceContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceContext").msgclass
15
17
  end
16
18
  end
@@ -4,32 +4,34 @@
4
4
  require 'google/protobuf'
5
5
 
6
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"
7
+ add_file("google/protobuf/struct.proto", :syntax => :proto3) do
8
+ add_message "google.protobuf.Struct" do
9
+ map :fields, :string, :message, 1, "google.protobuf.Value"
10
+ end
11
+ add_message "google.protobuf.Value" do
12
+ oneof :kind do
13
+ optional :null_value, :enum, 1, "google.protobuf.NullValue"
14
+ optional :number_value, :double, 2
15
+ optional :string_value, :string, 3
16
+ optional :bool_value, :bool, 4
17
+ optional :struct_value, :message, 5, "google.protobuf.Struct"
18
+ optional :list_value, :message, 6, "google.protobuf.ListValue"
19
+ end
20
+ end
21
+ add_message "google.protobuf.ListValue" do
22
+ repeated :values, :message, 1, "google.protobuf.Value"
23
+ end
24
+ add_enum "google.protobuf.NullValue" do
25
+ value :NULL_VALUE, 0
18
26
  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
27
  end
26
28
  end
27
29
 
28
30
  module Google
29
31
  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
32
+ Struct = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Struct").msgclass
33
+ Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Value").msgclass
34
+ ListValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ListValue").msgclass
35
+ NullValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.NullValue").enummodule
34
36
  end
35
37
  end
@@ -4,14 +4,16 @@
4
4
  require 'google/protobuf'
5
5
 
6
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
7
+ add_file("google/protobuf/timestamp.proto", :syntax => :proto3) do
8
+ add_message "google.protobuf.Timestamp" do
9
+ optional :seconds, :int64, 1
10
+ optional :nanos, :int32, 2
11
+ end
10
12
  end
11
13
  end
12
14
 
13
15
  module Google
14
16
  module Protobuf
15
- Timestamp = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Timestamp").msgclass
17
+ Timestamp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Timestamp").msgclass
16
18
  end
17
19
  end
@@ -5,85 +5,88 @@ require 'google/protobuf'
5
5
 
6
6
  require 'google/protobuf/any_pb'
7
7
  require 'google/protobuf/source_context_pb'
8
+
8
9
  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
10
+ add_file("google/protobuf/type.proto", :syntax => :proto3) do
11
+ add_message "google.protobuf.Type" do
12
+ optional :name, :string, 1
13
+ repeated :fields, :message, 2, "google.protobuf.Field"
14
+ repeated :oneofs, :string, 3
15
+ repeated :options, :message, 4, "google.protobuf.Option"
16
+ optional :source_context, :message, 5, "google.protobuf.SourceContext"
17
+ optional :syntax, :enum, 6, "google.protobuf.Syntax"
18
+ end
19
+ add_message "google.protobuf.Field" do
20
+ optional :kind, :enum, 1, "google.protobuf.Field.Kind"
21
+ optional :cardinality, :enum, 2, "google.protobuf.Field.Cardinality"
22
+ optional :number, :int32, 3
23
+ optional :name, :string, 4
24
+ optional :type_url, :string, 6
25
+ optional :oneof_index, :int32, 7
26
+ optional :packed, :bool, 8
27
+ repeated :options, :message, 9, "google.protobuf.Option"
28
+ optional :json_name, :string, 10
29
+ optional :default_value, :string, 11
30
+ end
31
+ add_enum "google.protobuf.Field.Kind" do
32
+ value :TYPE_UNKNOWN, 0
33
+ value :TYPE_DOUBLE, 1
34
+ value :TYPE_FLOAT, 2
35
+ value :TYPE_INT64, 3
36
+ value :TYPE_UINT64, 4
37
+ value :TYPE_INT32, 5
38
+ value :TYPE_FIXED64, 6
39
+ value :TYPE_FIXED32, 7
40
+ value :TYPE_BOOL, 8
41
+ value :TYPE_STRING, 9
42
+ value :TYPE_GROUP, 10
43
+ value :TYPE_MESSAGE, 11
44
+ value :TYPE_BYTES, 12
45
+ value :TYPE_UINT32, 13
46
+ value :TYPE_ENUM, 14
47
+ value :TYPE_SFIXED32, 15
48
+ value :TYPE_SFIXED64, 16
49
+ value :TYPE_SINT32, 17
50
+ value :TYPE_SINT64, 18
51
+ end
52
+ add_enum "google.protobuf.Field.Cardinality" do
53
+ value :CARDINALITY_UNKNOWN, 0
54
+ value :CARDINALITY_OPTIONAL, 1
55
+ value :CARDINALITY_REQUIRED, 2
56
+ value :CARDINALITY_REPEATED, 3
57
+ end
58
+ add_message "google.protobuf.Enum" do
59
+ optional :name, :string, 1
60
+ repeated :enumvalue, :message, 2, "google.protobuf.EnumValue"
61
+ repeated :options, :message, 3, "google.protobuf.Option"
62
+ optional :source_context, :message, 4, "google.protobuf.SourceContext"
63
+ optional :syntax, :enum, 5, "google.protobuf.Syntax"
64
+ end
65
+ add_message "google.protobuf.EnumValue" do
66
+ optional :name, :string, 1
67
+ optional :number, :int32, 2
68
+ repeated :options, :message, 3, "google.protobuf.Option"
69
+ end
70
+ add_message "google.protobuf.Option" do
71
+ optional :name, :string, 1
72
+ optional :value, :message, 2, "google.protobuf.Any"
73
+ end
74
+ add_enum "google.protobuf.Syntax" do
75
+ value :SYNTAX_PROTO2, 0
76
+ value :SYNTAX_PROTO3, 1
77
+ end
75
78
  end
76
79
  end
77
80
 
78
81
  module Google
79
82
  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
83
+ Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Type").msgclass
84
+ Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field").msgclass
85
+ Field::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field.Kind").enummodule
86
+ Field::Cardinality = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field.Cardinality").enummodule
87
+ Enum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Enum").msgclass
88
+ EnumValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValue").msgclass
89
+ Option = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Option").msgclass
90
+ Syntax = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Syntax").enummodule
88
91
  end
89
92
  end