simplepubsub 0.3.0 → 0.3.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 +0 -0
- data/lib/simplepubsub.rb +7 -2
- 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: 5bcf845ea9121b3f64cfa371a9848290a3e96b12
|
4
|
+
data.tar.gz: 983d1e48ec5d9a4298ac917a3d4f6b48d6162f65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f901f2ae9edcae7ebca6105706a21a706b37d3fa29d4437e21f3ce5104c1714aca0932deb2016d8befd62f613abbdde658ac6e0b71f8033db38ed712dce6cad1
|
7
|
+
data.tar.gz: 1d724b8c5fcea4debe992c8b79ca5124c23644118ff258b2f446137f7f7c1d0d6fed840b0ae2920641a84d857b3bb3f3ae442c26cc69a21b4c21e615d3e7e4c2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/simplepubsub.rb
CHANGED
@@ -7,7 +7,7 @@ require 'drb'
|
|
7
7
|
require 'dws-registry'
|
8
8
|
|
9
9
|
|
10
|
-
USER_AGENT = 'SimplePubSub client 0.3'
|
10
|
+
USER_AGENT = 'SimplePubSub client 0.3.1'
|
11
11
|
|
12
12
|
module SimplePubSub
|
13
13
|
|
@@ -83,6 +83,8 @@ module SimplePubSub
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def subscribe(topic, uri)
|
86
|
+
|
87
|
+
topic.sub!('/','_')
|
86
88
|
@subscribers[topic] ||= []
|
87
89
|
@subscribers[topic] << uri
|
88
90
|
|
@@ -95,6 +97,8 @@ module SimplePubSub
|
|
95
97
|
|
96
98
|
def deliver(topic, msg)
|
97
99
|
|
100
|
+
topic.sub!('/','_')
|
101
|
+
|
98
102
|
if not @subscribers.include?(topic) and \
|
99
103
|
not @subscribers.include?('#') then
|
100
104
|
return 'no topic subscribers'
|
@@ -153,7 +157,8 @@ module SimplePubSub
|
|
153
157
|
end
|
154
158
|
|
155
159
|
bridges.values.each do |address|
|
156
|
-
url = "http://%s/do/simplepubsub/bridgepub?topic=%s&hostname=%s&message=%s" %
|
160
|
+
url = "http://%s/do/simplepubsub/bridgepub?topic=%s&hostname=%s&message=%s" % \
|
161
|
+
[address, URI.escape(topic), @hostname, URI.escape(message)]
|
157
162
|
r = open(url, 'UserAgent' => USER_AGENT)
|
158
163
|
end
|
159
164
|
'bridge delivered'
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|