google-protobuf 3.19.4 → 3.23.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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/ext/google/protobuf_c/convert.c +128 -115
  3. data/ext/google/protobuf_c/convert.h +12 -9
  4. data/ext/google/protobuf_c/defs.c +215 -209
  5. data/ext/google/protobuf_c/defs.h +19 -19
  6. data/ext/google/protobuf_c/extconf.rb +12 -5
  7. data/ext/google/protobuf_c/map.c +102 -109
  8. data/ext/google/protobuf_c/map.h +7 -8
  9. data/ext/google/protobuf_c/message.c +446 -341
  10. data/ext/google/protobuf_c/message.h +22 -19
  11. data/ext/google/protobuf_c/protobuf.c +71 -59
  12. data/ext/google/protobuf_c/protobuf.h +13 -10
  13. data/ext/google/protobuf_c/repeated_field.c +82 -84
  14. data/ext/google/protobuf_c/repeated_field.h +6 -6
  15. data/ext/google/protobuf_c/ruby-upb.c +11651 -6848
  16. data/ext/google/protobuf_c/ruby-upb.h +10715 -3639
  17. data/ext/google/protobuf_c/third_party/utf8_range/LICENSE +22 -0
  18. data/ext/google/protobuf_c/third_party/utf8_range/naive.c +92 -0
  19. data/ext/google/protobuf_c/third_party/utf8_range/range2-neon.c +157 -0
  20. data/ext/google/protobuf_c/third_party/utf8_range/range2-sse.c +170 -0
  21. data/ext/google/protobuf_c/third_party/utf8_range/utf8_range.h +21 -0
  22. data/ext/google/protobuf_c/wrap_memcpy.c +4 -3
  23. data/lib/google/protobuf/any_pb.rb +24 -5
  24. data/lib/google/protobuf/api_pb.rb +26 -23
  25. data/lib/google/protobuf/descriptor_dsl.rb +8 -1
  26. data/lib/google/protobuf/descriptor_pb.rb +32 -225
  27. data/lib/google/protobuf/duration_pb.rb +24 -5
  28. data/lib/google/protobuf/empty_pb.rb +24 -3
  29. data/lib/google/protobuf/field_mask_pb.rb +24 -4
  30. data/lib/google/protobuf/message_exts.rb +7 -2
  31. data/lib/google/protobuf/plugin_pb.rb +47 -0
  32. data/lib/google/protobuf/repeated_field.rb +15 -2
  33. data/lib/google/protobuf/source_context_pb.rb +24 -4
  34. data/lib/google/protobuf/struct_pb.rb +24 -20
  35. data/lib/google/protobuf/timestamp_pb.rb +24 -5
  36. data/lib/google/protobuf/type_pb.rb +26 -68
  37. data/lib/google/protobuf/well_known_types.rb +11 -6
  38. data/lib/google/protobuf/wrappers_pb.rb +24 -28
  39. data/lib/google/protobuf.rb +4 -4
  40. metadata +13 -13
  41. data/tests/basic.rb +0 -648
  42. data/tests/generated_code_test.rb +0 -23
  43. data/tests/stress.rb +0 -38
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/protobuf/type.proto
3
4
 
@@ -6,76 +7,33 @@ require 'google/protobuf'
6
7
  require 'google/protobuf/any_pb'
7
8
  require 'google/protobuf/source_context_pb'
8
9
 
