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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e873ef3c736b8c38420941d316c1ba142c02364f
4
- data.tar.gz: f308de51ac99f1f91dd1aea5358f2542f848d3e1
3
+ metadata.gz: 5bcf845ea9121b3f64cfa371a9848290a3e96b12
4
+ data.tar.gz: 983d1e48ec5d9a4298ac917a3d4f6b48d6162f65
5
5
  SHA512:
6
- metadata.gz: 35f2a14a27d74a66876e88c8fc0fc20eda8da253ffa2c6500797e22aa7c932339f5ac8658b6e6127eb42cef4e1f3c2c78ede0b142986e5f23f4e41c5cdc16fbf
7
- data.tar.gz: 2b0a29b582cc29b2cc8b89610c58c97aeb6b21a55f876d0470fd0318da0c2c7df34ea348804fb1f4c027b1b3e754d583c8004aa8674b13ab363686395f929a71
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" % [address, topic, @hostname, URI.escape(message)]
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplepubsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file