ruby-protocol-buffers 1.5.0.beta1 → 1.5.0
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.
- data/bin/ruby-protoc +1 -1
- data/lib/protocol_buffers/compiler.rb +1 -1
- data/lib/protocol_buffers/compiler/descriptor.pb.rb +257 -241
- data/lib/protocol_buffers/compiler/descriptor.proto +4 -4
- data/lib/protocol_buffers/compiler/file_descriptor_to_d.rb +2 -2
- data/lib/protocol_buffers/compiler/file_descriptor_to_ruby.rb +2 -2
- data/lib/protocol_buffers/compiler/plugin.pb.rb +1 -1
- data/lib/protocol_buffers/runtime/field.rb +4 -2
- data/lib/protocol_buffers/version.rb +1 -1
- data/spec/compiler_spec.rb +1 -1
- data/spec/runtime_spec.rb +7 -0
- metadata +9 -6
data/bin/ruby-protoc
CHANGED
@@ -36,7 +36,7 @@ filenames = rest
|
|
36
36
|
protocfile = Tempfile.new("ruby-protoc")
|
37
37
|
protocfile.binmode
|
38
38
|
ProtocolBuffers::Compiler.compile(protocfile.path, filenames, :include_dirs => include_dirs)
|
39
|
-
descriptor_set = FileDescriptorSet.parse(protocfile)
|
39
|
+
descriptor_set = Google::Protobuf::FileDescriptorSet.parse(protocfile)
|
40
40
|
protocfile.close(true)
|
41
41
|
|
42
42
|
if ruby_out
|
@@ -29,7 +29,7 @@ module ProtocolBuffers
|
|
29
29
|
include_dirs.concat(input_files.map { |i| File.dirname(i) }.uniq)
|
30
30
|
|
31
31
|
compile(tempfile.path, input_files, opts)
|
32
|
-
descriptor_set = FileDescriptorSet.parse(tempfile)
|
32
|
+
descriptor_set = Google::Protobuf::FileDescriptorSet.parse(tempfile)
|
33
33
|
tempfile.close(true)
|
34
34
|
descriptor_set.file.each do |file|
|
35
35
|
parsed = FileDescriptorToRuby.new(file)
|
@@ -3,267 +3,283 @@
|
|
3
3
|
|
4
4
|
require 'protocol_buffers'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
class
|
10
|
-
class
|
11
|
-
class
|
12
|
-
class
|
13
|
-
class
|
14
|
-
class
|
15
|
-
class
|
16
|
-
class
|
17
|
-
class
|
18
|
-
class
|
19
|
-
class
|
20
|
-
class
|
21
|
-
class
|
22
|
-
class
|
23
|
-
class
|
24
|
-
|
25
|
-
class
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
6
|
+
module Google
|
7
|
+
module Protobuf
|
8
|
+
# forward declarations
|
9
|
+
class FileDescriptorSet < ::ProtocolBuffers::Message; end
|
10
|
+
class FileDescriptorProto < ::ProtocolBuffers::Message; end
|
11
|
+
class DescriptorProto < ::ProtocolBuffers::Message; end
|
12
|
+
class FieldDescriptorProto < ::ProtocolBuffers::Message; end
|
13
|
+
class EnumDescriptorProto < ::ProtocolBuffers::Message; end
|
14
|
+
class EnumValueDescriptorProto < ::ProtocolBuffers::Message; end
|
15
|
+
class ServiceDescriptorProto < ::ProtocolBuffers::Message; end
|
16
|
+
class MethodDescriptorProto < ::ProtocolBuffers::Message; end
|
17
|
+
class FileOptions < ::ProtocolBuffers::Message; end
|
18
|
+
class MessageOptions < ::ProtocolBuffers::Message; end
|
19
|
+
class FieldOptions < ::ProtocolBuffers::Message; end
|
20
|
+
class EnumOptions < ::ProtocolBuffers::Message; end
|
21
|
+
class EnumValueOptions < ::ProtocolBuffers::Message; end
|
22
|
+
class ServiceOptions < ::ProtocolBuffers::Message; end
|
23
|
+
class MethodOptions < ::ProtocolBuffers::Message; end
|
24
|
+
class UninterpretedOption < ::ProtocolBuffers::Message; end
|
25
|
+
class SourceCodeInfo < ::ProtocolBuffers::Message; end
|
26
|
+
|
27
|
+
class FileDescriptorSet < ::ProtocolBuffers::Message
|
28
|
+
set_fully_qualified_name "google.protobuf.FileDescriptorSet"
|
29
|
+
|
30
|
+
repeated ::Google::Protobuf::FileDescriptorProto, :file, 1
|
31
|
+
end
|
32
|
+
|
33
|
+
class FileDescriptorProto < ::ProtocolBuffers::Message
|
34
|
+
set_fully_qualified_name "google.protobuf.FileDescriptorProto"
|
35
|
+
|
36
|
+
optional :string, :name, 1
|
37
|
+
optional :string, :package, 2
|
38
|
+
repeated :string, :dependency, 3
|
39
|
+
repeated :int32, :public_dependency, 10
|
40
|
+
repeated :int32, :weak_dependency, 11
|
41
|
+
repeated ::Google::Protobuf::DescriptorProto, :message_type, 4
|
42
|
+
repeated ::Google::Protobuf::EnumDescriptorProto, :enum_type, 5
|
43
|
+
repeated ::Google::Protobuf::ServiceDescriptorProto, :service, 6
|
44
|
+
repeated ::Google::Protobuf::FieldDescriptorProto, :extension, 7
|
45
|
+
optional ::Google::Protobuf::FileOptions, :options, 8
|
46
|
+
optional ::Google::Protobuf::SourceCodeInfo, :source_code_info, 9
|
47
|
+
end
|
48
|
+
|
49
|
+
class DescriptorProto < ::ProtocolBuffers::Message
|
50
|
+
# forward declarations
|
51
|
+
class ExtensionRange < ::ProtocolBuffers::Message; end
|
52
|
+
|
53
|
+
set_fully_qualified_name "google.protobuf.DescriptorProto"
|
54
|
+
|
55
|
+
# nested messages
|
56
|
+
class ExtensionRange < ::ProtocolBuffers::Message
|
57
|
+
set_fully_qualified_name "google.protobuf.DescriptorProto.ExtensionRange"
|
58
|
+
|
59
|
+
optional :int32, :start, 1
|
60
|
+
optional :int32, :end, 2
|
61
|
+
end
|
62
|
+
|
63
|
+
optional :string, :name, 1
|
64
|
+
repeated ::Google::Protobuf::FieldDescriptorProto, :field, 2
|
65
|
+
repeated ::Google::Protobuf::FieldDescriptorProto, :extension, 6
|
66
|
+
repeated ::Google::Protobuf::DescriptorProto, :nested_type, 3
|
67
|
+
repeated ::Google::Protobuf::EnumDescriptorProto, :enum_type, 4
|
68
|
+
repeated ::Google::Protobuf::DescriptorProto::ExtensionRange, :extension_range, 5
|
69
|
+
optional ::Google::Protobuf::MessageOptions, :options, 7
|
70
|
+
end
|
71
|
+
|
72
|
+
class FieldDescriptorProto < ::ProtocolBuffers::Message
|
73
|
+
# forward declarations
|
74
|
+
|
75
|
+
# enums
|
76
|
+
module Type
|
77
|
+
include ::ProtocolBuffers::Enum
|
78
|
+
|
79
|
+
set_fully_qualified_name "google.protobuf.FieldDescriptorProto.Type"
|
80
|
+
|
81
|
+
TYPE_DOUBLE = 1
|
82
|
+
TYPE_FLOAT = 2
|
83
|
+
TYPE_INT64 = 3
|
84
|
+
TYPE_UINT64 = 4
|
85
|
+
TYPE_INT32 = 5
|
86
|
+
TYPE_FIXED64 = 6
|
87
|
+
TYPE_FIXED32 = 7
|
88
|
+
TYPE_BOOL = 8
|
89
|
+
TYPE_STRING = 9
|
90
|
+
TYPE_GROUP = 10
|
91
|
+
TYPE_MESSAGE = 11
|
92
|
+
TYPE_BYTES = 12
|
93
|
+
TYPE_UINT32 = 13
|
94
|
+
TYPE_ENUM = 14
|
95
|
+
TYPE_SFIXED32 = 15
|
96
|
+
TYPE_SFIXED64 = 16
|
97
|
+
TYPE_SINT32 = 17
|
98
|
+
TYPE_SINT64 = 18
|
99
|
+
end
|
100
|
+
|
101
|
+
module Label
|
102
|
+
include ::ProtocolBuffers::Enum
|
103
|
+
|
104
|
+
set_fully_qualified_name "google.protobuf.FieldDescriptorProto.Label"
|
105
|
+
|
106
|
+
LABEL_OPTIONAL = 1
|
107
|
+
LABEL_REQUIRED = 2
|
108
|
+
LABEL_REPEATED = 3
|
109
|
+
end
|
110
|
+
|
111
|
+
set_fully_qualified_name "google.protobuf.FieldDescriptorProto"
|
112
|
+
|
113
|
+
optional :string, :name, 1
|
114
|
+
optional :int32, :number, 3
|
115
|
+
optional ::Google::Protobuf::FieldDescriptorProto::Label, :label, 4
|
116
|
+
optional ::Google::Protobuf::FieldDescriptorProto::Type, :type, 5
|
117
|
+
optional :string, :type_name, 6
|
118
|
+
optional :string, :extendee, 2
|
119
|
+
optional :string, :default_value, 7
|
120
|
+
optional ::Google::Protobuf::FieldOptions, :options, 8
|
121
|
+
end
|
122
|
+
|
123
|
+
class EnumDescriptorProto < ::ProtocolBuffers::Message
|
124
|
+
set_fully_qualified_name "google.protobuf.EnumDescriptorProto"
|
125
|
+
|
126
|
+
optional :string, :name, 1
|
127
|
+
repeated ::Google::Protobuf::EnumValueDescriptorProto, :value, 2
|
128
|
+
optional ::Google::Protobuf::EnumOptions, :options, 3
|
129
|
+
end
|
130
|
+
|
131
|
+
class EnumValueDescriptorProto < ::ProtocolBuffers::Message
|
132
|
+
set_fully_qualified_name "google.protobuf.EnumValueDescriptorProto"
|
133
|
+
|
134
|
+
optional :string, :name, 1
|
135
|
+
optional :int32, :number, 2
|
136
|
+
optional ::Google::Protobuf::EnumValueOptions, :options, 3
|
137
|
+
end
|
138
|
+
|
139
|
+
class ServiceDescriptorProto < ::ProtocolBuffers::Message
|
140
|
+
set_fully_qualified_name "google.protobuf.ServiceDescriptorProto"
|
141
|
+
|
142
|
+
optional :string, :name, 1
|
143
|
+
repeated ::Google::Protobuf::MethodDescriptorProto, :method, 2
|
144
|
+
optional ::Google::Protobuf::ServiceOptions, :options, 3
|
145
|
+
end
|
146
|
+
|
147
|
+
class MethodDescriptorProto < ::ProtocolBuffers::Message
|
148
|
+
set_fully_qualified_name "google.protobuf.MethodDescriptorProto"
|
149
|
+
|
150
|
+
optional :string, :name, 1
|
151
|
+
optional :string, :input_type, 2
|
152
|
+
optional :string, :output_type, 3
|
153
|
+
optional ::Google::Protobuf::MethodOptions, :options, 4
|
154
|
+
end
|
155
|
+
|
156
|
+
class FileOptions < ::ProtocolBuffers::Message
|
157
|
+
# forward declarations
|
158
|
+
|
159
|
+
# enums
|
160
|
+
module OptimizeMode
|
161
|
+
include ::ProtocolBuffers::Enum
|
162
|
+
|
163
|
+
set_fully_qualified_name "google.protobuf.FileOptions.OptimizeMode"
|
164
|
+
|
165
|
+
SPEED = 1
|
166
|
+
CODE_SIZE = 2
|
167
|
+
LITE_RUNTIME = 3
|
168
|
+
end
|
169
|
+
|
170
|
+
set_fully_qualified_name "google.protobuf.FileOptions"
|
171
|
+
|
172
|
+
optional :string, :java_package, 1
|
173
|
+
optional :string, :java_outer_classname, 8
|
174
|
+
optional :bool, :java_multiple_files, 10, :default => false
|
175
|
+
optional :bool, :java_generate_equals_and_hash, 20, :default => false
|
176
|
+
optional ::Google::Protobuf::FileOptions::OptimizeMode, :optimize_for, 9, :default => ::Google::Protobuf::FileOptions::OptimizeMode::SPEED
|
177
|
+
optional :string, :go_package, 11
|
178
|
+
optional :bool, :cc_generic_services, 16, :default => false
|
179
|
+
optional :bool, :java_generic_services, 17, :default => false
|
180
|
+
optional :bool, :py_generic_services, 18, :default => false
|
181
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
182
|
+
end
|
183
|
+
|
184
|
+
class MessageOptions < ::ProtocolBuffers::Message
|
185
|
+
set_fully_qualified_name "google.protobuf.MessageOptions"
|
186
|
+
|
187
|
+
optional :bool, :message_set_wire_format, 1, :default => false
|
188
|
+
optional :bool, :no_standard_descriptor_accessor, 2, :default => false
|
189
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
190
|
+
end
|
191
|
+
|
192
|
+
class FieldOptions < ::ProtocolBuffers::Message
|
193
|
+
# forward declarations
|
194
|
+
|
195
|
+
# enums
|
196
|
+
module CType
|
197
|
+
include ::ProtocolBuffers::Enum
|
58
198
|
|
59
|
-
|
60
|
-
repeated ::FieldDescriptorProto, :field, 2
|
61
|
-
repeated ::FieldDescriptorProto, :extension, 6
|
62
|
-
repeated ::DescriptorProto, :nested_type, 3
|
63
|
-
repeated ::EnumDescriptorProto, :enum_type, 4
|
64
|
-
repeated ::DescriptorProto::ExtensionRange, :extension_range, 5
|
65
|
-
optional ::MessageOptions, :options, 7
|
199
|
+
set_fully_qualified_name "google.protobuf.FieldOptions.CType"
|
66
200
|
|
67
|
-
|
68
|
-
|
201
|
+
STRING = 0
|
202
|
+
CORD = 1
|
203
|
+
STRING_PIECE = 2
|
204
|
+
end
|
69
205
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
TYPE_BOOL = 8
|
84
|
-
TYPE_STRING = 9
|
85
|
-
TYPE_GROUP = 10
|
86
|
-
TYPE_MESSAGE = 11
|
87
|
-
TYPE_BYTES = 12
|
88
|
-
TYPE_UINT32 = 13
|
89
|
-
TYPE_ENUM = 14
|
90
|
-
TYPE_SFIXED32 = 15
|
91
|
-
TYPE_SFIXED64 = 16
|
92
|
-
TYPE_SINT32 = 17
|
93
|
-
TYPE_SINT64 = 18
|
94
|
-
end
|
206
|
+
set_fully_qualified_name "google.protobuf.FieldOptions"
|
207
|
+
|
208
|
+
optional ::Google::Protobuf::FieldOptions::CType, :ctype, 1, :default => ::Google::Protobuf::FieldOptions::CType::STRING
|
209
|
+
optional :bool, :packed, 2
|
210
|
+
optional :bool, :lazy, 5, :default => false
|
211
|
+
optional :bool, :deprecated, 3, :default => false
|
212
|
+
optional :string, :experimental_map_key, 9
|
213
|
+
optional :bool, :weak, 10, :default => false
|
214
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
215
|
+
end
|
216
|
+
|
217
|
+
class EnumOptions < ::ProtocolBuffers::Message
|
218
|
+
set_fully_qualified_name "google.protobuf.EnumOptions"
|
95
219
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
LABEL_REQUIRED = 2
|
100
|
-
LABEL_REPEATED = 3
|
101
|
-
end
|
220
|
+
optional :bool, :allow_alias, 2, :default => true
|
221
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
222
|
+
end
|
102
223
|
|
103
|
-
|
104
|
-
|
105
|
-
optional ::FieldDescriptorProto::Label, :label, 4
|
106
|
-
optional ::FieldDescriptorProto::Type, :type, 5
|
107
|
-
optional :string, :type_name, 6
|
108
|
-
optional :string, :extendee, 2
|
109
|
-
optional :string, :default_value, 7
|
110
|
-
optional ::FieldOptions, :options, 8
|
224
|
+
class EnumValueOptions < ::ProtocolBuffers::Message
|
225
|
+
set_fully_qualified_name "google.protobuf.EnumValueOptions"
|
111
226
|
|
112
|
-
|
113
|
-
end
|
227
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
228
|
+
end
|
114
229
|
|
115
|
-
class
|
116
|
-
|
117
|
-
repeated ::EnumValueDescriptorProto, :value, 2
|
118
|
-
optional ::EnumOptions, :options, 3
|
230
|
+
class ServiceOptions < ::ProtocolBuffers::Message
|
231
|
+
set_fully_qualified_name "google.protobuf.ServiceOptions"
|
119
232
|
|
120
|
-
|
121
|
-
end
|
233
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
234
|
+
end
|
122
235
|
|
123
|
-
class
|
124
|
-
|
125
|
-
optional :int32, :number, 2
|
126
|
-
optional ::EnumValueOptions, :options, 3
|
236
|
+
class MethodOptions < ::ProtocolBuffers::Message
|
237
|
+
set_fully_qualified_name "google.protobuf.MethodOptions"
|
127
238
|
|
128
|
-
|
129
|
-
end
|
239
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
240
|
+
end
|
130
241
|
|
131
|
-
class
|
132
|
-
|
133
|
-
|
134
|
-
optional ::ServiceOptions, :options, 3
|
242
|
+
class UninterpretedOption < ::ProtocolBuffers::Message
|
243
|
+
# forward declarations
|
244
|
+
class NamePart < ::ProtocolBuffers::Message; end
|
135
245
|
|
136
|
-
|
137
|
-
end
|
246
|
+
set_fully_qualified_name "google.protobuf.UninterpretedOption"
|
138
247
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
optional :string, :output_type, 3
|
143
|
-
optional ::MethodOptions, :options, 4
|
248
|
+
# nested messages
|
249
|
+
class NamePart < ::ProtocolBuffers::Message
|
250
|
+
set_fully_qualified_name "google.protobuf.UninterpretedOption.NamePart"
|
144
251
|
|
145
|
-
|
146
|
-
|
252
|
+
required :string, :name_part, 1
|
253
|
+
required :bool, :is_extension, 2
|
254
|
+
end
|
147
255
|
|
148
|
-
|
149
|
-
|
256
|
+
repeated ::Google::Protobuf::UninterpretedOption::NamePart, :name, 2
|
257
|
+
optional :string, :identifier_value, 3
|
258
|
+
optional :uint64, :positive_int_value, 4
|
259
|
+
optional :int64, :negative_int_value, 5
|
260
|
+
optional :double, :double_value, 6
|
261
|
+
optional :bytes, :string_value, 7
|
262
|
+
optional :string, :aggregate_value, 8
|
263
|
+
end
|
150
264
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
SPEED = 1
|
155
|
-
CODE_SIZE = 2
|
156
|
-
LITE_RUNTIME = 3
|
157
|
-
end
|
265
|
+
class SourceCodeInfo < ::ProtocolBuffers::Message
|
266
|
+
# forward declarations
|
267
|
+
class Location < ::ProtocolBuffers::Message; end
|
158
268
|
|
159
|
-
|
160
|
-
optional :string, :java_outer_classname, 8
|
161
|
-
optional :bool, :java_multiple_files, 10, :default => false
|
162
|
-
optional :bool, :java_generate_equals_and_hash, 20, :default => false
|
163
|
-
optional ::FileOptions::OptimizeMode, :optimize_for, 9, :default => ::FileOptions::OptimizeMode::SPEED
|
164
|
-
optional :string, :go_package, 11
|
165
|
-
optional :bool, :cc_generic_services, 16, :default => false
|
166
|
-
optional :bool, :java_generic_services, 17, :default => false
|
167
|
-
optional :bool, :py_generic_services, 18, :default => false
|
168
|
-
repeated ::UninterpretedOption, :uninterpreted_option, 999
|
169
|
-
|
170
|
-
gen_methods! # new fields ignored after this point
|
171
|
-
end
|
269
|
+
set_fully_qualified_name "google.protobuf.SourceCodeInfo"
|
172
270
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
repeated ::UninterpretedOption, :uninterpreted_option, 999
|
271
|
+
# nested messages
|
272
|
+
class Location < ::ProtocolBuffers::Message
|
273
|
+
set_fully_qualified_name "google.protobuf.SourceCodeInfo.Location"
|
177
274
|
|
178
|
-
|
179
|
-
|
275
|
+
repeated :int32, :path, 1, :packed => true
|
276
|
+
repeated :int32, :span, 2, :packed => true
|
277
|
+
optional :string, :leading_comments, 3
|
278
|
+
optional :string, :trailing_comments, 4
|
279
|
+
end
|
180
280
|
|
181
|
-
|
182
|
-
|
281
|
+
repeated ::Google::Protobuf::SourceCodeInfo::Location, :location, 1
|
282
|
+
end
|
183
283
|
|
184
|
-
# enums
|
185
|
-
module CType
|
186
|
-
include ::ProtocolBuffers::Enum
|
187
|
-
STRING = 0
|
188
|
-
CORD = 1
|
189
|
-
STRING_PIECE = 2
|
190
284
|
end
|
191
|
-
|
192
|
-
optional ::FieldOptions::CType, :ctype, 1, :default => ::FieldOptions::CType::STRING
|
193
|
-
optional :bool, :packed, 2
|
194
|
-
optional :bool, :lazy, 5, :default => false
|
195
|
-
optional :bool, :deprecated, 3, :default => false
|
196
|
-
optional :string, :experimental_map_key, 9
|
197
|
-
optional :bool, :weak, 10, :default => false
|
198
|
-
repeated ::UninterpretedOption, :uninterpreted_option, 999
|
199
|
-
|
200
|
-
gen_methods! # new fields ignored after this point
|
201
|
-
end
|
202
|
-
|
203
|
-
class EnumOptions < ::ProtocolBuffers::Message
|
204
|
-
optional :bool, :allow_alias, 2, :default => true
|
205
|
-
repeated ::UninterpretedOption, :uninterpreted_option, 999
|
206
|
-
|
207
|
-
gen_methods! # new fields ignored after this point
|
208
285
|
end
|
209
|
-
|
210
|
-
class EnumValueOptions < ::ProtocolBuffers::Message
|
211
|
-
repeated ::UninterpretedOption, :uninterpreted_option, 999
|
212
|
-
|
213
|
-
gen_methods! # new fields ignored after this point
|
214
|
-
end
|
215
|
-
|
216
|
-
class ServiceOptions < ::ProtocolBuffers::Message
|
217
|
-
repeated ::UninterpretedOption, :uninterpreted_option, 999
|
218
|
-
|
219
|
-
gen_methods! # new fields ignored after this point
|
220
|
-
end
|
221
|
-
|
222
|
-
class MethodOptions < ::ProtocolBuffers::Message
|
223
|
-
repeated ::UninterpretedOption, :uninterpreted_option, 999
|
224
|
-
|
225
|
-
gen_methods! # new fields ignored after this point
|
226
|
-
end
|
227
|
-
|
228
|
-
class UninterpretedOption < ::ProtocolBuffers::Message
|
229
|
-
# forward declarations
|
230
|
-
class NamePart < ::ProtocolBuffers::Message; end
|
231
|
-
|
232
|
-
# nested messages
|
233
|
-
class NamePart < ::ProtocolBuffers::Message
|
234
|
-
required :string, :name_part, 1
|
235
|
-
required :bool, :is_extension, 2
|
236
|
-
|
237
|
-
gen_methods! # new fields ignored after this point
|
238
|
-
end
|
239
|
-
|
240
|
-
repeated ::UninterpretedOption::NamePart, :name, 2
|
241
|
-
optional :string, :identifier_value, 3
|
242
|
-
optional :uint64, :positive_int_value, 4
|
243
|
-
optional :int64, :negative_int_value, 5
|
244
|
-
optional :double, :double_value, 6
|
245
|
-
optional :bytes, :string_value, 7
|
246
|
-
optional :string, :aggregate_value, 8
|
247
|
-
|
248
|
-
gen_methods! # new fields ignored after this point
|
249
|
-
end
|
250
|
-
|
251
|
-
class SourceCodeInfo < ::ProtocolBuffers::Message
|
252
|
-
# forward declarations
|
253
|
-
class Location < ::ProtocolBuffers::Message; end
|
254
|
-
|
255
|
-
# nested messages
|
256
|
-
class Location < ::ProtocolBuffers::Message
|
257
|
-
repeated :int32, :path, 1
|
258
|
-
repeated :int32, :span, 2
|
259
|
-
optional :string, :leading_comments, 3
|
260
|
-
optional :string, :trailing_comments, 4
|
261
|
-
|
262
|
-
gen_methods! # new fields ignored after this point
|
263
|
-
end
|
264
|
-
|
265
|
-
repeated ::SourceCodeInfo::Location, :location, 1
|
266
|
-
|
267
|
-
gen_methods! # new fields ignored after this point
|
268
|
-
end
|
269
|
-
|
@@ -38,13 +38,13 @@
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
package google.protobuf;
|
42
|
+
option java_package = "com.google.protobuf";
|
43
|
+
option java_outer_classname = "DescriptorProtos";
|
44
44
|
|
45
45
|
// descriptor.proto must be optimized for speed because reflection-based
|
46
46
|
// algorithms don't work during bootstrapping.
|
47
|
-
|
47
|
+
option optimize_for = SPEED;
|
48
48
|
|
49
49
|
// The protocol compiler can output a FileDescriptorSet containing the .proto
|
50
50
|
// files it parses.
|
@@ -3,8 +3,8 @@ require 'stringio'
|
|
3
3
|
|
4
4
|
class FileDescriptorToD < Struct.new(:descriptor)
|
5
5
|
|
6
|
-
include FieldDescriptorProto::Type
|
7
|
-
include FieldDescriptorProto::Label
|
6
|
+
include Google::Protobuf::FieldDescriptorProto::Type
|
7
|
+
include Google::Protobuf::FieldDescriptorProto::Label
|
8
8
|
|
9
9
|
def initialize(descriptor)
|
10
10
|
super
|
@@ -3,8 +3,8 @@ require 'stringio'
|
|
3
3
|
|
4
4
|
class FileDescriptorToRuby < Struct.new(:descriptor)
|
5
5
|
|
6
|
-
include FieldDescriptorProto::Type
|
7
|
-
include FieldDescriptorProto::Label
|
6
|
+
include Google::Protobuf::FieldDescriptorProto::Type
|
7
|
+
include Google::Protobuf::FieldDescriptorProto::Label
|
8
8
|
|
9
9
|
def initialize(descriptor)
|
10
10
|
super
|
@@ -12,7 +12,7 @@ class CodeGeneratorResponse < ::ProtocolBuffers::Message; end
|
|
12
12
|
class CodeGeneratorRequest < ::ProtocolBuffers::Message
|
13
13
|
repeated :string, :file_to_generate, 1
|
14
14
|
optional :string, :parameter, 2
|
15
|
-
repeated ::FileDescriptorProto, :proto_file, 15
|
15
|
+
repeated ::Google::Protobuf::FileDescriptorProto, :proto_file, 15
|
16
16
|
end
|
17
17
|
|
18
18
|
class CodeGeneratorResponse < ::ProtocolBuffers::Message
|
@@ -155,8 +155,10 @@ module ProtocolBuffers
|
|
155
155
|
if __value.nil?
|
156
156
|
#{name}.clear
|
157
157
|
else
|
158
|
-
#{name}
|
159
|
-
|
158
|
+
unless __value.equal?(#{name})
|
159
|
+
#{name}.clear
|
160
|
+
__value.each { |i| @#{name}.push i }
|
161
|
+
end
|
160
162
|
end
|
161
163
|
end
|
162
164
|
EOF
|
data/spec/compiler_spec.rb
CHANGED
@@ -37,7 +37,7 @@ describe ProtocolBuffers, "compiler" do
|
|
37
37
|
), :include_dirs => %w(spec/proto_files))
|
38
38
|
|
39
39
|
|
40
|
-
descriptor_set = FileDescriptorSet.parse(protocfile)
|
40
|
+
descriptor_set = Google::Protobuf::FileDescriptorSet.parse(protocfile)
|
41
41
|
protocfile.close(true)
|
42
42
|
|
43
43
|
Dir.mktmpdir do |dir|
|
data/spec/runtime_spec.rb
CHANGED
@@ -681,6 +681,13 @@ describe ProtocolBuffers, "runtime" do
|
|
681
681
|
msg.i.should == 805059
|
682
682
|
end
|
683
683
|
|
684
|
+
it "handles if you set a repeated field to itself" do
|
685
|
+
f = Featureful::A.new
|
686
|
+
f.i1 = [1, 2, 3]
|
687
|
+
f.i1 = f.i1
|
688
|
+
f.i1.should =~ [1, 2, 3]
|
689
|
+
end
|
690
|
+
|
684
691
|
it "correctly converts to a hash" do
|
685
692
|
f = Featureful::A.new
|
686
693
|
f.i1 = [1, 2, 3]
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-protocol-buffers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.5.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brian Palmer
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-
|
15
|
+
date: 2013-09-19 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: autotest-standalone
|
@@ -217,13 +217,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: '0'
|
218
218
|
segments:
|
219
219
|
- 0
|
220
|
-
hash: -
|
220
|
+
hash: -120727640880373349
|
221
221
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
222
|
none: false
|
223
223
|
requirements:
|
224
|
-
- - ! '
|
224
|
+
- - ! '>='
|
225
225
|
- !ruby/object:Gem::Version
|
226
|
-
version:
|
226
|
+
version: '0'
|
227
|
+
segments:
|
228
|
+
- 0
|
229
|
+
hash: -120727640880373349
|
227
230
|
requirements: []
|
228
231
|
rubyforge_project:
|
229
232
|
rubygems_version: 1.8.23
|