toq 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/toq/client.rb +1 -3
- data/lib/toq/server.rb +0 -11
- data/lib/toq/version.rb +1 -1
- data/spec/toq/client_spec.rb +0 -30
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fa9dccb95205fadf37ce8a48a133f6e08f5c1f5d07f2377041562c3a08e39b3
|
4
|
+
data.tar.gz: d0ed2e661f09eda4815eed365c3397fa920192e8c42e8cc55109733d66229c71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 795adb9468a8b873b8c9f8fe41726368eb2314abf531f8d011d6606fbe519b011ccf0ceb10e5a52682b6ed4dee6b7abd14acd6b913357a5e6f31c81c201d8ac1
|
7
|
+
data.tar.gz: 26a6fbf1afa05c8cc0d8702bdc0e40a0597ff26c235c71ca0e079b33f0686f99990d2a102927281690f49c506503d114f8306d30a6621257245f55e5acf9801c
|
data/CHANGELOG.md
CHANGED
data/lib/toq/client.rb
CHANGED
@@ -200,9 +200,7 @@ class Client
|
|
200
200
|
def set_exception( req, e )
|
201
201
|
msg = @socket ? " for '#{@socket}'." : " for '#{@host}:#{@port}'."
|
202
202
|
|
203
|
-
exc = (e.
|
204
|
-
Exceptions::SSLPeerVerificationFailed : Exceptions::ConnectionError
|
205
|
-
).new( e.to_s + msg )
|
203
|
+
exc = Exceptions::ConnectionError.new( e.to_s + msg )
|
206
204
|
|
207
205
|
exc.set_backtrace e.backtrace
|
208
206
|
req.callback.call exc
|
data/lib/toq/server.rb
CHANGED
@@ -133,7 +133,6 @@ class Server
|
|
133
133
|
@async_methods[name] = Set.new
|
134
134
|
|
135
135
|
obj.class.public_instance_methods( false ).each do |method|
|
136
|
-
@methods[name] << method.to_s
|
137
136
|
@async_methods[name] << method.to_s if async_check( obj.method( method ) )
|
138
137
|
end
|
139
138
|
end
|
@@ -190,12 +189,6 @@ class Server
|
|
190
189
|
raise Exceptions::InvalidObject.new( msg )
|
191
190
|
end
|
192
191
|
|
193
|
-
if !public_method?( obj_name, meth_name )
|
194
|
-
msg = "Trying to access non-public method '#{meth_name}'."
|
195
|
-
@logger.error( 'Call' ){ msg + " [on behalf of #{peer_ip_addr}]" }
|
196
|
-
raise Exceptions::InvalidMethod.new( msg )
|
197
|
-
end
|
198
|
-
|
199
192
|
# The handler needs to know if this is an async call because if it is
|
200
193
|
# we'll have already send the response and it doesn't need to do
|
201
194
|
# transmit anything.
|
@@ -267,10 +260,6 @@ class Server
|
|
267
260
|
@objects[obj_name] ? true : false
|
268
261
|
end
|
269
262
|
|
270
|
-
def public_method?( obj_name, method )
|
271
|
-
@methods[obj_name].include?( method )
|
272
|
-
end
|
273
|
-
|
274
263
|
end
|
275
264
|
|
276
265
|
end
|
data/lib/toq/version.rb
CHANGED
data/spec/toq/client_spec.rb
CHANGED
@@ -261,23 +261,6 @@ describe Toq::Client do
|
|
261
261
|
end
|
262
262
|
end
|
263
263
|
|
264
|
-
context 'and requesting a non-public method' do
|
265
|
-
let(:remote_method) { 'bar' }
|
266
|
-
|
267
|
-
it "returns #{Toq::Exceptions::InvalidMethod}" do
|
268
|
-
response = nil
|
269
|
-
|
270
|
-
call do |res|
|
271
|
-
response = res
|
272
|
-
Raktr.stop
|
273
|
-
end
|
274
|
-
wait
|
275
|
-
|
276
|
-
response.should be_rpc_invalid_method_error
|
277
|
-
response.should be_kind_of Toq::Exceptions::InvalidMethod
|
278
|
-
end
|
279
|
-
end
|
280
|
-
|
281
264
|
context 'and there is a remote exception' do
|
282
265
|
let(:remote_method) { :exception }
|
283
266
|
|
@@ -322,19 +305,6 @@ describe Toq::Client do
|
|
322
305
|
end
|
323
306
|
end
|
324
307
|
|
325
|
-
context 'and requesting a non-public method' do
|
326
|
-
let(:remote_method) { 'bar' }
|
327
|
-
|
328
|
-
it "raises #{Toq::Exceptions::InvalidMethod}" do
|
329
|
-
begin
|
330
|
-
call
|
331
|
-
rescue => e
|
332
|
-
e.rpc_invalid_method_error?.should be_true
|
333
|
-
e.should be_kind_of Toq::Exceptions::InvalidMethod
|
334
|
-
end
|
335
|
-
end
|
336
|
-
end
|
337
|
-
|
338
308
|
context 'and there is a remote exception' do
|
339
309
|
let(:remote_method) { :exception }
|
340
310
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tasos Laskos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: raktr
|