simplepubsub 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/simplepubsub.rb +5 -4
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b5e566a493855c5953bc6b19c0f4eccbbca9f4
|
4
|
+
data.tar.gz: 8cef5223c745f37b2e6ec6a688dd01a7e6bcb13f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3142d0f448eb1e62f6ed3e45be8c9bfa68cd841a520271689ba5d1f5ae0ab653ad897c0dab34b7695a8baaef1eea5e26e40c0662eda38b2db72e483577cb5b1f
|
7
|
+
data.tar.gz: db6b1869daf3a48ff427a9a7261b18d87a74650b2367be2c418610ad92d280dea3ddbcaaba4cd9aa357ea5db01a4009f8323f5c3e337ad204c663426d0858b4d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/simplepubsub.rb
CHANGED
@@ -57,7 +57,7 @@ module SimplePubSub
|
|
57
57
|
|
58
58
|
subscribers.each do |topic,conns|
|
59
59
|
|
60
|
-
node = reg.doc.root.xpath topic.
|
60
|
+
node = reg.doc.root.xpath topic.sub(/\S\b$/,'\0/text()')
|
61
61
|
|
62
62
|
if node.any? then
|
63
63
|
conns.each {|x| x.send current_topic + ': ' + message}
|
@@ -104,8 +104,9 @@ module SimplePubSub
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
def self.connect(hostname, port: '59000',
|
107
|
+
def self.connect(hostname, port: '59000', auto_retry: true, &connect_blk)
|
108
108
|
|
109
|
+
retry_count = nil
|
109
110
|
pubsub = PubSub.new
|
110
111
|
connect_blk.call(pubsub)
|
111
112
|
|
@@ -127,7 +128,7 @@ module SimplePubSub
|
|
127
128
|
ws.onclose do
|
128
129
|
|
129
130
|
|
130
|
-
if retry_count and retry_count <= 3 then
|
131
|
+
if auto_retry and retry_count and retry_count <= 3 then
|
131
132
|
puts "Disconnected"
|
132
133
|
|
133
134
|
# reconnect within a minute
|
@@ -144,7 +145,7 @@ module SimplePubSub
|
|
144
145
|
|
145
146
|
self.connect hostname, port: port, retry_count: retry_count+1, &connect_blk
|
146
147
|
else
|
147
|
-
puts 'Unable to connect'
|
148
|
+
puts 'Unable to connect' if auto_retry
|
148
149
|
end
|
149
150
|
end
|
150
151
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplepubsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
uOVdk9PsRKwYmaspqeSKWj4fpSd1mCtTjPlLbGQC/8sULVs7AlYVp2pAKbkXkbTn
|
32
32
|
EkYZt+RIxgYhhw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2014-
|
34
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: websocket-eventmachine-server
|
metadata.gz.sig
CHANGED
Binary file
|