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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfb14c303c576a5fc3ca6c8160ef526f306bc87b
4
- data.tar.gz: 102d5dbfa5f4925c157c7f601057c81ab12e4bbb
3
+ metadata.gz: 66b5e566a493855c5953bc6b19c0f4eccbbca9f4
4
+ data.tar.gz: 8cef5223c745f37b2e6ec6a688dd01a7e6bcb13f
5
5
  SHA512:
6
- metadata.gz: 58b2c22abd456d71018b03cd589db440307cde52e63a557d121dd49e700a6a1d3b1810c3f2a35af3f5fe5e6e7d3be2526f6bfd19a94e4ead06c24d166a6a855b
7
- data.tar.gz: 4107e7cbcca9f0328b0495fe3612d646cca0b8a410297a8f1e70e0bf713e0a2d5afe136edb7522eccfeb90532ba0008d7b015bcd8f6aaa8d2bce50742ec7600e
6
+ metadata.gz: 3142d0f448eb1e62f6ed3e45be8c9bfa68cd841a520271689ba5d1f5ae0ab653ad897c0dab34b7695a8baaef1eea5e26e40c0662eda38b2db72e483577cb5b1f
7
+ data.tar.gz: db6b1869daf3a48ff427a9a7261b18d87a74650b2367be2c418610ad92d280dea3ddbcaaba4cd9aa357ea5db01a4009f8323f5c3e337ad204c663426d0858b4d
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -57,7 +57,7 @@ module SimplePubSub
57
57
 
58
58
  subscribers.each do |topic,conns|
59
59
 
60
- node = reg.doc.root.xpath topic.gsub(/\S\b/,'\0/text()')
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', retry_count: nil, &connect_blk)
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.5
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-07-16 00:00:00.000000000 Z
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