simplepubsub 1.1.0 → 1.1.1

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: 8e5c822fc449cb17e0be9b54fd7983047dcf25c7
4
- data.tar.gz: be521eac2afbce4ad9a7d3aaf7741025bbf89f5e
3
+ metadata.gz: 152bb69eb0bf3dc991ac403759914b3d31aec5b9
4
+ data.tar.gz: 1f7ff0382b935defd332038ba4abed6c14b6d6e0
5
5
  SHA512:
6
- metadata.gz: dd64f0bc0f6def5d6d8d6eb2d6d281f29ad7167ec635aef451fd80f637345569d5f8fc0afb9b321d05a2a130ef00839f8b001c07fae49498401d0efbc117bac1
7
- data.tar.gz: 3a1bea9cb8a20c1e572fb7969b77ba36ba16df990e64663d4c097c6cdbe7654df2d891e02ed893efed5fe83164fef1fd5916578a3ed4f36fc844755d612b6a24
6
+ metadata.gz: 590a708af93ab9abff7c7cec380a48ede088a56874da707b4494b931d37849e71838abb2af46dafb15b63eb539f64d6234e6882057d5f2e1df6eac508cd8b81f
7
+ data.tar.gz: 91f232f6e1a2ae225e51805400f8eb572b975f3cca646d5906247189eaf5de56291f61c351ef791c4254cfc7395396afa4edf2d477daf740773e7b1a18f972f4
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- l>-�A8�i�h�@�V#/0|�W��$�����m��۲L���Ss�V���c��5��#�^0}��,\L,(�A4hÄ��Ӗ":����},t��*_��{L��f�FOE�~�RT�JZH��a1 P|��S�(N���8fI�\�-������Фǎ�(��*mp���Mxƻ
2
- MGM��-R��h��_��LI2)�.��E`G)�w9w=3������uyo��'��[�|sw�,�T,0;�']
1
+ l�
2
+ ��i�����4���=�!n vKMh���ɾ�ك��A(��h ����|�/�@�>巩ߝ
data/lib/simplepubsub.rb CHANGED
@@ -36,7 +36,7 @@ module SimplePubSub
36
36
 
37
37
  if a.first == 'subscribe to topic' then
38
38
 
39
- topic = a.last.rstrip #.gsub('+','*').gsub('#','//')
39
+ topic = a.last.rstrip.gsub('+','*').gsub('#','//')
40
40
  subscribers[topic] ||= []
41
41
  subscribers[topic] << ws
42
42
 
@@ -55,18 +55,14 @@ module SimplePubSub
55
55
  reg[current_topic] = message
56
56
 
57
57
  subscribers.each do |topic,conns|
58
- if reg[topic] then
58
+
59
+ node = reg[topic]
60
+
61
+ if node and node.text.length >= 1 then
59
62
  conns.each {|x| x.send current_topic + ': ' + message}
60
63
  end
61
- end
62
64
 
63
- #if subscribers[topic] then
64
- # subscribers[topic].each {|c| c.send topic + ': ' + message }
65
- #end
66
-
67
- #if subscribers['#'] then
68
- # subscribers['#'].each {|c| c.send topic + ': ' + message }
69
- #end
65
+ end
70
66
 
71
67
  #ws.send msg, :type => type
72
68
 
data.tar.gz.sig CHANGED
Binary file
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.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file