mns_subscriber 0.4.1 → 0.4.2
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.tar.gz.sig +4 -1
- data/lib/mns_subscriber.rb +27 -3
- metadata +4 -4
- 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: 2790ffff710e1b6acd3e914d35ee188155ec56b8
|
|
4
|
+
data.tar.gz: 9a2a4b5406795d899983d67dd9f54d5f3821a4d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a5baabe811a650fd16d34cb836a607ef4ae49581221320ab7cdd0c35da9c61b5bf07df4981f1f76d3b0717e67c6fac5da0175bb22392b5ec263a408cf4533bc0
|
|
7
|
+
data.tar.gz: 553868e5b77d8a7fad125a043818f913e28e5603f87cf915b25a582fa95e6f3819c298782b9508d8cc376f22cdfa7fea170cf46b2948cd2ce299e460e93ab8da
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
data/lib/mns_subscriber.rb
CHANGED
|
@@ -57,13 +57,14 @@ class MNSSubscriber < SPSSub
|
|
|
57
57
|
|
|
58
58
|
when :delete
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
subtopic = a[-2]
|
|
61
|
+
delete_notice(subtopic, msg)
|
|
62
|
+
update_index_xml(subtopic)
|
|
62
63
|
else
|
|
63
64
|
|
|
64
65
|
subtopic, id = a[1..-1]
|
|
65
66
|
add_notice(subtopic, msg, id)
|
|
66
|
-
|
|
67
|
+
update_index_xml(subtopic)
|
|
67
68
|
end
|
|
68
69
|
|
|
69
70
|
end
|
|
@@ -124,6 +125,29 @@ class MNSSubscriber < SPSSub
|
|
|
124
125
|
end
|
|
125
126
|
|
|
126
127
|
end
|
|
128
|
+
|
|
129
|
+
def update_index_xml(topic)
|
|
130
|
+
|
|
131
|
+
topic_dir = File.join(@filepath, topic)
|
|
132
|
+
indexdb = File.join(topic_dir, 'index.db')
|
|
133
|
+
|
|
134
|
+
if File.exists? indexdb then
|
|
135
|
+
|
|
136
|
+
items = RecordxSqlite.new(indexdb, table: 'items')
|
|
137
|
+
|
|
138
|
+
# create the index.xml file
|
|
139
|
+
|
|
140
|
+
a = items.first(15)
|
|
141
|
+
a2 = a.map(&:to_h)
|
|
142
|
+
a2.each {|x| x[:item_id] = x.delete :id }
|
|
143
|
+
|
|
144
|
+
dx = Dynarex.new
|
|
145
|
+
dx.import a2
|
|
146
|
+
dx.save File.join(topic_dir, 'index.xml')
|
|
147
|
+
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
end
|
|
127
151
|
|
|
128
152
|
def update_attributes(attribute, topic, value)
|
|
129
153
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mns_subscriber
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
wBAv1HG6hlSk9BepsW4e+NbsgNYQdx0NkPtppfh502tww8DydLyWZNnEte5tAbjg
|
|
32
32
|
mBoofo/5xUxN5A==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2017-07-
|
|
34
|
+
date: 2017-07-02 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: mtlite
|
|
@@ -102,7 +102,7 @@ dependencies:
|
|
|
102
102
|
version: '0.2'
|
|
103
103
|
- - ">="
|
|
104
104
|
- !ruby/object:Gem::Version
|
|
105
|
-
version: 0.2.
|
|
105
|
+
version: 0.2.5
|
|
106
106
|
type: :runtime
|
|
107
107
|
prerelease: false
|
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -112,7 +112,7 @@ dependencies:
|
|
|
112
112
|
version: '0.2'
|
|
113
113
|
- - ">="
|
|
114
114
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: 0.2.
|
|
115
|
+
version: 0.2.5
|
|
116
116
|
description:
|
|
117
117
|
email: james@jamesrobertson.eu
|
|
118
118
|
executables: []
|
metadata.gz.sig
CHANGED
|
Binary file
|