protobuf 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -112,10 +112,9 @@ module Protobuf
112
112
  # Constructor
113
113
  #
114
114
  def initialize(values = {})
115
- values = values.to_hash
116
115
  @values = {}
117
-
118
- values.each { |name, val| self[name] = val}
116
+ values = values.to_hash
117
+ values.each { |name, val| self[name] = val unless val.nil? }
119
118
  end
120
119
 
121
120
  def initialized?
@@ -1,4 +1,4 @@
1
1
  module Protobuf
2
- VERSION = '2.1.1'
2
+ VERSION = '2.1.2'
3
3
  PROTOC_VERSION = '2.4.1'
4
4
  end
@@ -2,6 +2,24 @@ require 'spec_helper'
2
2
 
3
3
  describe Protobuf::Message do
4
4
 
5
+ describe '#initialize' do
6
+ it "does not try to set attributes which have nil values" do
7
+ Test::EnumTestMessage.any_instance.should_not_receive("non_default_enum=")
8
+ test_enum = Test::EnumTestMessage.new(:non_default_enum => nil)
9
+ end
10
+
11
+ it "takes a hash as an initialization argument" do
12
+ test_enum = Test::EnumTestMessage.new(:non_default_enum => 2)
13
+ test_enum.non_default_enum.should eq(2)
14
+ end
15
+
16
+ it "initializes with an object that responds to #to_hash" do
17
+ hashie_object = OpenStruct.new(:to_hash => { :non_default_enum => 2 })
18
+ test_enum = Test::EnumTestMessage.new(hashie_object)
19
+ test_enum.non_default_enum.should eq(2)
20
+ end
21
+ end
22
+
5
23
  describe '#to_hash' do
6
24
  context 'generating values for an ENUM field' do
7
25
  it 'converts the enum to its tag representation' do
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: 2.1.1
4
+ version: 2.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-06 00:00:00.000000000Z
13
+ date: 2012-11-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
17
- requirement: &2152100680 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,15 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2152100680
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
26
31
  - !ruby/object:Gem::Dependency
27
32
  name: ffi
28
- requirement: &2152099380 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
29
34
  none: false
30
35
  requirements:
31
36
  - - ! '>='
@@ -33,10 +38,15 @@ dependencies:
33
38
  version: '0'
34
39
  type: :runtime
35
40
  prerelease: false
36
- version_requirements: *2152099380
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
37
47
  - !ruby/object:Gem::Dependency
38
48
  name: multi_json
39
- requirement: &2152098400 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
40
50
  none: false
41
51
  requirements:
42
52
  - - ! '>='
@@ -44,10 +54,15 @@ dependencies:
44
54
  version: '0'
45
55
  type: :runtime
46
56
  prerelease: false
47
- version_requirements: *2152098400
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
48
63
  - !ruby/object:Gem::Dependency
49
64
  name: thor
50
- requirement: &2152097220 !ruby/object:Gem::Requirement
65
+ requirement: !ruby/object:Gem::Requirement
51
66
  none: false
52
67
  requirements:
53
68
  - - ! '>='
@@ -55,10 +70,15 @@ dependencies:
55
70
  version: '0'
56
71
  type: :runtime
57
72
  prerelease: false
58
- version_requirements: *2152097220
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
59
79
  - !ruby/object:Gem::Dependency
60
80
  name: eventmachine
61
- requirement: &2152095600 !ruby/object:Gem::Requirement
81
+ requirement: !ruby/object:Gem::Requirement
62
82
  none: false
63
83
  requirements:
64
84
  - - ! '>='
@@ -66,10 +86,15 @@ dependencies:
66
86
  version: '0'
67
87
  type: :development
68
88
  prerelease: false
69
- version_requirements: *2152095600
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
70
95
  - !ruby/object:Gem::Dependency
71
96
  name: ffi-rzmq
72
- requirement: &2152094240 !ruby/object:Gem::Requirement
97
+ requirement: !ruby/object:Gem::Requirement
73
98
  none: false
74
99
  requirements:
75
100
  - - ! '>='
@@ -77,10 +102,15 @@ dependencies:
77
102
  version: '0'
78
103
  type: :development
79
104
  prerelease: false
80
- version_requirements: *2152094240
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
81
111
  - !ruby/object:Gem::Dependency
82
112
  name: perftools.rb
83
- requirement: &2152088440 !ruby/object:Gem::Requirement
113
+ requirement: !ruby/object:Gem::Requirement
84
114
  none: false
85
115
  requirements:
86
116
  - - ! '>='
@@ -88,10 +118,15 @@ dependencies:
88
118
  version: '0'
89
119
  type: :development