9
- Google::Protobuf::DescriptorPool.generated_pool.build do
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
10
+
11
+ descriptor_data = "\n\x1agoogle/protobuf/type.proto\x12\x0fgoogle.protobuf\x1a\x19google/protobuf/any.proto\x1a$google/protobuf/source_context.proto\"\xe8\x01\n\x04Type\x12\x0c\n\x04name\x18\x01 \x01(\t\x12&\n\x06\x66ields\x18\x02 \x03(\x0b\x32\x16.google.protobuf.Field\x12\x0e\n\x06oneofs\x18\x03 \x03(\t\x12(\n\x07options\x18\x04 \x03(\x0b\x32\x17.google.protobuf.Option\x12\x36\n\x0esource_context\x18\x05 \x01(\x0b\x32\x1e.google.protobuf.SourceContext\x12\'\n\x06syntax\x18\x06 \x01(\x0e\x32\x17.google.protobuf.Syntax\x12\x0f\n\x07\x65\x64ition\x18\x07 \x01(\t\"\xd5\x05\n\x05\x46ield\x12)\n\x04kind\x18\x01 \x01(\x0e\x32\x1b.google.protobuf.Field.Kind\x12\x37\n\x0b\x63\x61rdinality\x18\x02 \x01(\x0e\x32\".google.protobuf.Field.Cardinality\x12\x0e\n\x06number\x18\x03 \x01(\x05\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x10\n\x08type_url\x18\x06 \x01(\t\x12\x13\n\x0boneof_index\x18\x07 \x01(\x05\x12\x0e\n\x06packed\x18\x08 \x01(\x08\x12(\n\x07options\x18\t \x03(\x0b\x32\x17.google.protobuf.Option\x12\x11\n\tjson_name\x18\n \x01(\t\x12\x15\n\rdefault_value\x18\x0b \x01(\t\"\xc8\x02\n\x04Kind\x12\x10\n\x0cTYPE_UNKNOWN\x10\x00\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12\"t\n\x0b\x43\x61rdinality\x12\x17\n\x13\x43\x41RDINALITY_UNKNOWN\x10\x00\x12\x18\n\x14\x43\x41RDINALITY_OPTIONAL\x10\x01\x12\x18\n\x14\x43\x41RDINALITY_REQUIRED\x10\x02\x12\x18\n\x14\x43\x41RDINALITY_REPEATED\x10\x03\"\xdf\x01\n\x04\x45num\x12\x0c\n\x04name\x18\x01 \x01(\t\x12-\n\tenumvalue\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.EnumValue\x12(\n\x07options\x18\x03 \x03(\x0b\x32\x17.google.protobuf.Option\x12\x36\n\x0esource_context\x18\x04 \x01(\x0b\x32\x1e.google.protobuf.SourceContext\x12\'\n\x06syntax\x18\x05 \x01(\x0e\x32\x17.google.protobuf.Syntax\x12\x0f\n\x07\x65\x64ition\x18\x06 \x01(\t\"S\n\tEnumValue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06number\x18\x02 \x01(\x05\x12(\n\x07options\x18\x03 \x03(\x0b\x32\x17.google.protobuf.Option\";\n\x06Option\x12\x0c\n\x04name\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any*C\n\x06Syntax\x12\x11\n\rSYNTAX_PROTO2\x10\x00\x12\x11\n\rSYNTAX_PROTO3\x10\x01\x12\x13\n\x0fSYNTAX_EDITIONS\x10\x02\x42{\n\x13\x63om.google.protobufB\tTypeProtoP\x01Z-google.golang.org/protobuf/types/known/typepb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3"
12
+
13
+ pool = Google::Protobuf::DescriptorPool.generated_pool
14
+
15
+ begin
16
+ pool.add_serialized_file(descriptor_data)
17
+ rescue TypeError => e
18
+ # Compatibility code: will be removed in the next major version.
19
+ require 'google/protobuf/descriptor_pb'
20
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
21
+ parsed.clear_dependency
22
+ serialized = parsed.class.encode(parsed)
23
+ file = pool.add_serialized_file(serialized)
24
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
25
+ imports = [
26
+ ["google.protobuf.SourceContext", "google/protobuf/source_context.proto"],
27
+ ["google.protobuf.Any", "google/protobuf/any.proto"],
28
+ ]
29
+ imports.each do |type_name, expected_filename|
30
+ import_file = pool.lookup(type_name).file_descriptor
31
+ if import_file.name != expected_filename
32
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
77
33
  end
78
34
  end
35
+ warn "Each proto file must use a consistent fully-qualified name."
36
+ warn "This will become an error in the next major version."
79
37
  end
80
38
 
81
39
  module Google
