pipe_rpc 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee330bfeecf7d6643745bba563427b7ef8f80b13
4
- data.tar.gz: e3b940e58c316efe2bde2a9165bd6d692c113abf
3
+ metadata.gz: f11c770e36c36885a8ca8a81401aac2cec26469c
4
+ data.tar.gz: 3a5f50f02c861b2b734f1c6d4e98930968e3cd0c
5
5
  SHA512:
6
- metadata.gz: beaff9f942564a862ec5923ad37b88dbd7e20896d2124c1b2dbcf681611dcac51f5bf180746f80f5678548a7ce80a36e0bce2b927d9b1dd8a64d9724cbb53a3d
7
- data.tar.gz: 47329a0a0b9024a6ca3cc922350bcb26837503a94d77641f01b83b7880c80f5f90a476718644f86f62c8b703c5aafa9c9d4e757460da3be34c2949140ffd3f1b
6
+ metadata.gz: a43880de70e696db2ca33bf80b27c3fd896bdc61f3611497b948453925ed8046b923d933b338c2e2242eda36252b2a2c72bd4b5e40ea122a874ea2c0412332ea
7
+ data.tar.gz: d378cb4fa296eac256178cddc280f5805c2f5e7a78e71395af5194afbe57d0e2c6570cb2dff6c54dd734b22275128072f0dd404c83d1df3d94876b9c61d80de6
@@ -1,16 +1,24 @@
1
1
  module PipeRpc
2
2
  class DeepMapper
3
3
  def self.map(object, &mapper)
4
- case object
5
- when Hash then object.map{ |k, v| [k, map(v, &mapper)] }.to_h
6
- when Array then object.map{ |item| map(item, &mapper) }
7
- else yield object
4
+ if object.respond_to? :__rpc_server_id__
5
+ # first filter out clients so for them subsequent checks are not sent
6
+ # through the pipe
7
+ yield object
8
+ elsif Hash === object
9
+ object.map{ |k, v| [k, map(v, &mapper)] }.to_h
10
+ elsif object.respond_to? :map
11
+ object.map{ |item| map(item, &mapper) }
12
+ else
13
+ yield object
8
14
  end
9
15
  end
10
16
 
11
17
  def self.to_transport(object, hub)
12
18
  map(object) do |value|
13
19
  if value.respond_to? :__rpc_server_id__
20
+ # first filter out clients so for them subsequent checks are not sent
21
+ # through the pipe
14
22
  "__rpc_client__#{value.__rpc_server_id__}"
15
23
  elsif value.respond_to? :to_rpc_server_id
16
24
  hub.servers.add(value) unless hub.servers.registered? value.to_rpc_server_id
@@ -1,3 +1,3 @@
1
1
  module PipeRpc
2
- VERSION = "2.2.2"
2
+ VERSION = "2.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipe_rpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Aue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-16 00:00:00.000000000 Z
11
+ date: 2016-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack