daily_notices 0.4.1 → 0.4.2

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
2
  SHA1:
3
- metadata.gz: 187588f742037c0bd1acce2aab04246ed35a325e
4
- data.tar.gz: ccf96dd3e04618fbe97f1768ea884f3e1267735b
3
+ metadata.gz: a260094a29aa888a4f1d5fe743931f9ed595cb2e
4
+ data.tar.gz: c1eb4fb27495ed74397779adf6d2ed88b04168a2
5
5
  SHA512:
6
- metadata.gz: 2e9a64f87467a40e7cac4ff05e1d6c13a33eff2d8ae6c5523e37161b94ccf3f4d52cfa2684aee56f3121958f227fc1957b9cf18035a7ca6a844d3e9c701c90dc
7
- data.tar.gz: de9597d9de3d63ffa96f9ac6dab90b68649a041302356f5b17a6ed755c00cdc0c27b73c716909c308239fc364b8b3315bf7be1d9c2c5a2bb0dca60cc27ea6eeb
6
+ metadata.gz: f5b2016162b0a148c829dbb2abb5716f3c387c45e02766182e3780fbb52f567902d91325b021286660ea2e3693bff7e8d002cb50bfe6de81416638588af9a4ce
7
+ data.tar.gz: efdee87748c89998439b8e20ff24e0049f37cda9a734af554869a6edeb45d8ed33c8801dcaf9c1582957f889324ab62010eb57013a814fff54284e375d51a2fc
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- JW��:r�4�诸ޘ4꫕���p?��m���Me��FE8JPq;y5־<&ǔ'��%���}��ɉ
2
- k 7G�6��`�f5zc��d�Z�hG�X�&�r�IÈ#�{@�e\@O�r�c��;k���.t�����"X�sQ��;��1l-����O�d%� �P���v �+����7uN�������':$x�T�褐����<��f9�A����=P�f�� ��%lP�����x��<Ֆ�����F�
1
+ ^c�m>u#�nR���l4�=�7&Hm}��@̆{d�4}q{���a��Y����j�θ��kǨ�Oi
2
+ U����_�����II��wn0 ��՞0dɥ�-�|gե�oK��G]��K@j���������璤�=SnQy��v��
3
+ <��)�ݹO���1?>lq
@@ -19,7 +19,7 @@ class DailyNotices
19
19
  filepath, url_base, dx_xslt, rss_xslt, target_page, target_xslt
20
20
 
21
21
 
22
- @schema ||= 'items/item(description, time)'
22
+ @schema ||= 'items[title]/item(description, time)'
23
23
  @default_key ||= 'uid'
24
24
 
25
25
  if dx_xslt.nil? then
@@ -49,7 +49,7 @@ class DailyNotices
49
49
  end
50
50
 
51
51
  @day = Time.now.day
52
- new_day()
52
+ new_day(title = 'Daily notices')
53
53
 
54
54
  # open the Dynarex file or create a new Dynarex file
55
55
 
@@ -60,7 +60,7 @@ class DailyNotices
60
60
  else
61
61
  @rss = RSScreator.new dx_xslt: @rss_xslt
62
62
  @rss.xslt = @rss_xslt
63
- @rss.title = 'Daily notices'
63
+ @rss.title = title
64
64
  @rss.description = 'Generated using the daily_notices gem'
65
65
  @rss.link = @url_base
66
66
  end
@@ -69,8 +69,8 @@ class DailyNotices
69
69
  @target_page = target_page
70
70
  end
71
71
 
72
- def create(x, time=Time.now, title: nil, \
73
- id: Time.now.strftime('%H%M%S'), description: nil)
72
+ def create(x, time=Time.now.strftime('%H:%M %p - %d %b %Y'), title: nil, \
73
+ id: Time.now.to_i.to_s, description: nil)
74
74
 
75
75
  new_day() if @day != Time.now.day
76
76
 
@@ -89,22 +89,24 @@ class DailyNotices
89
89
 
90
90
  if @target_page == :recordset then
91
91
  File.write File.join(@filepath, @archive_path, 'index.html'), \
92
- @dx.to_html(domain: @url_base)
92
+ @dx.to_html(domain: @url_base)
93
93
  else
94
94
 
95
95
  target_path = File.join(@filepath, @archive_path, id, 'index.html')
96
96
  FileUtils.mkdir_p File.dirname(target_path)
97
+
97
98
  rx = @dx.find(id)
98
-
99
+
99
100
  kvx = rx.to_kvx
100
101
  yield kvx if block_given?
101
-
102
+
102
103
  rxdoc = Rexle.new(kvx.to_xml)
103
104
  rxdoc.instructions << ['xml-stylsheet',\
104
105
  "title='XSL_formatting' type='text/xsl' href='#{@target_xslt}'"]
105
-
106
+
106
107
  File.write target_path.sub(/\.html$/,'.xml', ), rxdoc.xml(pretty: true)
107
108
  File.write target_path, rx.to_html(xslt: @target_xslt)
109
+
108
110
  end
109
111
 
110
112
  # Add it to the RSS document
@@ -162,7 +164,7 @@ class DailyNotices
162
164
 
163
165
  # configures the target page (using a Dynarex document) for a new day
164
166
  #
165
- def new_day()
167
+ def new_day(title)
166
168
 
167
169
  @archive_path = Time.now.strftime("%Y/%b/%d").downcase
168
170
 
@@ -177,6 +179,7 @@ class DailyNotices
177
179
  @dx.order = 'descending'
178
180
  @dx.default_key = @default_key
179
181
  @dx.xslt = @dx_xslt
182
+ @dx.title = title
180
183
  end
181
184
 
182
185
  end
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.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -12,26 +12,26 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
14
  YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTE1MDUyNDE1MjAzN1oXDTE2MDUyMzE1MjAzN1owSDESMBAG
15
+ 8ixkARkWAmV1MB4XDTE2MTExMjE4MjMwOFoXDTE3MTExMjE4MjMwOFowSDESMBAG
16
16
  A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
17
  EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBALMjIGpA39tRX0NoP7+vQ5kjlWe+wmtDUNhqxuz1LyaV2pHeq1kSmMJQfRe4
19
- b3d/k9AN45moJSEHOA3QetbHOcspLHxtapu5ldIcHa7yotQ+64qEnqHx2qn4vPpZ
20
- tmo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tPOyPutgVfqIAN8AswIYGK1sTOAIk0ApswUO
29
- rL0LoPzHSi9PknmBWYiMHoZSFH1VXUPvetTnXUOfEE4FyqlOoHMdOM83ADdeLpuA
30
- e8/oFcfiL4XnJXCNta8XGhTLJaTyVH/p1LSj/qKwJJy3c9PtaGhr2NBrLsW2MAt6
31
- 6KZopP6uiDZcPfIWtD5QSbhxe2cyGqlu4Xnb4imiAb9DWj8g5YP45vWTp1a71ytC
32
- TGdJpNvN31W5+w==
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAAy2H3A1O
27
+ qiilNUTDnZ7l7FH2R68rT/ixu0A+tgDxIO4xWW0FacBYjSJ9FG8/ogIcbBZ+1psc
28
+ p/ztWPercXClXMC5RKajkQA2fsBfhHAtKw7Kn8Jb3jQxF98R6c6/l3NKxTFheJHD
29
+ MAZ26TlLYXrNlKBoSHeSZeCuSdgn1haaUPgzePVmC41gX7+YRvrezwf0FakFtlNL
30
+ KpWSb1Kst6fM7s501Upx5VvOrlmPu3FOVSjO+JE1g0XL8NpOqDXYPS0GxubZAlI0
31
+ 8he6uWzjGUd5dEdL/ASnQ9lBbvl0TStzNEnsGNBV94H/6fnjx7MHQ/CWQE/M877s
32
+ zcuMgGZau1C2mg==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-11-13 00:00:00.000000000 Z
34
+ date: 2016-11-12 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rss_creator
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.4.8
123
+ rubygems_version: 2.5.1
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: A public facing noticeboard which is centered around an RSS feed.
metadata.gz.sig CHANGED
Binary file