protobuf 2.8.13 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +84 -5
  3. data/CONTRIBUTING.md +3 -3
  4. data/Rakefile +46 -7
  5. data/lib/protobuf/cli.rb +2 -20
  6. data/lib/protobuf/decoder.rb +74 -0
  7. data/lib/protobuf/deprecator.rb +42 -0
  8. data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +17 -16
  9. data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +86 -85
  10. data/lib/protobuf/encoder.rb +62 -0
  11. data/lib/protobuf/enum.rb +298 -37
  12. data/lib/protobuf/field/base_field.rb +41 -27
  13. data/lib/protobuf/field/bool_field.rb +22 -4
  14. data/lib/protobuf/field/bytes_field.rb +36 -15
  15. data/lib/protobuf/field/double_field.rb +10 -3
  16. data/lib/protobuf/field/enum_field.rb +21 -18
  17. data/lib/protobuf/field/field_array.rb +26 -16
  18. data/lib/protobuf/field/fixed32_field.rb +10 -4
  19. data/lib/protobuf/field/fixed64_field.rb +10 -3
  20. data/lib/protobuf/field/float_field.rb +18 -5
  21. data/lib/protobuf/field/int32_field.rb +14 -4
  22. data/lib/protobuf/field/int64_field.rb +14 -4
  23. data/lib/protobuf/field/integer_field.rb +9 -4
  24. data/lib/protobuf/field/message_field.rb +16 -7
  25. data/lib/protobuf/field/sfixed32_field.rb +10 -3
  26. data/lib/protobuf/field/sfixed64_field.rb +12 -7
  27. data/lib/protobuf/field/signed_integer_field.rb +7 -0
  28. data/lib/protobuf/field/sint32_field.rb +14 -4
  29. data/lib/protobuf/field/sint64_field.rb +14 -4
  30. data/lib/protobuf/field/string_field.rb +11 -1
  31. data/lib/protobuf/field/uint32_field.rb +14 -4
  32. data/lib/protobuf/field/uint64_field.rb +14 -4
  33. data/lib/protobuf/field/varint_field.rb +11 -9
  34. data/lib/protobuf/field.rb +42 -25
  35. data/lib/protobuf/generators/enum_generator.rb +12 -1
  36. data/lib/protobuf/generators/field_generator.rb +1 -1
  37. data/lib/protobuf/lifecycle.rb +3 -4
  38. data/lib/protobuf/message/fields.rb +122 -0
  39. data/lib/protobuf/message/serialization.rb +84 -0
  40. data/lib/protobuf/message.rb +21 -221
  41. data/lib/protobuf/optionable.rb +23 -0
  42. data/lib/protobuf/rpc/client.rb +2 -4
  43. data/lib/protobuf/rpc/connector.rb +0 -2
  44. data/lib/protobuf/rpc/connectors/common.rb +2 -2
  45. data/lib/protobuf/rpc/dynamic_discovery.pb.rb +14 -16
  46. data/lib/protobuf/rpc/env.rb +58 -0
  47. data/lib/protobuf/rpc/error.rb +8 -5
  48. data/lib/protobuf/rpc/middleware/exception_handler.rb +36 -0
  49. data/lib/protobuf/rpc/middleware/logger.rb +91 -0
  50. data/lib/protobuf/rpc/middleware/request_decoder.rb +83 -0
  51. data/lib/protobuf/rpc/middleware/response_encoder.rb +88 -0
  52. data/lib/protobuf/rpc/middleware/runner.rb +18 -0
  53. data/lib/protobuf/rpc/middleware.rb +25 -0
  54. data/lib/protobuf/rpc/rpc.pb.rb +15 -16
  55. data/lib/protobuf/rpc/server.rb +14 -64
  56. data/lib/protobuf/rpc/servers/socket/server.rb +0 -2
  57. data/lib/protobuf/rpc/servers/socket/worker.rb +11 -15
  58. data/lib/protobuf/rpc/servers/zmq/util.rb +4 -1
  59. data/lib/protobuf/rpc/servers/zmq/worker.rb +5 -13
  60. data/lib/protobuf/rpc/servers/zmq_runner.rb +1 -1
  61. data/lib/protobuf/rpc/service.rb +38 -72
  62. data/lib/protobuf/rpc/service_dispatcher.rb +20 -108
  63. data/lib/protobuf/version.rb +1 -2
  64. data/lib/protobuf.rb +5 -13
  65. data/protobuf.gemspec +5 -5
  66. data/spec/benchmark/tasks.rb +2 -77
  67. data/spec/functional/zmq_server_spec.rb +13 -21
  68. data/spec/lib/protobuf/cli_spec.rb +5 -43
  69. data/spec/lib/protobuf/enum_spec.rb +194 -61
  70. data/spec/lib/protobuf/field_spec.rb +194 -0
  71. data/spec/lib/protobuf/generators/enum_generator_spec.rb +24 -1
  72. data/spec/lib/protobuf/generators/field_generator_spec.rb +6 -6
  73. data/spec/lib/protobuf/message_spec.rb +52 -70
  74. data/spec/lib/protobuf/optionable_spec.rb +46 -0
  75. data/spec/lib/protobuf/rpc/client_spec.rb +1 -93
  76. data/spec/lib/protobuf/rpc/connector_spec.rb +1 -7
  77. data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +8 -0
  78. data/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb +62 -0
  79. data/spec/lib/protobuf/rpc/middleware/logger_spec.rb +49 -0
  80. data/spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb +115 -0
  81. data/spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb +75 -0
  82. data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +0 -6
  83. data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +10 -0
  84. data/spec/lib/protobuf/rpc/service_dispatcher_spec.rb +30 -105
  85. data/spec/lib/protobuf/rpc/service_filters_spec.rb +4 -4
  86. data/spec/lib/protobuf/rpc/service_spec.rb +20 -24
  87. data/spec/lib/protobuf_spec.rb +3 -3
  88. data/spec/spec_helper.rb +5 -4
  89. data/spec/support/packed_field.rb +15 -14
  90. data/spec/support/server.rb +4 -21
  91. data/spec/support/test/defaults.pb.rb +4 -4
  92. data/spec/support/test/enum.pb.rb +13 -1
  93. data/spec/support/test/enum.proto +15 -0
  94. data/spec/support/test/extended.pb.rb +1 -1
  95. data/spec/support/test/google_unittest.pb.rb +239 -241
  96. data/spec/support/test/google_unittest_import.pb.rb +2 -2
  97. data/spec/support/test/multi_field_extensions.pb.rb +2 -2
  98. data/spec/support/test/resource.pb.rb +19 -18
  99. data/spec/support/test/resource.proto +1 -0
  100. data/spec/support/test/resource_service.rb +5 -0
  101. metadata +78 -57
  102. data/bin/rprotoc +0 -8
  103. data/lib/protobuf/enum_value.rb +0 -85
  104. data/lib/protobuf/evented.rb +0 -37
  105. data/lib/protobuf/ext/eventmachine.rb +0 -14
  106. data/lib/protobuf/field/extension_fields.rb +0 -32
  107. data/lib/protobuf/message/decoder.rb +0 -72
  108. data/lib/protobuf/message/message.rb +0 -1
  109. data/lib/protobuf/rpc/connectors/em_client.rb +0 -84
  110. data/lib/protobuf/rpc/connectors/eventmachine.rb +0 -87
  111. data/lib/protobuf/rpc/servers/evented/server.rb +0 -36
  112. data/lib/protobuf/rpc/servers/evented_runner.rb +0 -31
  113. data/spec/functional/embedded_service_spec.rb +0 -7
  114. data/spec/functional/evented_server_spec.rb +0 -64
  115. data/spec/lib/protobuf/enum_value_spec.rb +0 -29
  116. data/spec/lib/protobuf/rpc/servers/evented_server_spec.rb +0 -19