@@ -82,16 +82,16 @@ module Google
82
82
  end
83
83
  end
84
84
 
85
+ def self.from_time(time)
86
+ new.from_time(time)
87
+ end
88
+
85
89
  def from_time(time)
86
90
  self.seconds = time.to_i
87
91
  self.nanos = time.nsec
88
92
  self
89
93
  end
90
94
 
91
- def self.from_time(time)
92
- new.from_time(time)
93
- end
94
-
95
95
  def to_i
96
96
  self.seconds
97
97
  end
@@ -137,10 +137,14 @@ module Google
137
137
  end
138
138
  end
139
139
 
140
+ def self.from_ruby(value)
141
+ self.new.from_ruby(value)
142
+ end
143
+
140
144
  def from_ruby(value)
141
145
  case value
142
146
  when NilClass
143
- self.null_value = 0
147
+ self.null_value = :NULL_VALUE
144
148
  when Numeric
145
149
  self.number_value = value
146
150
  when String
@@ -160,6 +164,8 @@ module Google
160
164
  else
161
165
  raise UnexpectedStructType
162
166
  end
167
+
168
+ self
163
169
  end
164
170
  end
165
171
 
@@ -230,6 +236,5 @@ module Google
230
236
  ret
231
237
  end
232
238
  end
233
-
234
239
  end
235
240
  end
@@ -1,38 +1,34 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/protobuf/wrappers.proto
3
4
 
4
5
  require 'google/protobuf'
5
6
 
6
- Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_file("google/protobuf/wrappers.proto", :syntax => :proto3) do
8
- add_message "google.protobuf.DoubleValue" do
9
- optional :value, :double, 1
10
- end
11
- add_message "google.protobuf.FloatValue" do
12
- optional :value, :float, 1
13
- end
14
- add_message "google.protobuf.Int64Value" do
15
- optional :value, :int64, 1
16
- end
17
- add_message "google.protobuf.UInt64Value" do
18
- optional :value, :uint64, 1
19
- end
20
- add_message "google.protobuf.Int32Value" do
21
- optional :value, :int32, 1
22
- end
23
- add_message "google.protobuf.UInt32Value" do
24
- optional :value, :uint32, 1
25
- end
26
- add_message "google.protobuf.BoolValue" do
27
- optional :value, :bool, 1
28
- end
29
- add_message "google.protobuf.StringValue" do
30
- optional :value, :string, 1
31
- end
32
- add_message "google.protobuf.BytesValue" do
33
- optional :value, :bytes, 1
7
+
8
+ descriptor_data = "\n\x1egoogle/protobuf/wrappers.proto\x12\x0fgoogle.protobuf\"\x1c\n\x0b\x44oubleValue\x12\r\n\x05value\x18\x01 \x01(\x01\"\x1b\n\nFloatValue\x12\r\n\x05value\x18\x01 \x01(\x02\"\x1b\n\nInt64Value\x12\r\n\x05value\x18\x01 \x01(\x03\"\x1c\n\x0bUInt64Value\x12\r\n\x05value\x18\x01 \x01(\x04\"\x1b\n\nInt32Value\x12\r\n\x05value\x18\x01 \x01(\x05\"\x1c\n\x0bUInt32Value\x12\r\n\x05value\x18\x01 \x01(\r\"\x1a\n\tBoolValue\x12\r\n\x05value\x18\x01 \x01(\x08\"\x1c\n\x0bStringValue\x12\r\n\x05value\x18\x01 \x01(\t\"\x1b\n\nBytesValue\x12\r\n\x05value\x18\x01 \x01(\x0c\x42\x83\x01\n\x13\x63om.google.protobufB\rWrappersProtoP\x01Z1google.golang.org/protobuf/types/known/wrapperspb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3"
9
+
10
+ pool = Google::Protobuf::DescriptorPool.generated_pool
11
+
12
+ begin
13
+ pool.add_serialized_file(descriptor_data)
14
+ rescue TypeError => e
15
+ # Compatibility code: will be removed in the next major version.
16
+ require 'google/protobuf/descriptor_pb'
17
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
18
+ parsed.clear_dependency
19
+ serialized = parsed.class.encode(parsed)
20
+ file = pool.add_serialized_file(serialized)
21
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
22
+ imports = [
23
+ ]
24
+ imports.each do |type_name, expected_filename|
25
+ import_file = pool.lookup(type_name).file_descriptor
26
+ if import_file.name != expected_filename
27
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
34
28
  end
