mns_subscriber 0.4.0 → 0.4.1

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: 4b958aaf19191730c5bdc42f5497f9d16bb1ffbd
4
- data.tar.gz: 7b8cb6cdb2e9274b0d8b5a5cf98b2746353ac817
3
+ metadata.gz: b27dea17c534343223f1412bab9186d3d50d1ae1
4
+ data.tar.gz: 7ae22351ff29a625d392f2dd41aa3ee1cd14d7a0
5
5
  SHA512:
6
- metadata.gz: 6dbc91d24adfde108c55c1e6d38bde31ba37af24c005cf69c1c4def49fe075dabab3aa7376ca312a86efa21d038611036fc5e744261cf6c6e748ba50f5ccb033
7
- data.tar.gz: 334024bc57cc0c3f7a82543e71f588393767205bda4e655bc3dab140ad0ddda5a59f74fd86afacb69c567bf430177df70f54ad0b99214c512af96757daff346b
6
+ metadata.gz: 8691551b7a99cdbc676fcd42ab60dcb254b4da53f59b1884062a2142b8dbf0297e80ecf311f58b8cdb846bb73908e74bc41895c9a1c8a5f98a8eecdff2f36a5f
7
+ data.tar.gz: e70ffff5537c73405e07098764d03835a2323dcdf468221db78f2ac1008635e4b4b735400f4555f77cab1f8830f926f7e0b6a6c15f84fa59ffd2288f1b7c8455
checksums.yaml.gz.sig CHANGED
Binary file
@@ -61,20 +61,20 @@ class MNSSubscriber < SPSSub
61
61
 
62
62
  else
63
63
 
64
- subtopic = a.last
65
- add_notice(subtopic, msg)
64
+ subtopic, id = a[1..-1]
65
+ add_notice(subtopic, msg, id)
66
66
 
67
67
  end
68
68
 
69
69
  end
70
70
 
71
- def add_notice(topic, raw_msg)
71
+ def add_notice(topic, raw_msg, raw_id=Time.now)
72
72
 
73
73
  topic_dir = File.join(@filepath, topic)
74
74
  notices = DailyNotices.new topic_dir, @options.merge(identifier: topic,
75
75
  title: topic.capitalize + ' daily notices')
76
76
 
77
- id = Time.now.to_i
77
+ id = raw_id.to_i
78
78
 
79
79
  # strip out any JSON from the end of the message
80
80
  msg, raw_json = raw_msg.split(/(?=\{.*)/)
@@ -87,13 +87,13 @@ class MNSSubscriber < SPSSub
87
87
 
88
88
  return if return_status == :duplicate
89
89
 
90
- notices = RecordxSqlite.new(File.join(topic_dir, 'notices.db'),
90
+ rxnotices = RecordxSqlite.new(File.join(topic_dir, 'notices.db'),
91
91
  table: {notices: {id: 0, message: ''}})
92
- notices.create id: id.to_s, message: msg
92
+ rxnotices.create id: id.to_s, message: msg
93
93
 
94
94
  if raw_json then
95
95
 
96
- record = {id: id}.merge(JSON.parse(raw_json))
96
+ record = JSON.parse(raw_json)
97
97
  index = RecordxSqlite.new(File.join(topic_dir, 'index.db'),
98
98
  table: {items: record})
99
99
  index.create record
data.tar.gz.sig CHANGED
@@ -1,2 +1 @@
1
- �ߧ�`+4�*��j��a���j�Њ�\�"
2
- ��Я�b^C��.�b^@��1k�s��� ̾z���`�L\hC�OĆG^�WCV@ ��cO�ޔ�I7�H�����J �a � � G죙�Sg0Ú��*�?T��]�Z�L�����ܥ�ޱ�yp���6��y�,s����VUJP��x�f�\3�E/pO$�bP�v��j-0k�G�At���E��Uiv �����ԣu�6�V\��5�u
1
+ Z����ކFK\>dk��0��:
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.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: '0.3'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.3.3
45
+ version: 0.3.4
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,7 +52,7 @@ dependencies:
52
52
  version: '0.3'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.3.3
55
+ version: 0.3.4
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: sps-sub
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -79,20 +79,20 @@ dependencies:
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.5'
82
+ version: '0.6'
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: 0.5.9
85
+ version: 0.6.1
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
89
89
  requirements:
90
90
  - - "~>"
91
91
  - !ruby/object:Gem::Version
92
- version: '0.5'
92
+ version: '0.6'
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: 0.5.9
95
+ version: 0.6.1
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: recordx_sqlite
98
98
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file