upfluence-thrift 1.0.10 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +5 -5
  2. data/lib/thrift.rb +6 -4
  3. data/lib/thrift/client.rb +31 -1
  4. data/lib/thrift/definition.rb +64 -0
  5. data/lib/thrift/middleware.rb +50 -0
  6. data/lib/thrift/processor.rb +35 -11
  7. data/lib/thrift/protocol/json_protocol.rb +6 -6
  8. data/lib/thrift/server/rack_application.rb +30 -19
  9. data/lib/thrift/struct.rb +10 -10
  10. data/lib/thrift/transport/base_transport.rb +9 -7
  11. data/lib/thrift/transport/server_socket.rb +6 -6
  12. data/spec/rack_application_spec.rb +1 -1
  13. metadata +15 -84
  14. data/benchmark/gen-rb/benchmark_constants.rb +0 -11
  15. data/benchmark/gen-rb/benchmark_service.rb +0 -80
  16. data/benchmark/gen-rb/benchmark_types.rb +0 -10
  17. data/spec/gen-rb/base/base_service.rb +0 -80
  18. data/spec/gen-rb/base/base_service_constants.rb +0 -11
  19. data/spec/gen-rb/base/base_service_types.rb +0 -26
  20. data/spec/gen-rb/extended/extended_service.rb +0 -78
  21. data/spec/gen-rb/extended/extended_service_constants.rb +0 -11
  22. data/spec/gen-rb/extended/extended_service_types.rb +0 -12
  23. data/spec/gen-rb/flat/namespaced_nonblocking_service.rb +0 -272
  24. data/spec/gen-rb/flat/referenced_constants.rb +0 -11
  25. data/spec/gen-rb/flat/referenced_types.rb +0 -17
  26. data/spec/gen-rb/flat/thrift_namespaced_spec_constants.rb +0 -11
  27. data/spec/gen-rb/flat/thrift_namespaced_spec_types.rb +0 -28
  28. data/spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb +0 -272
  29. data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb +0 -11
  30. data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb +0 -28
  31. data/spec/gen-rb/nonblocking_service.rb +0 -272
  32. data/spec/gen-rb/other_namespace/referenced_constants.rb +0 -11
  33. data/spec/gen-rb/other_namespace/referenced_types.rb +0 -17
  34. data/spec/gen-rb/thrift_spec_constants.rb +0 -11
  35. data/spec/gen-rb/thrift_spec_types.rb +0 -538
  36. data/test/debug_proto/gen-rb/debug_proto_test_constants.rb +0 -274
  37. data/test/debug_proto/gen-rb/debug_proto_test_types.rb +0 -761
  38. data/test/debug_proto/gen-rb/empty_service.rb +0 -24
  39. data/test/debug_proto/gen-rb/inherited.rb +0 -79
  40. data/test/debug_proto/gen-rb/reverse_order_service.rb +0 -82
  41. data/test/debug_proto/gen-rb/service_for_exception_with_a_map.rb +0 -81
  42. data/test/debug_proto/gen-rb/srv.rb +0 -330
@@ -1,5 +1,5 @@
1
1
  # encoding: ascii-8bit
2
- #
2
+ #
3
3
  # Licensed to the Apache Software Foundation (ASF) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -7,16 +7,16 @@
7
7
  # to you under the Apache License, Version 2.0 (the
8
8
  # "License"); you may not use this file except in compliance
9
9
  # with the License. You may obtain a copy of the License at
10
- #
10
+ #
11
11
  # http://www.apache.org/licenses/LICENSE-2.0
12
- #
12
+ #
13
13
  # Unless required by applicable law or agreed to in writing,
14
14
  # software distributed under the License is distributed on an
15
15
  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
16
  # KIND, either express or implied. See the License for the
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
- #
19
+ #
20
20
 
21
21
  module Thrift
22
22
  class TransportException < Exception
@@ -48,7 +48,7 @@ module Thrift
48
48
 
49
49
  class BaseTransport
50
50
  def open?; end
51
-
51
+
52
52
  def open; end
53
53
 
54
54
  def close; end
@@ -62,6 +62,8 @@ module Thrift
62
62
  raise NotImplementedError
63
63
  end
64
64
 
65
+ def set_context(ctx); end
66
+
65
67
  # Returns an unsigned byte as a Fixnum in the range (0..255).
66
68
  def read_byte
67
69
  buf = read_all(1)
@@ -86,7 +88,7 @@ module Thrift
86
88
  chunk = read(size - buf.length)
87
89
  buf << chunk
88
90
  end
89
-
91
+
90
92
  buf
91
93
  end
92
94
 
@@ -100,7 +102,7 @@ module Thrift
100
102
 
101
103
  def flush; end
