protobuf 2.7.4-java → 2.7.5-java
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/lib/protobuf/message.rb +4 -0
- data/lib/protobuf/version.rb +1 -1
- data/spec/lib/protobuf/message_spec.rb +16 -0
- metadata +2 -2
data/lib/protobuf/message.rb
CHANGED
@@ -34,6 +34,10 @@ module Protobuf
|
|
34
34
|
field_definition = ::Protobuf::Field.build(self, rule, type, fname, tag, options)
|
35
35
|
field_name_hash[fname] = tag
|
36
36
|
field_array[tag] = field_definition
|
37
|
+
|
38
|
+
define_method("#{fname}!") do
|
39
|
+
@values[fname]
|
40
|
+
end
|
37
41
|
end
|
38
42
|
|
39
43
|
# Reserve field numbers for extensions. Don't use this method directly.
|
data/lib/protobuf/version.rb
CHANGED
@@ -3,6 +3,22 @@ require 'spec_helper'
|
|
3
3
|
describe Protobuf::Message do
|
4
4
|
|
5
5
|
describe '#initialize' do
|
6
|
+
it "initializes the enum getter to 0" do
|
7
|
+
test_enum = Test::EnumTestMessage.new
|
8
|
+
test_enum.non_default_enum.should eq(0)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "exposes the enum getter raw value through ! method" do
|
12
|
+
test_enum = Test::EnumTestMessage.new
|
13
|
+
test_enum.non_default_enum!.should be_nil
|
14
|
+
end
|
15
|
+
|
16
|
+
it "exposes the enum getter raw value through ! method (when set)" do
|
17
|
+
test_enum = Test::EnumTestMessage.new
|
18
|
+
test_enum.non_default_enum = 1
|
19
|
+
test_enum.non_default_enum!.should eq(1)
|
20
|
+
end
|
21
|
+
|
6
22
|
it "does not try to set attributes which have nil values" do
|
7
23
|
Test::EnumTestMessage.any_instance.should_not_receive("non_default_enum=")
|
8
24
|
test_enum = Test::EnumTestMessage.new(:non_default_enum => nil)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: protobuf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.7.
|
5
|
+
version: 2.7.5
|
6
6
|
platform: java
|
7
7
|
authors:
|
8
8
|
- BJ Neilsen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-03-
|
13
|
+
date: 2013-03-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|