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 +4 -4
- checksums.yaml.gz.sig +2 -2
- data/lib/simplepubsub.rb +6 -10
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: 152bb69eb0bf3dc991ac403759914b3d31aec5b9
|
4
|
+
data.tar.gz: 1f7ff0382b935defd332038ba4abed6c14b6d6e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 590a708af93ab9abff7c7cec380a48ede088a56874da707b4494b931d37849e71838abb2af46dafb15b63eb539f64d6234e6882057d5f2e1df6eac508cd8b81f
|
7
|
+
data.tar.gz: 91f232f6e1a2ae225e51805400f8eb572b975f3cca646d5906247189eaf5de56291f61c351ef791c4254cfc7395396afa4edf2d477daf740773e7b1a18f972f4
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
l
|
2
|
-
|
1
|
+
�l�xĽ
|
2
|
+
��i�����4���=�!n�vK�Mh���ɾ�ك��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
|
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
|
-
|
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
|
-
|
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
metadata.gz.sig
CHANGED
Binary file
|