protobuf 3.0.0 → 3.0.1
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.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/lib/protobuf/message.rb +1 -1
- data/lib/protobuf/version.rb +1 -1
- data/spec/lib/protobuf/message_spec.rb +1 -1
- data/spec/support/test/resource.pb.rb +5 -0
- data/spec/support/test/resource.proto +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53cdf77e2265a06c69501d39f521807dfc6612cf
|
4
|
+
data.tar.gz: 7312c52a61ba96d35cae01be21250d417c4b72fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec453a6e9a3702229c4f5f2fcdb4ee49d54c67713ca4b3b30d08201e4e93957446d12d9b6cd4fa59ac14e6e8a0e5ca52d21264f7a2df8b235fb51b5ba6a714ea
|
7
|
+
data.tar.gz: f1c900b5a393eaa9141ccd18c139d310f175ce5b28f152fe318b042e90c4f8c2a2b6abc12544afa4e0a297d956ed5cd36bc1ccb861e0d8465eae741a5bb9646a
|
data/CHANGES.md
CHANGED
data/lib/protobuf/message.rb
CHANGED
@@ -65,7 +65,7 @@ module Protobuf
|
|
65
65
|
value = @values[field.name]
|
66
66
|
|
67
67
|
if value.nil?
|
68
|
-
raise ::Protobuf::SerializationError, "Required field #{self.name}##{field.name} does not have a value."
|
68
|
+
raise ::Protobuf::SerializationError, "Required field #{self.class.name}##{field.name} does not have a value."
|
69
69
|
else
|
70
70
|
yield(field, value)
|
71
71
|
end
|
data/lib/protobuf/version.rb
CHANGED
@@ -128,7 +128,7 @@ describe Protobuf::Message do
|
|
128
128
|
end
|
129
129
|
|
130
130
|
context "when there's no value for a required field" do
|
131
|
-
let(:message) { ::Test::
|
131
|
+
let(:message) { ::Test::ResourceWithRequiredField.new }
|
132
132
|
|
133
133
|
it "raises a 'message not initialized' error" do
|
134
134
|
expect {
|
@@ -23,6 +23,7 @@ module Test
|
|
23
23
|
class ResourceFindRequest < ::Protobuf::Message; end
|
24
24
|
class ResourceSleepRequest < ::Protobuf::Message; end
|
25
25
|
class Resource < ::Protobuf::Message; end
|
26
|
+
class ResourceWithRequiredField < ::Protobuf::Message; end
|
26
27
|
class Searchable < ::Protobuf::Message
|
27
28
|
class SearchType < ::Protobuf::Enum
|
28
29
|
define :FLAT, 1
|
@@ -71,6 +72,10 @@ module Test
|
|
71
72
|
optional :bool, :ext_dup_field, 106, :extension => true
|
72
73
|
end
|
73
74
|
|
75
|
+
class ResourceWithRequiredField
|
76
|
+
required :string, :foo_is_required, 1
|
77
|
+
end
|
78
|
+
|
74
79
|
class MessageParent
|
75
80
|
class MessageChild
|
76
81
|
optional :string, :child1, 1
|