@@ -26,11 +26,11 @@ module GoogleUnittestImport
26
26
  # Message Fields
27
27
  #
28
28
  class PublicImportMessage
29
- optional ::Protobuf::Field::Int32Field, :e, 1
29
+ optional :int32, :e, 1
30
30
  end
31
31
 
32
32
  class ImportMessage
33
- optional ::Protobuf::Field::Int32Field, :d, 1
33
+ optional :int32, :d, 1
34
34
  end
35
35
 
36
36
  end
@@ -40,14 +40,14 @@ module Test
40
40
 
41
41
  class PayloadA
42
42
  class Foo
43
- optional ::Protobuf::Field::StringField, :foo_a, 1
43
+ optional :string, :foo_a, 1
44
44
  end
45
45
 
46
46
  end
47
47
 
48
48
  class PayloadB
49
49
  class Foo
50
- optional ::Protobuf::Field::StringField, :foo_b, 1
50
+ optional :string, :foo_b, 1
51
51
  end
52
52
 
53
53
  end
@@ -47,54 +47,54 @@ module Test
47
47
  # Message Fields
48
48
  #
49
49
  class ResourceFindRequest
50
- required ::Protobuf::Field::StringField, :name, 1
51
- optional ::Protobuf::Field::BoolField, :active, 2
52
- repeated ::Protobuf::Field::StringField, :widgets, 3
53
- repeated ::Protobuf::Field::BytesField, :widget_bytes, 4
50
+ required :string, :name, 1
51
+ optional :bool, :active, 2
52
+ repeated :string, :widgets, 3
53
+ repeated :bytes, :widget_bytes, 4
54
54
  end
55
55
 
56
56
  class ResourceSleepRequest
57
- optional ::Protobuf::Field::Int32Field, :sleep, 1
57
+ optional :int32, :sleep, 1
58
58
  end
59
59
 
60
60
  class Resource
61
- required ::Protobuf::Field::StringField, :name, 1
62
- optional ::Protobuf::Field::Int64Field, :date_created, 2
61
+ required :string, :name, 1
62
+ optional :int64, :date_created, 2
63
63
  optional ::Test::StatusType, :status, 3
64
64
  repeated ::Test::StatusType, :repeated_enum, 4
65
65
  # Extension Fields
66
66
  extensions 100...536870912
67
- optional ::Protobuf::Field::BoolField, :ext_is_searchable, 100, :extension => true
68
- optional ::Protobuf::Field::BoolField, :ext_is_hidden, 101, :extension => true
67
+ optional :bool, :ext_is_searchable, 100, :extension => true
68
+ optional :bool, :ext_is_hidden, 101, :extension => true
69
69
  optional ::Test::Searchable::SearchType, :ext_search_type, 102, :default => ::Test::Searchable::SearchType::FLAT, :extension => true
70
- optional ::Protobuf::Field::BoolField, :ext_nested_in_level_one, 105, :extension => true
71
- optional ::Protobuf::Field::BoolField, :ext_dup_field, 106, :extension => true
70
+ optional :bool, :ext_nested_in_level_one, 105, :extension => true
71
+ optional :bool, :ext_dup_field, 106, :extension => true
72
72
  end
73
73
 
74
74
  class MessageParent
75
75
  class MessageChild
76
- optional ::Protobuf::Field::StringField, :child1, 1
76
+ optional :string, :child1, 1
77
77
  end
78
78
 
79
79
  end
80
80
 
81
81
  class Nested
82
82
  class NestedLevelOne
83
- optional ::Protobuf::Field::BoolField, :level_one, 1, :default => true
83
+ optional :bool, :level_one, 1, :default => true
84
84
  # Extension Fields
85
85
  extensions 100...102
86
- optional ::Protobuf::Field::BoolField, :ext_nested_level_one_outer, 101, :extension => true
87
- optional ::Protobuf::Field::BoolField, :ext_nested_level_one, 100, :extension => true
86
+ optional :bool, :ext_nested_level_one_outer, 101, :extension => true
87
+ optional :bool, :ext_nested_level_one, 100, :extension => true
88
88
  end
89
89
 
90
- optional ::Protobuf::Field::StringField, :name, 1
90
+ optional :string, :name, 1
91
91
  optional ::Test::Resource, :resource, 2
92
92
  repeated ::Test::Resource, :multiple_resources, 3
93
93
  optional ::Test::StatusType, :status, 4
94
94
  # Extension Fields
95
95
  extensions 100...111
96
- optional ::Protobuf::Field::StringField, :foo, 100, :extension => true
97
- optional ::Protobuf::Field::Int64Field, :bar, 101, :extension => true
96
+ optional :string, :foo, 100, :extension => true
97
+ optional :int64, :bar, 101, :extension => true
98
98
  end
99
99
 
100
100
 
@@ -103,6 +103,7 @@ module Test
103
103
  #
104
104
  class ResourceService < ::Protobuf::Rpc::Service
105
105
  rpc :find, ::Test::ResourceFindRequest, ::Test::Resource
106
+ rpc :find_with_rpc_failed, ::Test::ResourceFindRequest, ::Test::Resource
106
107
  rpc :find_with_sleep, ::Test::ResourceSleepRequest, ::Test::Resource
107
108
  end
108
109
 
@@ -84,5 +84,6 @@ extend Nested.NestedLevelOne {
84
84
 
85
85
  service ResourceService {
86
86
  rpc Find (ResourceFindRequest) returns (Resource);
87
+ rpc FindWithRpcFailed (ResourceFindRequest) returns (Resource);
87
88
  rpc FindWithSleep (ResourceSleepRequest) returns (Resource);
88
89
  }
@@ -17,5 +17,10 @@ module Test
17
17
  response.name = 'Request should have timed out'
18
18
  end
19
19
 
20
+ # request -> Test::ResourceFindRequest
21
+ # response -> Test::Resource
22
+ def find_with_rpc_failed
23
+ rpc_failed('Find failed')
24
+ end
20
25
  end
21
26
  end
metadata CHANGED
@@ -1,169 +1,184 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.13
4
+ version: 3.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BJ Neilsen
8
8
  - Brandon Dewitt
9
9
  - Devin Christensen
10
+ - Adam Hutchison
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2014-03-13 00:00:00.000000000 Z
14
+ date: 2014-02-19 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: activesupport
17
18
  requirement: !ruby/object:Gem::Requirement
18
19
  requirements:
19
- - - ">="
20
+ - - '>='
20
21
  - !ruby/object:Gem::Version
21
- version: '0'
22
+ version: '3.2'
22
23
  type: :runtime
23
24
  prerelease: false
24
25
  version_requirements: !ruby/object:Gem::Requirement
25
26
  requirements:
26
- - - ">="
27
+ - - '>='
27
28
  - !ruby/object:Gem::Version
28
- version: '0'
29
+ version: '3.2'
29
30
  - !ruby/object:Gem::Dependency
30
- name: multi_json
31
+ name: middleware
31
32
  requirement: !ruby/object:Gem::Requirement
32
33
  requirements:
33
- - - ">="
34
+ - - '>='
34
35
  - !ruby/object:Gem::Version
35
36
  version: '0'
36
37
  type: :runtime
37
38
  prerelease: false
38
39
  version_requirements: !ruby/object:Gem::Requirement
39
40
  requirements:
40
- - - ">="
41
+ - - '>='
41
42
  - !ruby/object:Gem::Version
42
43
  version: '0'
43
44
  - !ruby/object:Gem::Dependency
44
- name: thor
45
+ name: multi_json
45
46
  requirement: !ruby/object:Gem::Requirement
46
47
  requirements:
47
- - - ">="
48
+ - - '>='
48
49
  - !ruby/object:Gem::Version
49
50
  version: '0'
50
51
  type: :runtime
51
52
  prerelease: false
52
53
  version_requirements: !ruby/object:Gem::Requirement
53
54
  requirements:
54
- - - ">="
55
+ - - '>='
55
56
  - !ruby/object:Gem::Version
56
57
  version: '0'
57
58
  - !ruby/object:Gem::Dependency
58
- name: eventmachine
59
+ name: thor
59
60
  requirement: !ruby/object:Gem::Requirement
60
61
  requirements:
61
- - - ">="
62
+ - - '>='
62
63
  - !ruby/object:Gem::Version
63
64
  version: '0'
64
- type: :development
65
+ type: :runtime
65
66
  prerelease: false
66
67
  version_requirements: !ruby/object:Gem::Requirement
67
68
  requirements:
68
- - - ">="
69
+ - - '>='
69
70
  - !ruby/object:Gem::Version
70
71
  version: '0'
71
72
  - !ruby/object:Gem::Dependency
72
73
  name: ffi-rzmq
73
74
  requirement: !ruby/object:Gem::Requirement
74
75
  requirements:
75
- - - ">="
76
+ - - '>='
76
77
  - !ruby/object:Gem::Version
77
78
  version: '0'
78
79
  type: :development
79
80
  prerelease: false
80
81
  version_requirements: !ruby/object:Gem::Requirement
81
82
  requirements:
82
- - - ">="
83
+ - - '>='
83
84
  - !ruby/object:Gem::Version
84
85
  version: '0'
85
86
  - !ruby/object:Gem::Dependency
86
87
  name: pry-nav
87
88
  requirement: !ruby/object:Gem::Requirement
88
89
  requirements:
89
- - - ">="
90
+ - - '>='
90
91
  - !ruby/object:Gem::Version
91
92
  version: '0'
92
93
  type: :development
93
94
  prerelease: false
94
95
  version_requirements: !ruby/object:Gem::Requirement
95
96
  requirements:
96
- - - ">="
97
+ - - '>='
97
98
  - !ruby/object:Gem::Version
98
99
  version: '0'
99
100
  - !ruby/object:Gem::Dependency
100
101
  name: rake
101
102
  requirement: !ruby/object:Gem::Requirement
102
103
  requirements:
103
- - - ">="
104
+ - - '>='
104
105
  - !ruby/object:Gem::Version
105
106
  version: '0'
106
107
  type: :development
107
108
  prerelease: false
108
109
  version_requirements: !ruby/object:Gem::Requirement
109
110
  requirements:
110
- - - ">="
111
+ - - '>='
111
112
  - !ruby/object:Gem::Version
112
113
  version: '0'
113
114
  - !ruby/object:Gem::Dependency
114
115
  name: rspec
115
116
  requirement: !ruby/object:Gem::Requirement
116
117
  requirements:
117
- - - ">="
118
+ - - '>='
118
119
  - !ruby/object:Gem::Version
119
120
  version: '0'
120
121
  type: :development
121
122
  prerelease: false
122
123
  version_requirements: !ruby/object:Gem::Requirement
123
124
  requirements:
124
- - - ">="
125
+ - - '>='
125
126
  - !ruby/object:Gem::Version
126
127
  version: '0'
127
128
  - !ruby/object:Gem::Dependency
128
129
  name: simplecov
129
130
  requirement: !ruby/object:Gem::Requirement
130
131
  requirements:
131
- - - ">="
132
+ - - '>='
132
133
  - !ruby/object:Gem::Version
133
134
  version: '0'
134
135
  type: :development
135
136
  prerelease: false
136
137
  version_requirements: !ruby/object:Gem::Requirement
137
138
  requirements:
138
- - - ">="
139
+ - - '>='
139
140
  - !ruby/object:Gem::Version
140
141
  version: '0'
141
142
  - !ruby/object:Gem::Dependency
142
143
  name: yard
143
144
  requirement: !ruby/object:Gem::Requirement
144
145
  requirements:
145
- - - ">="
146
+ - - '>='
146
147
  - !ruby/object:Gem::Version
147
148
  version: '0'
148
149
  type: :development
149
150
  prerelease: false
150
151
  version_requirements: !ruby/object:Gem::Requirement
151
152
  requirements:
152
- - - ">="
153
+ - - '>='
153
154
  - !ruby/object:Gem::Version
154
155
  version: '0'
155
156
  - !ruby/object:Gem::Dependency
156
157
  name: timecop
157
158
  requirement: !ruby/object:Gem::Requirement
158
159
  requirements:
159
- - - ">="
160
+ - - '>='
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ type: :development
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - '>='
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ - !ruby/object:Gem::Dependency
171
+ name: perftools.rb
172
+ requirement: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - '>='
160
175
  - !ruby/object:Gem::Version
161
176
  version: '0'
162
177
  type: :development
163
178
  prerelease: false
164
179
  version_requirements: !ruby/object:Gem::Requirement
165
180
  requirements:
166
- - - ">="
181
+ - - '>='
167
182
  - !ruby/object:Gem::Version
168
183
  version: '0'
169
184
  description: Google Protocol Buffers serialization and RPC implementation for Ruby.
@@ -171,16 +186,16 @@ email:
171
186
  - bj.neilsen+protobuf@gmail.com
172
187
  - brandonsdewitt+protobuf@gmail.com
173
188
  - quixoten@gmail.com
189
+ - liveh2o@gmail.com
174
190
  executables:
175
191
  - protoc-gen-ruby
176
192
  - rpc_server
177
- - rprotoc
178
193
  extensions: []
179
194
  extra_rdoc_files: []
180
195
  files:
181
- - ".gitignore"
182
- - ".travis.yml"
183
- - ".yardopts"
196
+ - .gitignore
197
+ - .travis.yml
198
+ - .yardopts
184
199
  - CHANGES.md
185
200
  - CONTRIBUTING.md
186
201
  - Gemfile
@@ -189,25 +204,23 @@ files:
189
204
  - Rakefile
190
205
  - bin/protoc-gen-ruby
191
206
  - bin/rpc_server
192
- - bin/rprotoc
193
207
  - lib/protobuf.rb
194
208
  - lib/protobuf/cli.rb
195
209
  - lib/protobuf/code_generator.rb
210
+ - lib/protobuf/decoder.rb
211
+ - lib/protobuf/deprecator.rb
196
212
  - lib/protobuf/descriptors.rb
197
213
  - lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb
198
214
  - lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb
215
+ - lib/protobuf/encoder.rb
199
216
  - lib/protobuf/enum.rb
200
- - lib/protobuf/enum_value.rb
201
- - lib/protobuf/evented.rb
202
217
  - lib/protobuf/exceptions.rb
203
- - lib/protobuf/ext/eventmachine.rb
204
218
  - lib/protobuf/field.rb
205
219
  - lib/protobuf/field/base_field.rb
206
220
  - lib/protobuf/field/bool_field.rb
207
221
  - lib/protobuf/field/bytes_field.rb
208
222
  - lib/protobuf/field/double_field.rb
209
223
  - lib/protobuf/field/enum_field.rb
210
- - lib/protobuf/field/extension_fields.rb
211
224
  - lib/protobuf/field/field_array.rb
212
225
  - lib/protobuf/field/fixed32_field.rb
213
226
  - lib/protobuf/field/fixed64_field.rb
@@ -237,25 +250,29 @@ files:
237
250
  - lib/protobuf/lifecycle.rb
238
251
  - lib/protobuf/logger.rb
239
252
  - lib/protobuf/message.rb
240
- - lib/protobuf/message/decoder.rb
241
- - lib/protobuf/message/message.rb
253
+ - lib/protobuf/message/fields.rb
254
+ - lib/protobuf/message/serialization.rb
255
+ - lib/protobuf/optionable.rb
242
256
  - lib/protobuf/rpc/buffer.rb
243
257
  - lib/protobuf/rpc/client.rb
244
258
  - lib/protobuf/rpc/connector.rb
245
259
  - lib/protobuf/rpc/connectors/base.rb
246
260
  - lib/protobuf/rpc/connectors/common.rb
247
- - lib/protobuf/rpc/connectors/em_client.rb
248
- - lib/protobuf/rpc/connectors/eventmachine.rb
249
261
  - lib/protobuf/rpc/connectors/socket.rb
250
262
  - lib/protobuf/rpc/connectors/zmq.rb
251
263
  - lib/protobuf/rpc/dynamic_discovery.pb.rb
264
+ - lib/protobuf/rpc/env.rb
252
265
  - lib/protobuf/rpc/error.rb
253
266
  - lib/protobuf/rpc/error/client_error.rb
254
267
  - lib/protobuf/rpc/error/server_error.rb
268
+ - lib/protobuf/rpc/middleware.rb
269
+ - lib/protobuf/rpc/middleware/exception_handler.rb
270
+ - lib/protobuf/rpc/middleware/logger.rb
271
+ - lib/protobuf/rpc/middleware/request_decoder.rb
272
+ - lib/protobuf/rpc/middleware/response_encoder.rb
273
+ - lib/protobuf/rpc/middleware/runner.rb
255
274
  - lib/protobuf/rpc/rpc.pb.rb
256
275
  - lib/protobuf/rpc/server.rb
257
- - lib/protobuf/rpc/servers/evented/server.rb
258
- - lib/protobuf/rpc/servers/evented_runner.rb
259
276
  - lib/protobuf/rpc/servers/socket/server.rb
260
277
  - lib/protobuf/rpc/servers/socket/worker.rb
261
278
  - lib/protobuf/rpc/servers/socket_runner.rb
@@ -286,16 +303,14 @@ files:
286
303
  - spec/data/types.bin
287
304
  - spec/encoding/all_types_spec.rb
288
305
  - spec/encoding/extreme_values_spec.rb
289
- - spec/functional/embedded_service_spec.rb
290
- - spec/functional/evented_server_spec.rb
291
306
  - spec/functional/socket_server_spec.rb
292
307
  - spec/functional/zmq_server_spec.rb
293
308
  - spec/lib/protobuf/cli_spec.rb
294
309
  - spec/lib/protobuf/code_generator_spec.rb
295
310
  - spec/lib/protobuf/enum_spec.rb
296
- - spec/lib/protobuf/enum_value_spec.rb
297
311
  - spec/lib/protobuf/field/int32_field_spec.rb
298
312
  - spec/lib/protobuf/field/string_field_spec.rb
313
+ - spec/lib/protobuf/field_spec.rb
299
314
  - spec/lib/protobuf/generators/base_spec.rb
300
315
  - spec/lib/protobuf/generators/enum_generator_spec.rb
301
316
  - spec/lib/protobuf/generators/extension_generator_spec.rb
@@ -306,13 +321,17 @@ files:
306
321
  - spec/lib/protobuf/lifecycle_spec.rb
307
322
  - spec/lib/protobuf/logger_spec.rb
308
323
  - spec/lib/protobuf/message_spec.rb
324
+ - spec/lib/protobuf/optionable_spec.rb
309
325
  - spec/lib/protobuf/rpc/client_spec.rb
310
326
  - spec/lib/protobuf/rpc/connector_spec.rb
311
327
  - spec/lib/protobuf/rpc/connectors/base_spec.rb
312
328
  - spec/lib/protobuf/rpc/connectors/common_spec.rb
313
329
  - spec/lib/protobuf/rpc/connectors/socket_spec.rb
314
330
  - spec/lib/protobuf/rpc/connectors/zmq_spec.rb
315
- - spec/lib/protobuf/rpc/servers/evented_server_spec.rb
331
+ - spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb
332
+ - spec/lib/protobuf/rpc/middleware/logger_spec.rb
333
+ - spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb
334
+ - spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb
316
335
  - spec/lib/protobuf/rpc/servers/socket_server_spec.rb
317
336
  - spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
318
337
  - spec/lib/protobuf/rpc/servers/zmq/util_spec.rb
@@ -359,17 +378,17 @@ require_paths:
359
378
  - lib
360
379
  required_ruby_version: !ruby/object:Gem::Requirement
361
380
  requirements:
362
- - - ">="
381
+ - - '>='
363
382
  - !ruby/object:Gem::Version
364
383
  version: '0'
365
384
  required_rubygems_version: !ruby/object:Gem::Requirement
366
385
  requirements:
367
- - - ">="
386
+ - - '>'
368
387
  - !ruby/object:Gem::Version
369
- version: '0'
388
+ version: 1.3.1
370
389
  requirements: []
371
390
  rubyforge_project:
372
- rubygems_version: 2.2.2
391
+ rubygems_version: 2.1.2
373
392
  signing_key:
374
393
  specification_version: 4
375
394
  summary: Google Protocol Buffers serialization and RPC implementation for Ruby.
@@ -380,16 +399,14 @@ test_files:
380
399
  - spec/data/types.bin
381
400
  - spec/encoding/all_types_spec.rb
382
401
  - spec/encoding/extreme_values_spec.rb
383
- - spec/functional/embedded_service_spec.rb
384
- - spec/functional/evented_server_spec.rb
385
402
  - spec/functional/socket_server_spec.rb
386
403
  - spec/functional/zmq_server_spec.rb
387
404
  - spec/lib/protobuf/cli_spec.rb
388
405
  - spec/lib/protobuf/code_generator_spec.rb
389
406
  - spec/lib/protobuf/enum_spec.rb
390
- - spec/lib/protobuf/enum_value_spec.rb
391
407
  - spec/lib/protobuf/field/int32_field_spec.rb
392
408
  - spec/lib/protobuf/field/string_field_spec.rb
409
+ - spec/lib/protobuf/field_spec.rb
393
410
  - spec/lib/protobuf/generators/base_spec.rb
394
411
  - spec/lib/protobuf/generators/enum_generator_spec.rb
395
412
  - spec/lib/protobuf/generators/extension_generator_spec.rb
@@ -400,13 +417,17 @@ test_files:
400
417
  - spec/lib/protobuf/lifecycle_spec.rb
401
418
  - spec/lib/protobuf/logger_spec.rb
402
419
  - spec/lib/protobuf/message_spec.rb
420
+ - spec/lib/protobuf/optionable_spec.rb
403
421
  - spec/lib/protobuf/rpc/client_spec.rb
404
422
  - spec/lib/protobuf/rpc/connector_spec.rb
405
423
  - spec/lib/protobuf/rpc/connectors/base_spec.rb
406
424
  - spec/lib/protobuf/rpc/connectors/common_spec.rb
407
425
  - spec/lib/protobuf/rpc/connectors/socket_spec.rb
408
426
  - spec/lib/protobuf/rpc/connectors/zmq_spec.rb
409
- - spec/lib/protobuf/rpc/servers/evented_server_spec.rb
427
+ - spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb
428
+ - spec/lib/protobuf/rpc/middleware/logger_spec.rb
429
+ - spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb
430
+ - spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb
410
431
  - spec/lib/protobuf/rpc/servers/socket_server_spec.rb
411
432
  - spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
412
433
  - spec/lib/protobuf/rpc/servers/zmq/util_spec.rb
data/bin/rprotoc DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- command = [ 'protoc', ARGV ].flatten.join(' ')
4
-
5
- $stderr.puts "[DEPRECATED] `rprotoc` is deprecated. Use `protoc --ruby_out ...` instead."
6
- $stdout.puts command
7
-
8
- exec command
@@ -1,85 +0,0 @@
1
- require 'delegate'
2
- require 'protobuf/enum'
3
-
4
- ##
5
- # Adding extension to Numeric until
6
- # we can get people to stop calling #value
7
- # on EnumValue
8
- class Numeric
9
- unless method_defined?(:value)
10
- def value
11
- self
12
- end
13
- end
14
- end
15
-
16
- module Protobuf
17
- class EnumValue < SimpleDelegator
18
-
19
- attr_reader :parent_class, :name
20
-
21
- ##
22
- # Constructor
23
- #
24
- def initialize(parent_class, name, value)
25
- @parent_class = parent_class
26
- @name = name
27
- @value = value
28
- super(@value)
29
- end
30
-
31
- # Overriding the class so ActiveRecord/Arel visitor will visit the enum as a Fixnum
32
- def class
33
- Fixnum
34
- end
35
-
36
- def inspect
37
- "\#<Protobuf::EnumValue #{@parent_class}::#{@name}=#{@value}>"
38
- end
39
-
40
- def to_i
41
- @value
42
- end
43
-
44
- def to_int
45
- @value.to_int
46
- end
47
-
48
- def to_s(format = :value_string)
49
- case format
50
- when :value_string then
51
- self.to_i.to_s
52
- when :name then
53
- name.to_s
54
- else
55
- self.to_i.to_s
56
- end
57
- end
58
-
59
- # Re-implement `try` in order to fix the problem where
60
- # the underlying fixnum doesn't respond to all methods (e.g. name or value).
61
- # If we respond to the first argument, `__send__` the args. Otherwise,
62
- # delegate the `try` call to the underlying vlaue fixnum.
63
- #
64
- def try(*args, &block)
65
- case
66
- when args.empty? && block_given?
67
- yield self
68
- when respond_to?(args.first)
69
- __send__(*args, &block)
70
- else
71
- @value.try(*args, &block)
72
- end
73
- end
74
-
75
- def value
76
- @value
77
- end
78
-
79
- ##
80
- # Instance Aliases
81
- #
82
- alias_method :to_hash_value, :to_i
83
- end
84
- end
85
-
@@ -1,37 +0,0 @@
1
- ##
2
- ## Evented Mode
3
- ##
4
- #
5
- # Require this file if you wish to run your server and/or client RPC
6
- # with the evented handlers via EventMachine.
7
- #
8
- # To run with rpc_server specify the switch `evented`:
9
- #
10
- # rpc_server --evented myapp.rb
11
- #
12
- # To run for client-side only override the require in your Gemfile:
13
- #
14
- # gem 'protobuf', :require => 'protobuf/evented'
15
- #
16
- $stderr.puts <<-WARN
17
- [DEPRECATED] You are using the evented connector and/or server which has been deprecated.
18
- Versions >= 3.0 will no longer provide the evented module for clients
19
- and servers. You should upgrade to the socket or zmq transport configurations.
20
-
21
- To upgrade your rpc_server, simply replace `--evented` option
22
- with `--socket` or `--zmq`. If you are using the `PB_CLIENT_TYPE`
23
- env variable, simply assign it to socket or zmq.
24
-
25
- If you are requiring the gem in your gemfile expclitly, change
26
- the require to match your chosen transport type:
27
-
28
- `gem 'protobuf', :require => 'protobuf/socket'`
29
- WARN
30
-
31
- require 'protobuf'
32
- Protobuf.connector_type = :evented
33
-
34
- require 'eventmachine'
35
- require 'protobuf/ext/eventmachine'
36
- require 'protobuf/rpc/servers/evented/server'
37
- require 'protobuf/rpc/connectors/eventmachine'
@@ -1,14 +0,0 @@
1
- require 'fiber'
2
-
3
- # Method from em-synchrony
4
- # https://github.com/igrigorik/em-synchrony
5
- #
6
- # A convenience method for wrapping EM.run body within
7
- # a Ruby Fiber such that async operations can be transparently
8
- # paused and resumed based on IO scheduling
9
- module EventMachine
10
- def self.fiber_run(blk=nil, tail=nil, &block)
11
- context = Proc.new{ Fiber.new{ (b = blk || block) and b.call }.resume }
12
- self.run(context, tail)
13
- end
14
- end