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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 626fcee6f8e26aa37b762038a1ba3d5efdb5da29
4
- data.tar.gz: 342869bcb6244aedf9ab02d4f426f152d975cb0c
3
+ metadata.gz: a2214fa2f3b252ab64e52061e6aada2fee996510
4
+ data.tar.gz: 6ec485dc699141d8d37f2648f4efde55abb7ff80
5
5
  SHA512:
6
- metadata.gz: 435d8f8ab1b9ce32e172ad838742ec367129e01f6af376e8c96b22d7fa71083740041a8d23150598e6e832042d2d5e94e2677f1ff31ee59a5732e6e9acc70186
7
- data.tar.gz: 087c66b65bc5a9b322023eaf3d211f8d27c74d5de627af8e57a68e6b6d81f732e69495719aa0d218b386cae66668aa4da1d50cf651632f9e24d8ae20c17e4b70
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.4'
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 = @reg.get_key 'hkey_apps/simplepubsub/subscription_topics'
79
-
81
+ topics = root.xpath 'subscription_topics/*'
82
+
80
83
  @hostname = Socket.gethostname
81
84
  @subscribers, @bridges = {'#' => []}, {'#' => {}}
82
85
 
83
- if topics then
84
- topics.elements.each do |topic_element|
85
- topic = topic_element.name
86
- @subscribers[topic] ||= []
87
- @subscribers[topic] = topic_element.elements[0].elements.map(&:value)
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
- if all_topics then
95
- @subscribers['#'] = all_topics.elements[0].elements.map(&:value)
96
- end
97
-
92
+ @subscribers['#'] = root.xpath 'subscription_all_topics' + \
93
+ '/subscribers/*/text()'
98
94
 
99
- bridge_topics = @reg.get_key 'hkey_apps/simplepubsub/bridge_topics'
100
-
101
- if bridge_topics then
102
- bridge_topics.elements.each do |topic_element|
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
- if bridge_all_topics then
113
- @bridges['#'] = bridge_all_topics.elements[0].elements.inject({}) do |r,x|
114
- r.merge({x.name.to_s => x.text('address')})
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.2
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-27 00:00:00.000000000 Z
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