simplepubsub 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/simplepubsub.rb +21 -31
- data.tar.gz.sig +0 -0
- 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: a2214fa2f3b252ab64e52061e6aada2fee996510
|
4
|
+
data.tar.gz: 6ec485dc699141d8d37f2648f4efde55abb7ff80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 077aec88f5af2dc1e86369f60404185dfda397d74d11e1026daa905a5dd5e78f45d03ccd1e8ee18a865c286763e46334a44e2138d13a9ab925f0643143296471
|
7
|
+
data.tar.gz: a61df4f17cabf07785dd2867fc4061955eef86303e3dc570b750617fead67bd1161cb70c1c9934597a56f2707dccacaed8dc1845cf2360b744faa5c796bb7a4c
|
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
|
require 'socket'
|
9
9
|
|
10
|
-
USER_AGENT = 'SimplePubSub client 0.
|
10
|
+
USER_AGENT = 'SimplePubSub client 0.5'
|
11
11
|
|
12
12
|
module SimplePubSub
|
13
13
|
|
@@ -70,49 +70,39 @@ module SimplePubSub
|
|
70
70
|
def initialize(raw_reg='simplepubsub.xml')
|
71
71
|
|
72
72
|
|
73
|
-
h = {DWSRegistry: ->{raw_reg}, String: ->{DWSRegistry.new raw_reg}}
|
73
|
+
h = {DWSRegistry: ->{raw_reg}, String: ->{DWSRegistry.new raw_reg},:'RSC::Package' => ->{raw_reg}}
|
74
74
|
|
75
75
|
@reg = h[raw_reg.class.to_s.to_sym].call
|
76
|
+
|
77
|
+
doc = Rexle.new(@reg.xml('hkey_apps/simplepubsub'))
|
76
78
|
|
79
|
+
root = doc.root
|
77
80
|
# try to read the subscribers
|
78
|
-
topics =
|
79
|
-
|
81
|
+
topics = root.xpath 'subscription_topics/*'
|
82
|
+
|
80
83
|
@hostname = Socket.gethostname
|
81
84
|
@subscribers, @bridges = {'#' => []}, {'#' => {}}
|
82
85
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
|
92
|
-
all_topics = @reg.get_key 'hkey_apps/simplepubsub/subscription_all_topics'
|
86
|
+
topics.each do |topic_element|
|
87
|
+
topic = topic_element.name
|
88
|
+
@subscribers[topic] ||= []
|
89
|
+
@subscribers[topic] = topic_element.xpath 'subscribers/*/text()'
|
90
|
+
end
|
93
91
|
|
94
|
-
|
95
|
-
|
96
|
-
end
|
97
|
-
|
92
|
+
@subscribers['#'] = root.xpath 'subscription_all_topics' + \
|
93
|
+
'/subscribers/*/text()'
|
98
94
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
topic = topic_element.name
|
104
|
-
@bridges[topic] = topic_element.elements[0].elements.inject({}) do |r,x|
|
105
|
-
r.merge({x.name.to_s => x.text('address')})
|
106
|
-
end
|
95
|
+
root.xpath('bridge_topics/*').each do |topic_element|
|
96
|
+
topic = topic_element.name
|
97
|
+
@bridges[topic] = topic_element.elements[0].elements.inject({}) do |r,x|
|
98
|
+
r.merge({x.name.to_s => x.text('address')})
|
107
99
|
end
|
108
100
|
end
|
109
101
|
|
110
|
-
bridge_all_topics = @reg.get_key 'hkey_apps/simplepubsub/bridge_all_topics'
|
111
102
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
end
|
103
|
+
@bridges['#'] = root.xpath('bridge_all_topics/subscribers/*')
|
104
|
+
.inject({}) do |r,x|
|
105
|
+
r.merge({x.name.to_s => x.text('address')})
|
116
106
|
end
|
117
107
|
'done'
|
118
108
|
end
|
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.
|
4
|
+
version: 0.5.0
|
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-07-
|
34
|
+
date: 2013-07-30 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dws-registry
|
metadata.gz.sig
CHANGED
Binary file
|