35
29
  end
30
+ warn "Each proto file must use a consistent fully-qualified name."
31
+ warn "This will become an error in the next major version."
36
32
  end
37
33
 
38
34
  module Google
@@ -59,16 +59,16 @@ require 'google/protobuf/repeated_field'
59
59
  module Google
60
60
  module Protobuf
61
61
 
62
- def self.encode(msg)
63
- msg.to_proto
62
+ def self.encode(msg, options = {})
63
+ msg.to_proto(options)
64
64
  end
65
65
 
66
66
  def self.encode_json(msg, options = {})
67
67
  msg.to_json(options)
68
68
  end
69
69
 
70
- def self.decode(klass, proto)
71
- klass.decode(proto)
70
+ def self.decode(klass, proto, options = {})
71
+ klass.decode(proto, options)
72
72
  end
73
73
 
74
74
  def self.decode_json(klass, json, options = {})
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.19.4
4
+ version: 3.23.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: 2022-01-28 00:00:00.000000000 Z
11
+ date: 2023-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler-dock
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.0
19
+ version: 1.2.1
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.0
26
+ version: 1.2.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake-compiler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,11 @@ files:
80
80
  - ext/google/protobuf_c/repeated_field.h
81
81
  - ext/google/protobuf_c/ruby-upb.c
82
82
  - ext/google/protobuf_c/ruby-upb.h
83
+ - ext/google/protobuf_c/third_party/utf8_range/LICENSE
84
+ - ext/google/protobuf_c/third_party/utf8_range/naive.c
85
+ - ext/google/protobuf_c/third_party/utf8_range/range2-neon.c
86
+ - ext/google/protobuf_c/third_party/utf8_range/range2-sse.c
87
+ - ext/google/protobuf_c/third_party/utf8_range/utf8_range.h
83
88
  - ext/google/protobuf_c/wrap_memcpy.c
84
89
  - lib/google/protobuf.rb
85
90
  - lib/google/protobuf/any_pb.rb
@@ -90,6 +95,7 @@ files:
90
95
  - lib/google/protobuf/empty_pb.rb
91
96
  - lib/google/protobuf/field_mask_pb.rb
92
97
  - lib/google/protobuf/message_exts.rb
98
+ - lib/google/protobuf/plugin_pb.rb
93
99
  - lib/google/protobuf/repeated_field.rb
94
100
  - lib/google/protobuf/source_context_pb.rb
95
101
  - lib/google/protobuf/struct_pb.rb
@@ -97,14 +103,11 @@ files:
97
103
  - lib/google/protobuf/type_pb.rb
98
104
  - lib/google/protobuf/well_known_types.rb
99
105
  - lib/google/protobuf/wrappers_pb.rb
100
- - tests/basic.rb
101
- - tests/generated_code_test.rb
102
- - tests/stress.rb
103
106
  homepage: https://developers.google.com/protocol-buffers
104
107
  licenses:
105
108
  - BSD-3-Clause
106
109
  metadata:
107
- source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.19.4/ruby
110
+ source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.23.4/ruby
108
111
  post_install_message:
109
112
  rdoc_options: []
110
113
  require_paths:
@@ -120,11 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
123
  - !ruby/object:Gem::Version
121
124
  version: '0'
122
125
  requirements: []
123
- rubygems_version: 3.3.6
126
+ rubygems_version: 3.0.8
124
127
  signing_key:
125
128
  specification_version: 4
126
129
  summary: Protocol Buffers
127
- test_files:
128
- - tests/basic.rb
129
- - tests/stress.rb
130
- - tests/generated_code_test.rb
130
+ test_files: []