daily_notices 0.6.6 → 0.7.0

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
- SHA1:
3
- metadata.gz: 85f5727ca36a0260726baede17d965c719224455
4
- data.tar.gz: 5b78924c42e7dd23ff08a4d50c29d57736072b8e
2
+ SHA256:
3
+ metadata.gz: be073789390a9bc4b8ee8f1355b359c43a03db7b39d4a1092811c5a0df281275
4
+ data.tar.gz: 2152532d8674c8486b50fce13a6329337c08994b7cd264bc11025a12d2259db0
5
5
  SHA512:
6
- metadata.gz: d75d69e094728d177a9ecca855b51b142ce11cc49684af3d0c382771df8ffd15d79d713fe6f73afc2f0864e681faab4be2beaef32b951b0befe42edb93e102d5
7
- data.tar.gz: 2be2b878731649df9686ed1e84877a57460ba163d4b400f819806e682bcdf20cceee205e14b04be7cfb119a8f00ace9a614e99325de451b545fab6914fbd86e8
6
+ metadata.gz: 6ed7f49c33b34620f0a34c6f68fd0774e474e9de64f0890de135a1af8c26a8e34637398a0babee927259850ccbb9ca0ba791dc069d2a21fcf404a69f289b3294
7
+ data.tar.gz: ac0743f609fb732536bd2e2a5b03ff60c2a29f624b92cc2e9bb2cfd9f61f59bd49017c89aabeda9958a73037c1403415166095730a44ad5d3d1e62ba41af0090
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/daily_notices.rb CHANGED
@@ -15,11 +15,12 @@ class DailyNotices
15
15
 
16
16
  def initialize(filepath='', url_base: 'http:/127.0.0.1/', identifier: '',
17
17
  dx_xslt: '', rss_xslt: '', target_page: :recordset,
18
- target_xslt: '', title: 'daily notices', log: nil)
18
+ target_xslt: '', title: 'daily notices', log: nil,
19
+ debug: false)
19
20
 
20
21
  @filepath, @url_base, @dx_xslt, @rss_xslt, @target_page, @target_xslt, \
21
- @identifier, @log = filepath, url_base, dx_xslt, rss_xslt, \
22
- target_page, target_xslt, identifier, log
22
+ @identifier, @log, @debug = filepath, url_base, dx_xslt, rss_xslt, \
23
+ target_page, target_xslt, identifier, log, debug
23
24
 
24
25
 
25
26
  @schema ||= 'items[title, identifier]/item(title, description, time, link)'
@@ -97,7 +98,9 @@ class DailyNotices
97
98
  h[:time] ||= Time.now.strftime('%H:%M %p - %d %b %Y')
98
99
 
99
100
  #@dx.create({description: description, time: time}, id: id)
101
+ puts 'before @dx.create' if @debug
100
102
  @dx.create(h, id: id)
103
+ puts 'after @dx.create' if @debug
101
104
  @dx.save @indexpath
102
105
 
103
106
  render_html_files(id)
@@ -136,6 +139,12 @@ class DailyNotices
136
139
 
137
140
  def description=(val)
138
141
  @rss.description = val
142
+ end
143
+
144
+ def image=(val)
145
+ image_url, target_url = val.split
146
+ @rss.image_url = image_url
147
+ @rss.image_target_url = target_url
139
148
  end
140
149
 
141
150
  def title()
@@ -182,6 +191,8 @@ class DailyNotices
182
191
  #
183
192
  def new_day()
184
193
 
194
+ puts 'inside new_day' if @debug
195
+
185
196
  @archive_path = Time.now.strftime("%Y/%b/%-d").downcase
186
197
 
187
198
  @indexpath = File.join(@filepath, @archive_path, 'index.xml')
@@ -191,7 +202,9 @@ class DailyNotices
191
202
  if File.exists? @indexpath then
192
203
  @dx = Dynarex.new @indexpath
193
204
  else
194
- @dx = Dynarex.new @schema
205
+
206
+ puts 'creating a new dx file' if @debug
207
+ @dx = Dynarex.new @schema, debug: @debug
195
208
  @dx.order = 'descending'
196
209
  @dx.default_key = @default_key
197
210
  @dx.xslt = @dx_xslt
@@ -199,10 +212,12 @@ class DailyNotices
199
212
  @dx.identifier = @identifier
200
213
  end
201
214
 
202
- end
215
+ end
203
216
 
204
217
  def render_html_files(id)
205
218
 
219
+ puts 'inside render_html_files' if @debug
220
+
206
221
  if @target_page == :recordset then
207
222
  File.write File.join(@filepath, @archive_path, 'index.html'), \
208
223
  @dx.to_html(domain: @url_base)
@@ -213,10 +228,16 @@ class DailyNotices
213
228
 
214
229
  rx = @dx.find(id)
215
230
 
231
+ puts 'rx: ' + rx.inspect if @debug
216
232
  kvx = rx.to_kvx
233
+
217
234
  yield kvx if block_given?
218
-
235
+ puts 'before kvx.to_xml' if @debug
236
+ puts 'kvx.to_xml : ' + kvx.to_xml.inspect
237
+ puts 'before 2 kvx.to_xml' if @debug
219
238
  rxdoc = Rexle.new(kvx.to_xml)