102
104
  end
103
-
105
+
104
106
  class BaseTransportFactory
105
107
  def get_transport(trans)
106
108
  return trans
@@ -1,5 +1,5 @@
1
1
  # encoding: ascii-8bit
2
- #
2
+ #
3
3
  # Licensed to the Apache Software Foundation (ASF) under one
4
4
  # or more contributor license agreements. See the NOTICE file
5
5
  # distributed with this work for additional information
@@ -7,16 +7,16 @@
7
7
  # to you under the Apache License, Version 2.0 (the
8
8
  # "License"); you may not use this file except in compliance
9
9
  # with the License. You may obtain a copy of the License at
10
- #
10
+ #
11
11
  # http://www.apache.org/licenses/LICENSE-2.0
12
- #
12
+ #
13
13
  # Unless required by applicable law or agreed to in writing,
14
14
  # software distributed under the License is distributed on an
15
15
  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
16
  # KIND, either express or implied. See the License for the
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
- #
19
+ #
20
20
 
21
21
  require 'socket'
22
22
 
@@ -37,7 +37,7 @@ module Thrift
37
37
  attr_reader :handle
38
38
 
39
39
  def listen
40
- @handle = TCPServer.new(@host, @port)
40
+ @handle ||= TCPServer.new(@host, @port)
41
41
  end
42
42
 
43
43
  def accept
@@ -60,4 +60,4 @@ module Thrift
60
60
 
61
61
  alias to_io handle
62
62
  end
63
- end
63
+ end
@@ -57,7 +57,7 @@ describe Thrift::RackApplication do
57
57
 
58
58
  it 'creates an IOStreamTransport' do
59
59
  header('Content-Type', "application/x-thrift")
60
- Thrift::IOStreamTransport.should_receive(:new).with(an_instance_of(Rack::Lint::InputWrapper), an_instance_of(Rack::Response))
60
+ Thrift::IOStreamTransport.should_receive(:new).with(an_instance_of(StringIO), an_instance_of(Rack::Response))
61
61
  post "/"
62
62
  end
63
63
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upfluence-thrift
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thrift Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-06 00:00:00.000000000 Z
11
+ date: 2020-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -28,30 +28,30 @@ dependencies:
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.5.2
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.5.2
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rack-test
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.6.2
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.6.2
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thin
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: statsd-ruby
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
97
  description: Ruby bindings for the Apache Thrift RPC system
112
98
  email:
113
99
  - dev@thrift.apache.org
@@ -138,6 +124,7 @@ extra_rdoc_files:
138
124
  - lib/thrift/core_ext.rb
139
125
  - lib/thrift/struct_union.rb
140
126
  - lib/thrift/struct.rb
127
+ - lib/thrift/middleware.rb
141
128
  - lib/thrift/union.rb
142
129
  - lib/thrift/serializer/serializer.rb
143
130
  - lib/thrift/serializer/deserializer.rb
@@ -154,6 +141,7 @@ extra_rdoc_files:
154
141
  - lib/thrift/transport/http_client_transport.rb
155
142
  - lib/thrift/bytes.rb
156
143
  - lib/thrift/core_ext/fixnum.rb
144
+ - lib/thrift/definition.rb
157
145
  - lib/thrift/multiplexed_processor.rb
158
146
  - lib/thrift/thrift_native.rb
159
147
  - lib/thrift/exceptions.rb
@@ -181,9 +169,6 @@ files:
181
169
  - benchmark/Benchmark.thrift
182
170
  - benchmark/benchmark.rb
183
171
  - benchmark/client.rb
184
- - benchmark/gen-rb/benchmark_constants.rb
185
- - benchmark/gen-rb/benchmark_service.rb
186
- - benchmark/gen-rb/benchmark_types.rb
187
172
  - benchmark/server.rb
188
173
  - benchmark/thin_server.rb
189
174
  - ext/binary_protocol_accelerated.c
@@ -209,8 +194,10 @@ files:
209
194
  - lib/thrift/client.rb
210
195
  - lib/thrift/core_ext.rb
211
196
  - lib/thrift/core_ext/fixnum.rb
197
+ - lib/thrift/definition.rb
212
198
  - lib/thrift/exceptions.rb
213
199
  - lib/thrift/metrics.rb
200
+ - lib/thrift/middleware.rb
214
201
  - lib/thrift/multiplexed_processor.rb
215
202
  - lib/thrift/processor.rb
216
203
  - lib/thrift/protocol/base_protocol.rb
@@ -261,25 +248,6 @@ files:
261
248
  - spec/compact_protocol_spec.rb
262
249
  - spec/exception_spec.rb
263
250
  - spec/flat_spec.rb
264
- - spec/gen-rb/base/base_service.rb
265
- - spec/gen-rb/base/base_service_constants.rb
266
- - spec/gen-rb/base/base_service_types.rb
267
- - spec/gen-rb/extended/extended_service.rb
268
- - spec/gen-rb/extended/extended_service_constants.rb
269
- - spec/gen-rb/extended/extended_service_types.rb
270
- - spec/gen-rb/flat/namespaced_nonblocking_service.rb
271
- - spec/gen-rb/flat/referenced_constants.rb
272
- - spec/gen-rb/flat/referenced_types.rb
273
- - spec/gen-rb/flat/thrift_namespaced_spec_constants.rb
274
- - spec/gen-rb/flat/thrift_namespaced_spec_types.rb
275
- - spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb
276
- - spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb
277
- - spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb
278
- - spec/gen-rb/nonblocking_service.rb
279
- - spec/gen-rb/other_namespace/referenced_constants.rb
280
- - spec/gen-rb/other_namespace/referenced_types.rb
281
- - spec/gen-rb/thrift_spec_constants.rb
282
- - spec/gen-rb/thrift_spec_types.rb
283
251
  - spec/http_client_spec.rb
284
252
  - spec/json_protocol_spec.rb
285
253
  - spec/namespaced_spec.rb
@@ -298,13 +266,6 @@ files:
298
266
  - spec/types_spec.rb
299
267
  - spec/union_spec.rb
300
268
  - spec/unix_socket_spec.rb
301
- - test/debug_proto/gen-rb/debug_proto_test_constants.rb
302
- - test/debug_proto/gen-rb/debug_proto_test_types.rb
303
- - test/debug_proto/gen-rb/empty_service.rb
304
- - test/debug_proto/gen-rb/inherited.rb
305
- - test/debug_proto/gen-rb/reverse_order_service.rb
306
- - test/debug_proto/gen-rb/service_for_exception_with_a_map.rb
307
- - test/debug_proto/gen-rb/srv.rb
308
269
  homepage: http://thrift.apache.org
309
270
  licenses:
310
271
  - Apache 2.0
@@ -331,19 +292,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
292
  - !ruby/object:Gem::Version
332
293
  version: '0'
333
294
  requirements: []
334
- rubyforge_project: thrift
335
- rubygems_version: 2.4.8
295
+ rubygems_version: 3.0.3
336
296
  signing_key:
337
297
  specification_version: 4
338
298
  summary: Ruby bindings for Apache Thrift
339
299
  test_files:
340
- - test/debug_proto/gen-rb/debug_proto_test_constants.rb
341
- - test/debug_proto/gen-rb/debug_proto_test_types.rb
342
- - test/debug_proto/gen-rb/service_for_exception_with_a_map.rb
343
- - test/debug_proto/gen-rb/inherited.rb
344
- - test/debug_proto/gen-rb/reverse_order_service.rb
345
- - test/debug_proto/gen-rb/empty_service.rb
346
- - test/debug_proto/gen-rb/srv.rb
347
300
  - spec/ThriftSpec.thrift
348
301
  - spec/struct_nested_containers_spec.rb
349
302
  - spec/http_client_spec.rb
@@ -365,25 +318,6 @@ test_files:
365
318
  - spec/unix_socket_spec.rb
366
319
  - spec/ExtendedService.thrift
367
320
  - spec/types_spec.rb
368
- - spec/gen-rb/flat/thrift_namespaced_spec_constants.rb
369
- - spec/gen-rb/flat/namespaced_nonblocking_service.rb
370
- - spec/gen-rb/flat/referenced_constants.rb
371
- - spec/gen-rb/flat/referenced_types.rb
372
- - spec/gen-rb/flat/thrift_namespaced_spec_types.rb
373
- - spec/gen-rb/other_namespace/referenced_constants.rb
374
- - spec/gen-rb/other_namespace/referenced_types.rb
375
- - spec/gen-rb/extended/extended_service.rb
376
- - spec/gen-rb/extended/extended_service_types.rb
377
- - spec/gen-rb/extended/extended_service_constants.rb
378
- - spec/gen-rb/thrift_spec_constants.rb
379
- - spec/gen-rb/nonblocking_service.rb
380
- - spec/gen-rb/thrift_spec_types.rb
381
- - spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb
382
- - spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb
383
- - spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb
384
- - spec/gen-rb/base/base_service.rb
385
- - spec/gen-rb/base/base_service_constants.rb
386
- - spec/gen-rb/base/base_service_types.rb
387
321
  - spec/exception_spec.rb
388
322
  - spec/ThriftNamespacedSpec.thrift
389
323
  - spec/struct_spec.rb
@@ -397,9 +331,6 @@ test_files:
397
331
  - spec/base_transport_spec.rb
398
332
  - spec/nonblocking_server_spec.rb
399
333
  - benchmark/Benchmark.thrift
400
- - benchmark/gen-rb/benchmark_service.rb
401
- - benchmark/gen-rb/benchmark_constants.rb
402
- - benchmark/gen-rb/benchmark_types.rb
403
334
  - benchmark/client.rb
404
335
  - benchmark/benchmark.rb
405
336
  - benchmark/thin_server.rb
@@ -1,11 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (1.0.0-upfluence)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'benchmark_types'
9
-
10
- module ThriftBenchmark
11
- end
@@ -1,80 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (1.0.0-upfluence)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'benchmark_types'
9
-
10
- module ThriftBenchmark
11
- module BenchmarkService
12
- class Client
13
- include ::Thrift::Client
14
-
15
- def fibonacci(n)
16
- send_fibonacci(n)
17
- return recv_fibonacci()
18
- end
19
-
20
- def send_fibonacci(n)
21
- send_message('fibonacci', Fibonacci_args, :n => n)
22
- end
23
-
24
- def recv_fibonacci()
25
- result = receive_message(Fibonacci_result)
26
- return result.success unless result.success.nil?
27
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fibonacci failed: unknown result')
28
- end
29
-
30
- end
31
-
32
- class Processor
33
- include ::Thrift::Processor
34
-
35
- def process_fibonacci(seqid, iprot, oprot)
36
- args = read_args(iprot, Fibonacci_args)
37
- result = Fibonacci_result.new()
38
- result.success = @handler.fibonacci(args.n)
39
- write_result(result, oprot, 'fibonacci', seqid)
40
- end
41
-
42
- end
43
-
44
- # HELPER FUNCTIONS AND STRUCTURES
45
-
46
- class Fibonacci_args
47
- include ::Thrift::Struct, ::Thrift::Struct_Union
48
- N = 1
49
-
50
- FIELDS = {
51
- N => {:type => ::Thrift::Types::BYTE, :name => 'n'}
52
- }
53
-
54
- def struct_fields; FIELDS; end
55
-
56
- def validate
57
- end
58
-
59
- ::Thrift::Struct.generate_accessors self
60
- end
61
-
62
- class Fibonacci_result
63
- include ::Thrift::Struct, ::Thrift::Struct_Union
64
- SUCCESS = 0
65
-
66
- FIELDS = {
67
- SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'}
68
- }
69
-
70
- def struct_fields; FIELDS; end
71
-
72
- def validate
73
- end
74
-
75
- ::Thrift::Struct.generate_accessors self
76
- end
77
-
78
- end
79
-
80
- end
@@ -1,10 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (1.0.0-upfluence)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
-
9
- module ThriftBenchmark
10
- end
@@ -1,80 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (1.0.0-upfluence)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'base/base_service_types'
9
-
10
- module Base
11
- module BaseService
12
- class Client
13
- include ::Thrift::Client
14
-
15
- def greeting(english)
16
- send_greeting(english)
17
- return recv_greeting()
18
- end
19
-
20
- def send_greeting(english)
21
- send_message('greeting', Greeting_args, :english => english)
22
- end
23
-
24
- def recv_greeting()
25
- result = receive_message(Greeting_result)
26
- return result.success unless result.success.nil?
27
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'greeting failed: unknown result')
28
- end
29
-
30
- end
31
-
32
- class Processor
33
- include ::Thrift::Processor
34
-
35
- def process_greeting(seqid, iprot, oprot)
36
- args = read_args(iprot, Greeting_args)
37
- result = Greeting_result.new()
38
- result.success = @handler.greeting(args.english)
39
- write_result(result, oprot, 'greeting', seqid)
40
- end
41
-
42
- end
43
-
44
- # HELPER FUNCTIONS AND STRUCTURES
45
-
46
- class Greeting_args
47
- include ::Thrift::Struct, ::Thrift::Struct_Union
48
- ENGLISH = 1
49
-
50
- FIELDS = {
51
- ENGLISH => {:type => ::Thrift::Types::BOOL, :name => 'english'}
52
- }
53
-
54
- def struct_fields; FIELDS; end
55
-
56
- def validate
57
- end
58
-
59
- ::Thrift::Struct.generate_accessors self
60
- end
61
-
62
- class Greeting_result
63
- include ::Thrift::Struct, ::Thrift::Struct_Union
64
- SUCCESS = 0
65
-
66
- FIELDS = {
67
- SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Base::Hello}
68
- }
69
-
70
- def struct_fields; FIELDS; end
71
-
72
- def validate
73
- end
74
-
75
- ::Thrift::Struct.generate_accessors self
76
- end
77
-
78
- end
79
-
80
- end