daily_notices 0.3.1 → 0.3.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 +0 -0
- data/lib/daily_notices.rb +23 -4
- metadata +22 -2
- 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: 2d0956e4f9e411ea2bdf4331054c2400a291f976
|
|
4
|
+
data.tar.gz: 899c4017cbdd20fb2c862336f3544ca090962749
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 58d380acca57875fed773a723e668139b62f5b752f738f5a36a7b91ba6db00d4f82769bbf03b92c1579cf7ba4f4d199616dbf9d275204baf0ebf80e526baf4c2
|
|
7
|
+
data.tar.gz: caeb891075d3d18c98334f622fb05d57a9e6777541ad9abbb7c2ee9bf98c7e752269ae861395f6f3492d0dc6ac518efec981d972c8389da11e4f2b1c7b8db749
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/daily_notices.rb
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
# file: daily_notices.rb
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
require 'dx_sliml'
|
|
6
7
|
require 'rss_creator'
|
|
7
8
|
require 'fileutils'
|
|
8
9
|
|
|
@@ -21,6 +22,19 @@ class DailyNotices
|
|
|
21
22
|
@schema ||= 'items/item(description, time)'
|
|
22
23
|
@default_key ||= 'uid'
|
|
23
24
|
|
|
25
|
+
if dx_xslt.nil? then
|
|
26
|
+
|
|
27
|
+
subdir = File.basename filepath
|
|
28
|
+
dir = url_base[/http:\/\/[^\/]+\/(.*)/,1]
|
|
29
|
+
|
|
30
|
+
dxxsltfilename = "dx#{Time.now.to_i.to_s}.xsl"
|
|
31
|
+
dxxsltfilepath = '/' + [dir, subdir, dxxsltfilename].join('/')
|
|
32
|
+
File.write File.join(filepath, dxxsltfilename), \
|
|
33
|
+
DxSliml.new(dx: @schema).to_xslt
|
|
34
|
+
|
|
35
|
+
@dx_xslt = dxxsltfilepath
|
|
36
|
+
end
|
|
37
|
+
|
|
24
38
|
@day = Time.now.day
|
|
25
39
|
new_day()
|
|
26
40
|
|
|
@@ -65,7 +79,7 @@ class DailyNotices
|
|
|
65
79
|
@dx.to_html(domain: @url_base)
|
|
66
80
|
else
|
|
67
81
|
|
|
68
|
-
target_path = File.join(@filepath, @archive_path,
|
|
82
|
+
target_path = File.join(@filepath, @archive_path, id, 'index.html')
|
|
69
83
|
FileUtils.mkdir_p File.dirname(target_path)
|
|
70
84
|
rx = @dx.find(id)
|
|
71
85
|
|
|
@@ -82,8 +96,8 @@ class DailyNotices
|
|
|
82
96
|
|
|
83
97
|
# Add it to the RSS document
|
|
84
98
|
title ||= description.split(/\n/,2).first[0..140]
|
|
85
|
-
link =
|
|
86
|
-
|
|
99
|
+
link = create_link(id)
|
|
100
|
+
|
|
87
101
|
@rss.add( {title: title, link: link, description: description}, id: id)
|
|
88
102
|
@rss.save @rssfile
|
|
89
103
|
|
|
@@ -124,10 +138,15 @@ class DailyNotices
|
|
|
124
138
|
|
|
125
139
|
yield(xmlpath, id) if block_given?
|
|
126
140
|
|
|
127
|
-
end
|
|
141
|
+
end
|
|
128
142
|
|
|
129
143
|
private
|
|
130
144
|
|
|
145
|
+
def create_link(id)
|
|
146
|
+
[File.join(@url_base, File.basename(@filepath), \
|
|
147
|
+
@archive_path, '#' + id)].join('/')
|
|
148
|
+
end
|
|
149
|
+
|
|
131
150
|
# configures the target page (using a Dynarex document) for a new day
|
|
132
151
|
#
|
|
133
152
|
def new_day()
|
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.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
6KZopP6uiDZcPfIWtD5QSbhxe2cyGqlu4Xnb4imiAb9DWj8g5YP45vWTp1a71ytC
|
|
32
32
|
TGdJpNvN31W5+w==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2015-11-
|
|
34
|
+
date: 2015-11-02 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: rss_creator
|
|
@@ -53,6 +53,26 @@ dependencies:
|
|
|
53
53
|
- - ">="
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
55
|
version: 0.2.7
|
|
56
|
+
- !ruby/object:Gem::Dependency
|
|
57
|
+
name: dx_sliml
|
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
|
59
|
+
requirements:
|
|
60
|
+
- - "~>"
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: '0.1'
|
|
63
|
+
- - ">="
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: 0.1.6
|
|
66
|
+
type: :runtime
|
|
67
|
+
prerelease: false
|
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
69
|
+
requirements:
|
|
70
|
+
- - "~>"
|
|
71
|
+
- !ruby/object:Gem::Version
|
|
72
|
+
version: '0.1'
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 0.1.6
|
|
56
76
|
description:
|
|
57
77
|
email: james@r0bertson.co.uk
|
|
58
78
|
executables: []
|
metadata.gz.sig
CHANGED
|
Binary file
|