239
+ puts 'after kvx.to_xml' if @debug
240
+
220
241
  rxdoc.instructions << ['xml-styelsheet',\
221
242
  "title='XSL_formatting' type='text/xsl' href='#{@target_xslt}'"]
222
243
  File.write target_path.sub(/\.html$/,'.xml', ), rxdoc.xml(pretty: true)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daily_notices
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,27 +10,32 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDXjCCAkagAwIBAgIBATANBgkqhkiG9w0BAQUFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwMjIyMTYwODE4WhcN
15
- MTkwMjIyMTYwODE4WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCuRlpq
17
- ZrkUp/VYCQ7NlOwL1tZB2syojWefG9xFjEcJpZbzR3UQ5a5lh80GTWlSCZmN1J7j
18
- ONa7U//jJ4Z8qUflIffrASHccXzBGfSHXBKjleCjfrqxBnBgv/OWN77wX4jgZ4mP
19
- ypa5YoN0SXfKJxED410rLlAYzLKw8Z7oyCVviKOPbAOTg06agom3q1CO0xH/TQU7
20
- DCinIjLrZiUTwx21ceF5zA3RPS1PmpbhKevUBJZJZ3XuhVcJ0zTHEuN6UK8chcPb
21
- ozSP40cswh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WUwEhry56jQ/1A
34
+ ovxhAIUn9BlZdnsefgTYj2Cy+7z0VyGgWOwrxb1WmGNqjIvZtlFEQzm2yGelNIB2
35
+ mq989lGt58a/Y5CLIB7CrHXwKhKPrMrl9wrNJQaGhmKCpC48MvGPzmGUKYO3OTRK
36
+ QCT4F3Esm7/YTYtL3CQJWI1T
32
37
  -----END CERTIFICATE-----
33
- date: 2018-08-05 00:00:00.000000000 Z
38
+ date: 2021-02-24 00:00:00.000000000 Z
34
39
  dependencies:
35
40
  - !ruby/object:Gem::Dependency
36
41
  name: rss_creator
@@ -38,20 +43,20 @@ dependencies:
38
43
  requirements:
39
44
  - - "~>"
40
45
  - !ruby/object:Gem::Version
41
- version: '0.3'
46
+ version: '0.4'
42
47
  - - ">="
43
48
  - !ruby/object:Gem::Version
44
- version: 0.3.11
49
+ version: 0.4.2
45
50
  type: :runtime
46
51
  prerelease: false
47
52
  version_requirements: !ruby/object:Gem::Requirement
48
53
  requirements:
49
54
  - - "~>"
50
55
  - !ruby/object:Gem::Version
51
- version: '0.3'
56
+ version: '0.4'
52
57
  - - ">="
53
58
  - !ruby/object:Gem::Version
54
- version: 0.3.11
59
+ version: 0.4.2
55
60
  - !ruby/object:Gem::Dependency
56
61
  name: dx_sliml
57
62
  requirement: !ruby/object:Gem::Requirement
@@ -78,42 +83,42 @@ dependencies:
78
83
  requirements:
79
84
  - - "~>"
80
85
  - !ruby/object:Gem::Version
81
- version: '0.1'
86
+ version: '0.2'
82
87
  - - ">="
83
88
  - !ruby/object:Gem::Version
84
- version: 0.1.2
89
+ version: 0.2.1
85
90
  type: :runtime
86
91
  prerelease: false
87
92
  version_requirements: !ruby/object:Gem::Requirement
88
93
  requirements:
89
94
  - - "~>"
90
95
  - !ruby/object:Gem::Version
91
- version: '0.1'
96
+ version: '0.2'
92
97
  - - ">="
93
98
  - !ruby/object:Gem::Version
94
- version: 0.1.2
99
+ version: 0.2.1
95
100
  - !ruby/object:Gem::Dependency
96
101
  name: rss_sliml
97
102
  requirement: !ruby/object:Gem::Requirement
98
103
  requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: '0.1'
102
104
  - - ">="
103
105
  - !ruby/object:Gem::Version
104
- version: 0.1.0
106
+ version: 0.2.0
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '0.2'
105
110
  type: :runtime
106
111
  prerelease: false
107
112
  version_requirements: !ruby/object:Gem::Requirement
108
113
  requirements:
109
- - - "~>"
110
- - !ruby/object:Gem::Version
111
- version: '0.1'
112
114
  - - ">="
113
115
  - !ruby/object:Gem::Version
114
- version: 0.1.0
116
+ version: 0.2.0
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: '0.2'
115
120
  description:
116
- email: james@jamesrobertson.eu
121
+ email: digital.robertson@gmail.com
117
122
  executables: []
118
123
  extensions: []
119
124
  extra_rdoc_files: []
@@ -139,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
144
  version: '0'
140
145
  requirements: []
141
146
  rubyforge_project:
142
- rubygems_version: 2.6.13
147
+ rubygems_version: 2.7.10
143
148
  signing_key:
144
149
  specification_version: 4
145
150
  summary: A public facing noticeboard which is centered around an RSS feed.
metadata.gz.sig CHANGED
Binary file