daily_notices 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -2
- data/lib/daily_notices.rb +8 -5
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: 572ada7063f184cbd7a815549e3d7486cd4a0bc7
|
4
|
+
data.tar.gz: 862d04b11eafc219023b04db59c21ceecdb281d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fc9fab893e004d679760842ed7c419c2c89b4ab543b60d744cb5b5867997807bb24c5c38022a3b5ad627dd497b27ac80d0c8542303964fbe7453033f36eb3b5
|
7
|
+
data.tar.gz: d7569944f35520f66fdd9356b1e2b5321077ced749b3ee499be1021cba629bae3066aeb866a0dff90f3bb3de828c7fa13eea8f64cd15758b357d9eb444cb1ae6
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
��
|
2
|
-
|
1
|
+
�� �k�8
|
2
|
+
�W��~����wNp̐f4}�vB�������A!��M�}��$��5��"})�[���
|
data/lib/daily_notices.rb
CHANGED
@@ -24,12 +24,15 @@ class DailyNotices
|
|
24
24
|
@indexpath = File.join(@filepath, @archive_path, 'index.xml')
|
25
25
|
FileUtils.mkdir_p File.dirname(@indexpath)
|
26
26
|
|
27
|
+
@schema = 'items/item(description, time, uid)'
|
28
|
+
@default_key = 'uid'
|
29
|
+
|
27
30
|
if File.exists? @indexpath then
|
28
31
|
@dx = Dynarex.new @indexpath
|
29
32
|
else
|
30
|
-
@dx = Dynarex.new
|
33
|
+
@dx = Dynarex.new @schema
|
31
34
|
@dx.order = 'descending'
|
32
|
-
@dx.default_key =
|
35
|
+
@dx.default_key = @default_key
|
33
36
|
@dx.xslt = @dx_xslt
|
34
37
|
end
|
35
38
|
|
@@ -50,9 +53,9 @@ class DailyNotices
|
|
50
53
|
end
|
51
54
|
|
52
55
|
def create(description, time=Time.now, title: nil, \
|
53
|
-
|
56
|
+
uid: Time.now.strftime('%H%M%S'))
|
54
57
|
|
55
|
-
@dx.create description: description, time: time,
|
58
|
+
@dx.create description: description, time: time, uid: uid
|
56
59
|
@dx.save @indexpath
|
57
60
|
File.write File.join(@filepath, @archive_path, 'index.html'), \
|
58
61
|
@dx.to_html(domain: @url_base)
|
@@ -60,7 +63,7 @@ class DailyNotices
|
|
60
63
|
# Add it to the RSS document
|
61
64
|
title ||= description.split(/\n/,2).first[0..140]
|
62
65
|
link = [File.join(@url_base, File.basename(@filepath), \
|
63
|
-
@archive_path, '#' +
|
66
|
+
@archive_path, '#' + uid)].join('/')
|
64
67
|
@rss.add title: title, link: link, description: description
|
65
68
|
@rss.save @rssfile
|
66
69
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|