90
120
  prerelease: false
91
- version_requirements: *2152088440
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
92
127
  - !ruby/object:Gem::Dependency
93
128
  name: pry
94
- requirement: &2152087100 !ruby/object:Gem::Requirement
129
+ requirement: !ruby/object:Gem::Requirement
95
130
  none: false
96
131
  requirements:
97
132
  - - ! '>='
@@ -99,10 +134,15 @@ dependencies:
99
134
  version: '0'
100
135
  type: :development
101
136
  prerelease: false
102
- version_requirements: *2152087100
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
103
143
  - !ruby/object:Gem::Dependency
104
144
  name: pry-nav
105
- requirement: &2152086180 !ruby/object:Gem::Requirement
145
+ requirement: !ruby/object:Gem::Requirement
106
146
  none: false
107
147
  requirements:
108
148
  - - ! '>='
@@ -110,10 +150,15 @@ dependencies:
110
150
  version: '0'
111
151
  type: :development
112
152
  prerelease: false
113
- version_requirements: *2152086180
153
+ version_requirements: !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ! '>='
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
114
159
  - !ruby/object:Gem::Dependency
115
160
  name: rake
116
- requirement: &2152085220 !ruby/object:Gem::Requirement
161
+ requirement: !ruby/object:Gem::Requirement
117
162
  none: false
118
163
  requirements:
119
164
  - - ! '>='
@@ -121,10 +166,15 @@ dependencies:
121
166
  version: '0'
122
167
  type: :development
123
168
  prerelease: false
124
- version_requirements: *2152085220
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ none: false
171
+ requirements:
172
+ - - ! '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
125
175
  - !ruby/object:Gem::Dependency
126
176
  name: rake-compiler
127
- requirement: &2152083820 !ruby/object:Gem::Requirement
177
+ requirement: !ruby/object:Gem::Requirement
128
178
  none: false
129
179
  requirements:
130
180
  - - ! '>='
@@ -132,10 +182,15 @@ dependencies:
132
182
  version: '0'
133
183
  type: :development
134
184
  prerelease: false
135
- version_requirements: *2152083820
185
+ version_requirements: !ruby/object:Gem::Requirement
186
+ none: false
187
+ requirements:
188
+ - - ! '>='
189
+ - !ruby/object:Gem::Version
190
+ version: '0'
136
191
  - !ruby/object:Gem::Dependency
137
192
  name: rspec
138
- requirement: &2152082700 !ruby/object:Gem::Requirement
193
+ requirement: !ruby/object:Gem::Requirement
139
194
  none: false
140
195
  requirements:
141
196
  - - ! '>='
@@ -143,10 +198,15 @@ dependencies:
143
198
  version: '0'
144
199
  type: :development
145
200
  prerelease: false
146
- version_requirements: *2152082700
201
+ version_requirements: !ruby/object:Gem::Requirement
202
+ none: false
203
+ requirements:
204
+ - - ! '>='
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
147
207
  - !ruby/object:Gem::Dependency
148
208
  name: simplecov
149
- requirement: &2152081360 !ruby/object:Gem::Requirement
209
+ requirement: !ruby/object:Gem::Requirement
150
210
  none: false
151
211
  requirements:
152
212
  - - ! '>='
@@ -154,10 +214,15 @@ dependencies:
154
214
  version: '0'
155
215
  type: :development
156
216
  prerelease: false
157
- version_requirements: *2152081360
217
+ version_requirements: !ruby/object:Gem::Requirement
218
+ none: false
219
+ requirements:
220
+ - - ! '>='
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
158
223
  - !ruby/object:Gem::Dependency
159
224
  name: yard
160
- requirement: &2152080320 !ruby/object:Gem::Requirement
225
+ requirement: !ruby/object:Gem::Requirement
161
226
  none: false
162
227
  requirements:
163
228
  - - ! '>='
@@ -165,7 +230,12 @@ dependencies:
165
230
  version: '0'
166
231
  type: :development
167
232
  prerelease: false
168
- version_requirements: *2152080320
233
+ version_requirements: !ruby/object:Gem::Requirement
234
+ none: false
235
+ requirements:
236
+ - - ! '>='
237
+ - !ruby/object:Gem::Version
238
+ version: '0'
169
239
  description: Google Protocol Buffers v2.4.1 Serialization and RPC implementation for
170
240
  Ruby.
171
241
  email:
@@ -446,7 +516,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
446
516
  version: '0'
447
517
  segments:
448
518
  - 0
449
- hash: 893090751339011969
519
+ hash: 2044720871267404005
450
520
  required_rubygems_version: !ruby/object:Gem::Requirement
