protobuf 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: feddea356bf59f68e37664372a458f1573d54923
4
- data.tar.gz: 9e8950a881ea6b3433dede11594f8cf57b72154f
3
+ metadata.gz: 53cdf77e2265a06c69501d39f521807dfc6612cf
4
+ data.tar.gz: 7312c52a61ba96d35cae01be21250d417c4b72fb
5
5
  SHA512:
6
- metadata.gz: 0f914482a71eb64f8097dceb55fafd2b18abc5eff4198082fdd642c479e78221a65139b9015eb55b78fed21a7055bca1e938301eb2245cb8cbb7d6f77064a9cc
7
- data.tar.gz: e6c14db07c7c0b7424cabf2a485b779586ef810737aaaa482f9225715923c2a3afabe81f14e8c7a2a1c1f957c1b2a981c2b13afe13ec8d6a19a09758de7dbfe9
6
+ metadata.gz: ec453a6e9a3702229c4f5f2fcdb4ee49d54c67713ca4b3b30d08201e4e93957446d12d9b6cd4fa59ac14e6e8a0e5ca52d21264f7a2df8b235fb51b5ba6a714ea
7
+ data.tar.gz: f1c900b5a393eaa9141ccd18c139d310f175ce5b28f152fe318b042e90c4f8c2a2b6abc12544afa4e0a297d956ed5cd36bc1ccb861e0d8465eae741a5bb9646a
data/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Stable (3.x)
2
2
 
3
+ 3.0.1
4
+ ---------
5
+
6
+ - Fix NoMethodError that can occur when serializing a message with a missing required field. [#187, @abrandoned]
7
+
3
8
  3.0.0
4
9
  ---------
5
10
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Protobuf
2
- VERSION = '3.0.0'
2
+ VERSION = '3.0.1'
3
3
  end
@@ -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::Resource.new }
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
@@ -27,6 +27,10 @@ message Resource {
27
27
  repeated StatusType repeated_enum = 4;
28
28
  }
29
29
 
30
+ message ResourceWithRequiredField {
31
+ required string foo_is_required = 1;
32
+ }
33
+
30
34
  message Searchable {
31
35
  enum SearchType {
32
36
  FLAT = 1;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BJ Neilsen