grpc 0.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +10 -0
  5. data/.rubocop_todo.yml +52 -0
  6. data/Gemfile +4 -0
  7. data/README.md +82 -0
  8. data/Rakefile +54 -0
  9. data/bin/apis/google/protobuf/empty.rb +44 -0
  10. data/bin/apis/pubsub_demo.rb +267 -0
  11. data/bin/apis/tech/pubsub/proto/pubsub.rb +174 -0
  12. data/bin/apis/tech/pubsub/proto/pubsub_services.rb +103 -0
  13. data/bin/interop/README.md +8 -0
  14. data/bin/interop/interop_client.rb +334 -0
  15. data/bin/interop/interop_server.rb +192 -0
  16. data/bin/interop/test/cpp/interop/empty.rb +44 -0
  17. data/bin/interop/test/cpp/interop/messages.rb +89 -0
  18. data/bin/interop/test/cpp/interop/test.rb +43 -0
  19. data/bin/interop/test/cpp/interop/test_services.rb +60 -0
  20. data/bin/math.proto +80 -0
  21. data/bin/math.rb +61 -0
  22. data/bin/math_client.rb +147 -0
  23. data/bin/math_server.rb +190 -0
  24. data/bin/math_services.rb +56 -0
  25. data/bin/noproto_client.rb +108 -0
  26. data/bin/noproto_server.rb +112 -0
  27. data/ext/grpc/extconf.rb +76 -0
  28. data/ext/grpc/rb_byte_buffer.c +241 -0
  29. data/ext/grpc/rb_byte_buffer.h +54 -0
  30. data/ext/grpc/rb_call.c +569 -0
  31. data/ext/grpc/rb_call.h +59 -0
  32. data/ext/grpc/rb_channel.c +264 -0
  33. data/ext/grpc/rb_channel.h +49 -0
  34. data/ext/grpc/rb_channel_args.c +154 -0
  35. data/ext/grpc/rb_channel_args.h +52 -0
  36. data/ext/grpc/rb_completion_queue.c +185 -0
  37. data/ext/grpc/rb_completion_queue.h +50 -0
  38. data/ext/grpc/rb_credentials.c +281 -0
  39. data/ext/grpc/rb_credentials.h +50 -0
  40. data/ext/grpc/rb_event.c +361 -0
  41. data/ext/grpc/rb_event.h +53 -0
  42. data/ext/grpc/rb_grpc.c +274 -0
  43. data/ext/grpc/rb_grpc.h +74 -0
  44. data/ext/grpc/rb_metadata.c +215 -0
  45. data/ext/grpc/rb_metadata.h +53 -0
  46. data/ext/grpc/rb_server.c +278 -0
  47. data/ext/grpc/rb_server.h +50 -0
  48. data/ext/grpc/rb_server_credentials.c +210 -0
  49. data/ext/grpc/rb_server_credentials.h +50 -0
  50. data/grpc.gemspec +41 -0
  51. data/lib/grpc.rb +39 -0
  52. data/lib/grpc/core/event.rb +44 -0
  53. data/lib/grpc/core/time_consts.rb +71 -0
  54. data/lib/grpc/errors.rb +61 -0
  55. data/lib/grpc/generic/active_call.rb +536 -0
  56. data/lib/grpc/generic/bidi_call.rb +221 -0
  57. data/lib/grpc/generic/client_stub.rb +413 -0
  58. data/lib/grpc/generic/rpc_desc.rb +150 -0
  59. data/lib/grpc/generic/rpc_server.rb +404 -0
  60. data/lib/grpc/generic/service.rb +235 -0
  61. data/lib/grpc/logconfig.rb +40 -0
  62. data/lib/grpc/version.rb +33 -0
  63. data/spec/alloc_spec.rb +44 -0
  64. data/spec/byte_buffer_spec.rb +67 -0
  65. data/spec/call_spec.rb +163 -0
  66. data/spec/channel_spec.rb +181 -0
  67. data/spec/client_server_spec.rb +372 -0
  68. data/spec/completion_queue_spec.rb +74 -0
  69. data/spec/credentials_spec.rb +71 -0
  70. data/spec/event_spec.rb +53 -0
  71. data/spec/generic/active_call_spec.rb +373 -0
  72. data/spec/generic/client_stub_spec.rb +519 -0
  73. data/spec/generic/rpc_desc_spec.rb +357 -0
  74. data/spec/generic/rpc_server_pool_spec.rb +139 -0
  75. data/spec/generic/rpc_server_spec.rb +404 -0
  76. data/spec/generic/service_spec.rb +342 -0
  77. data/spec/metadata_spec.rb +64 -0
  78. data/spec/server_credentials_spec.rb +69 -0
  79. data/spec/server_spec.rb +212 -0
  80. data/spec/spec_helper.rb +51 -0
  81. data/spec/testdata/README +1 -0
  82. data/spec/testdata/ca.pem +15 -0
  83. data/spec/testdata/server1.key +16 -0
  84. data/spec/testdata/server1.pem +16 -0
  85. data/spec/time_consts_spec.rb +89 -0
  86. metadata +353 -0
@@ -0,0 +1,89 @@
1
+ # Copyright 2015, Google Inc.
2
+ # All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are
6
+ # met:
7
+ #
8
+ # * Redistributions of source code must retain the above copyright
9
+ # notice, this list of conditions and the following disclaimer.
10
+ # * Redistributions in binary form must reproduce the above
11
+ # copyright notice, this list of conditions and the following disclaimer
12
+ # in the documentation and/or other materials provided with the
13
+ # distribution.
14
+ # * Neither the name of Google Inc. nor the names of its
15
+ # contributors may be used to endorse or promote products derived from
16
+ # this software without specific prior written permission.
17
+ #
18
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+
30
+ require 'grpc'
31
+
32
+ TimeConsts = GRPC::Core::TimeConsts
33
+
34
+ describe TimeConsts do
35
+ before(:each) do
36
+ @known_consts = [:ZERO, :INFINITE_FUTURE, :INFINITE_PAST].sort
37
+ end
38
+
39
+ it 'should have all the known types' do
40
+ expect(TimeConsts.constants.collect.sort).to eq(@known_consts)
41
+ end
42
+
43
+ describe '#to_time' do
44
+ it 'converts each constant to a Time' do
45
+ m = TimeConsts
46
+ m.constants.each do |c|
47
+ expect(m.const_get(c).to_time).to be_a(Time)
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ describe '#from_relative_time' do
54
+ it 'cannot handle arbitrary objects' do
55
+ expect { TimeConsts.from_relative_time(Object.new) }.to raise_error
56
+ end
57
+
58
+ it 'preserves TimeConsts' do
59
+ m = TimeConsts
60
+ m.constants.each do |c|
61
+ const = m.const_get(c)
62
+ expect(TimeConsts.from_relative_time(const)).to be(const)
63
+ end
64
+ end
65
+
66
+ it 'converts 0 to TimeConsts::ZERO' do
67
+ expect(TimeConsts.from_relative_time(0)).to eq(TimeConsts::ZERO)
68
+ end
69
+
70
+ it 'converts nil to TimeConsts::ZERO' do
71
+ expect(TimeConsts.from_relative_time(nil)).to eq(TimeConsts::ZERO)
72
+ end
73
+
74
+ it 'converts negative values to TimeConsts::INFINITE_FUTURE' do
75
+ [-1, -3.2, -1e6].each do |t|
76
+ y = TimeConsts.from_relative_time(t)
77
+ expect(y).to eq(TimeConsts::INFINITE_FUTURE)
78
+ end
79
+ end
80
+
81
+ it 'converts a positive value to an absolute time' do
82
+ epsilon = 1
83
+ [1, 3.2, 1e6].each do |t|
84
+ want = Time.now + t
85
+ abs = TimeConsts.from_relative_time(t)
86
+ expect(abs.to_f).to be_within(epsilon).of(want.to_f)
87
+ end
88
+ end
89
+ end
metadata ADDED
@@ -0,0 +1,353 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: grpc
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ platform: ruby
6
+ authors:
7
+ - gRPC Authors
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.9'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: google-protobuf
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 3.0.0alpha.1.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 3.0.0alpha.1.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: googleauth
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: logging
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.8'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.8'
69
+ - !ruby/object:Gem::Dependency
70
+ name: jwt
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.2.1
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.2.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: minitest
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '5.4'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '5.4'
97
+ - !ruby/object:Gem::Dependency
98
+ name: multi_json
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 1.10.1
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 1.10.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: signet
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.6.0
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.6.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: xray
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.1'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.1'
139
+ - !ruby/object:Gem::Dependency
140
+ name: bundler
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '1.7'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '1.7'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rake
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '10.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '10.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rake-compiler
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 0.28.0
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 0.28.0
195
+ - !ruby/object:Gem::Dependency
196
+ name: rspec
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '3.0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '3.0'
209
+ description: Send RPCs from Ruby using GRPC
210
+ email: temiola@google.com
211
+ executables:
212
+ - math.rb
213
+ - math_client.rb
214
+ - math_server.rb
215
+ - math_services.rb
216
+ - noproto_client.rb
217
+ - noproto_server.rb
218
+ extensions:
219
+ - ext/grpc/extconf.rb
220
+ extra_rdoc_files: []
221
+ files:
222
+ - ".gitignore"
223
+ - ".rspec"
224
+ - ".rubocop.yml"
225
+ - ".rubocop_todo.yml"
226
+ - Gemfile
227
+ - README.md
228
+ - Rakefile
229
+ - bin/apis/google/protobuf/empty.rb
230
+ - bin/apis/pubsub_demo.rb
231
+ - bin/apis/tech/pubsub/proto/pubsub.rb
232
+ - bin/apis/tech/pubsub/proto/pubsub_services.rb
233
+ - bin/interop/README.md
234
+ - bin/interop/interop_client.rb
235
+ - bin/interop/interop_server.rb
236
+ - bin/interop/test/cpp/interop/empty.rb
237
+ - bin/interop/test/cpp/interop/messages.rb
238
+ - bin/interop/test/cpp/interop/test.rb
239
+ - bin/interop/test/cpp/interop/test_services.rb
240
+ - bin/math.proto
241
+ - bin/math.rb
242
+ - bin/math_client.rb
243
+ - bin/math_server.rb
244
+ - bin/math_services.rb
245
+ - bin/noproto_client.rb
246
+ - bin/noproto_server.rb
247
+ - ext/grpc/extconf.rb
248
+ - ext/grpc/rb_byte_buffer.c
249
+ - ext/grpc/rb_byte_buffer.h
250
+ - ext/grpc/rb_call.c
251
+ - ext/grpc/rb_call.h
252
+ - ext/grpc/rb_channel.c
253
+ - ext/grpc/rb_channel.h
254
+ - ext/grpc/rb_channel_args.c
255
+ - ext/grpc/rb_channel_args.h
256
+ - ext/grpc/rb_completion_queue.c
257
+ - ext/grpc/rb_completion_queue.h
258
+ - ext/grpc/rb_credentials.c
259
+ - ext/grpc/rb_credentials.h
260
+ - ext/grpc/rb_event.c
261
+ - ext/grpc/rb_event.h
262
+ - ext/grpc/rb_grpc.c
263
+ - ext/grpc/rb_grpc.h
264
+ - ext/grpc/rb_metadata.c
265
+ - ext/grpc/rb_metadata.h
266
+ - ext/grpc/rb_server.c
267
+ - ext/grpc/rb_server.h
268
+ - ext/grpc/rb_server_credentials.c
269
+ - ext/grpc/rb_server_credentials.h
270
+ - grpc.gemspec
271
+ - lib/grpc.rb
272
+ - lib/grpc/core/event.rb
273
+ - lib/grpc/core/time_consts.rb
274
+ - lib/grpc/errors.rb
275
+ - lib/grpc/generic/active_call.rb
276
+ - lib/grpc/generic/bidi_call.rb
277
+ - lib/grpc/generic/client_stub.rb
278
+ - lib/grpc/generic/rpc_desc.rb
279
+ - lib/grpc/generic/rpc_server.rb
280
+ - lib/grpc/generic/service.rb
281
+ - lib/grpc/logconfig.rb
282
+ - lib/grpc/version.rb
283
+ - spec/alloc_spec.rb
284
+ - spec/byte_buffer_spec.rb
285
+ - spec/call_spec.rb
286
+ - spec/channel_spec.rb
287
+ - spec/client_server_spec.rb
288
+ - spec/completion_queue_spec.rb
289
+ - spec/credentials_spec.rb
290
+ - spec/event_spec.rb
291
+ - spec/generic/active_call_spec.rb
292
+ - spec/generic/client_stub_spec.rb
293
+ - spec/generic/rpc_desc_spec.rb
294
+ - spec/generic/rpc_server_pool_spec.rb
295
+ - spec/generic/rpc_server_spec.rb
296
+ - spec/generic/service_spec.rb
297
+ - spec/metadata_spec.rb
298
+ - spec/server_credentials_spec.rb
299
+ - spec/server_spec.rb
300
+ - spec/spec_helper.rb
301
+ - spec/testdata/README
302
+ - spec/testdata/ca.pem
303
+ - spec/testdata/server1.key
304
+ - spec/testdata/server1.pem
305
+ - spec/time_consts_spec.rb
306
+ homepage: https://github.com/google/grpc/tree/master/src/ruby
307
+ licenses:
308
+ - BSD-3-Clause
309
+ metadata: {}
310
+ post_install_message:
311
+ rdoc_options: []
312
+ require_paths:
313
+ - lib
314
+ required_ruby_version: !ruby/object:Gem::Requirement
315
+ requirements:
316
+ - - ">="
317
+ - !ruby/object:Gem::Version
318
+ version: '0'
319
+ required_rubygems_version: !ruby/object:Gem::Requirement
320
+ requirements:
321
+ - - ">="
322
+ - !ruby/object:Gem::Version
323
+ version: '0'
324
+ requirements: []
325
+ rubyforge_project:
326
+ rubygems_version: 2.4.3
327
+ signing_key:
328
+ specification_version: 4
329
+ summary: GRPC system in Ruby
330
+ test_files:
331
+ - spec/alloc_spec.rb
332
+ - spec/byte_buffer_spec.rb
333
+ - spec/call_spec.rb
334
+ - spec/channel_spec.rb
335
+ - spec/client_server_spec.rb
336
+ - spec/completion_queue_spec.rb
337
+ - spec/credentials_spec.rb
338
+ - spec/event_spec.rb
339
+ - spec/generic/active_call_spec.rb
340
+ - spec/generic/client_stub_spec.rb
341
+ - spec/generic/rpc_desc_spec.rb
342
+ - spec/generic/rpc_server_pool_spec.rb
343
+ - spec/generic/rpc_server_spec.rb
344
+ - spec/generic/service_spec.rb
345
+ - spec/metadata_spec.rb
346
+ - spec/server_credentials_spec.rb
347
+ - spec/server_spec.rb
348
+ - spec/spec_helper.rb
349
+ - spec/testdata/README
350
+ - spec/testdata/ca.pem
351
+ - spec/testdata/server1.key
352
+ - spec/testdata/server1.pem
353
+ - spec/time_consts_spec.rb