451
521
  none: false
452
522
  requirements:
@@ -455,92 +525,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
455
525
  version: '0'
456
526
  segments:
457
527
  - 0
458
- hash: 893090751339011969
528
+ hash: 2044720871267404005
459
529
  requirements: []
460
530
  rubyforge_project:
461
- rubygems_version: 1.8.15
531
+ rubygems_version: 1.8.24
462
532
  signing_key:
463
533
  specification_version: 3
464
534
  summary: Google Protocol Buffers v2.4.1 Serialization and RPC implementation for Ruby.
465
- test_files:
466
- - spec/benchmark/tasks.rb
467
- - spec/functional/embedded_service_spec.rb
468
- - spec/functional/evented_server_spec.rb
469
- - spec/functional/socket_server_spec.rb
470
- - spec/functional/zmq_server_spec.rb
471
- - spec/lib/protobuf/cli_spec.rb
472
- - spec/lib/protobuf/enum_spec.rb
473
- - spec/lib/protobuf/enum_value_spec.rb
474
- - spec/lib/protobuf/logger_spec.rb
475
- - spec/lib/protobuf/message/encoder_spec.rb
476
- - spec/lib/protobuf/message_spec.rb
477
- - spec/lib/protobuf/rpc/client_spec.rb
478
- - spec/lib/protobuf/rpc/connector_spec.rb
479
- - spec/lib/protobuf/rpc/connectors/base_spec.rb
480
- - spec/lib/protobuf/rpc/connectors/common_spec.rb
481
- - spec/lib/protobuf/rpc/connectors/socket_spec.rb
482
- - spec/lib/protobuf/rpc/connectors/zmq_spec.rb
483
- - spec/lib/protobuf/rpc/servers/evented_server_spec.rb
484
- - spec/lib/protobuf/rpc/servers/socket_server_spec.rb
485
- - spec/lib/protobuf/rpc/servers/zmq/broker_spec.rb
486
- - spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
487
- - spec/lib/protobuf/rpc/servers/zmq/util_spec.rb
488
- - spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb
489
- - spec/lib/protobuf/rpc/service_dispatcher_spec.rb
490
- - spec/lib/protobuf/rpc/service_filters_spec.rb
491
- - spec/lib/protobuf/rpc/service_spec.rb
492
- - spec/lib/protobuf_spec.rb
493
- - spec/spec_helper.rb
494
- - spec/support/all.rb
495
- - spec/support/server.rb
496
- - spec/support/test/enum.pb.rb
497
- - spec/support/test/enum.proto
498
- - spec/support/test/resource.pb.rb
499
- - spec/support/test/resource.proto
500
- - spec/support/test/resource_service.rb
501
- - spec/support/test_app_file.rb
502
- - spec/support/tolerance_matcher.rb
503
- - test/data/data.bin
504
- - test/data/data_source.py
505
- - test/data/types.bin
506
- - test/data/types_source.py
507
- - test/data/unk.png
508
- - test/proto/addressbook.pb.rb
509
- - test/proto/addressbook.proto
510
- - test/proto/addressbook_base.pb.rb
511
- - test/proto/addressbook_base.proto
512
- - test/proto/addressbook_ext.pb.rb
513
- - test/proto/addressbook_ext.proto
514
- - test/proto/collision.pb.rb
515
- - test/proto/collision.proto
516
- - test/proto/ext_collision.pb.rb
517
- - test/proto/ext_collision.proto
518
- - test/proto/ext_range.pb.rb
519
- - test/proto/ext_range.proto
520
- - test/proto/float_default.proto
521
- - test/proto/lowercase.pb.rb
522
- - test/proto/lowercase.proto
523
- - test/proto/merge.pb.rb
524
- - test/proto/merge.proto
525
- - test/proto/nested.pb.rb
526
- - test/proto/nested.proto
527
- - test/proto/optional_field.pb.rb
528
- - test/proto/optional_field.proto
529
- - test/proto/packed.pb.rb
530
- - test/proto/packed.proto
531
- - test/proto/rpc.proto
532
- - test/proto/types.pb.rb
533
- - test/proto/types.proto
534
- - test/test_addressbook.rb
535
- - test/test_enum_value.rb
536
- - test/test_extension.rb
537
- - test/test_lowercase.rb
538
- - test/test_message.rb
539
- - test/test_optional_field.rb
540
- - test/test_packed_field.rb
541
- - test/test_parse.rb
542
- - test/test_repeated_types.rb
543
- - test/test_serialize.rb
544
- - test/test_standard_message.rb
545
- - test/test_types.rb
535
+ test_files: []
546
536
  has_rdoc: