simplepubsub 0.2.0 → 0.2.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 +9 -5
- data.tar.gz.sig +1 -1
- 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: ab32f9c65b4215927e54757ecd94f42a00c8badb
|
4
|
+
data.tar.gz: 3940577be197a3fc6ca44dccb4e8dc5a6df1932d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8780a95d7ea3a1558d8a137122e4e29284de409414f2d3475beec98c0ffef0e129f7387975f42839fe9db58af41b7319a55b564200f494f8728b2b9b6efbbfb6
|
7
|
+
data.tar.gz: 0aba7520c5f13d82b706c60fa94aad3c1d4e0b29bbf18fa29868ba93dee31bc4cfc4e6844ee6616de83b61e96125dade93ebff78d86e5046e40993a2cf3403a1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/simplepubsub.rb
CHANGED
@@ -54,9 +54,10 @@ module SimplePubSub
|
|
54
54
|
|
55
55
|
class Server
|
56
56
|
|
57
|
-
attr_reader :subscribers
|
57
|
+
attr_reader :subscribers, :bridges
|
58
58
|
|
59
|
-
def initialize()
|
59
|
+
def initialize(hostname)
|
60
|
+
@hostname = hostname
|
60
61
|
@subscribers = {'#' => []}
|
61
62
|
@bridges = {'#' => []}
|
62
63
|
end
|
@@ -114,16 +115,19 @@ module SimplePubSub
|
|
114
115
|
|
115
116
|
def bridge_deliver(topic, message, excluded_host=nil)
|
116
117
|
|
117
|
-
|
118
|
+
return 'no matching topic' unless @bridges.has_key? topic
|
119
|
+
|
120
|
+
if excluded_host then
|
118
121
|
bridges = @bridges[topic].select{|x| x != excluded_host}
|
119
122
|
else
|
120
123
|
bridges = @bridges[topic]
|
121
124
|
end
|
122
125
|
|
123
|
-
bridges.each do |
|
124
|
-
url = "http://%s/do/simplepubsub/
|
126
|
+
bridges.values.each do |address|
|
127
|
+
url = "http://%s/do/simplepubsub/bridgepub?topic=%s&hostname=%s&message=%s" % [address, topic, @hostname, URI.escape(message)]
|
125
128
|
r = open(url, 'UserAgent' => USER_AGENT)
|
126
129
|
end
|
130
|
+
'bridge delivered'
|
127
131
|
end
|
128
132
|
|
129
133
|
end
|
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
j
|
1
|
+
�3��aMr��}���]�8�/B9d�_�4|_�^����n���+��k�lP2S{�j�@��lRx��+ ÿy�Oص�Υ�4��t�Z�l�_R����\n���1����ͼ��Cy��&�v�^Q�Ɣ��<%��M�y�JF��7N�9�<�"7��лp6�j��\0���L����N�+А9�'�CQ����Č����|�]�<)��e>U)���Tg���#����/��MQQ����
|
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: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
i0PBE6fLwlIMk8jNNUcX3J1csSMgLNTwE8CwrlSZE8sueHj0pQzICM7lF0gGREO6
|
32
32
|
hQHD0LljU3MusQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2013-06-
|
34
|
+
date: 2013-06-21 00:00:00.000000000 Z
|
35
35
|
dependencies: []
|
36
36
|
description:
|
37
37
|
email:
|
metadata.gz.sig
CHANGED
Binary file
|