activity-logger 0.4.2 → 0.5.0
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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data/lib/activity-logger.rb +36 -34
- data.tar.gz.sig +0 -0
- metadata +56 -33
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0df8af298d3239703cd25652ae248b09a35d57284d2bda162ca5996d653604f5
|
4
|
+
data.tar.gz: 2cd0adb54c0b61bdb3c7dad547edb50cb5a198c8148dd61d06730da7d9a936f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67697208a53af25950f3cd8abea6f7ae116ffbe90633f3ef7b61b8c09aba025b7dab0a539c82a7ad61a0a1eb30a3bb6bec6df5e8ba16b7e35715bc209da28308
|
7
|
+
data.tar.gz: 67a2a1bc3b13e86357adf8160f234982ece5fb1f46d27a0fb3b1855b912133c93be833144422be918d6432488a84abd084375f03c015ce454f93cf6bb7a41796
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/activity-logger.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
require 'dynarex-daily'
|
6
6
|
require 'simple-config'
|
7
|
+
require 'rxfileio'
|
7
8
|
|
8
9
|
|
9
10
|
module Library
|
@@ -17,14 +18,15 @@ module Library
|
|
17
18
|
end
|
18
19
|
|
19
20
|
class ActivityLogger
|
21
|
+
include RXFileIOModule
|
20
22
|
include Library
|
21
|
-
|
23
|
+
|
22
24
|
def initialize(dirpath=nil, dir: dirpath, xsl_path: nil, config: nil)
|
23
25
|
|
24
|
-
@publish_html = false
|
25
|
-
|
26
|
+
@publish_html = false
|
27
|
+
|
26
28
|
if config then
|
27
|
-
|
29
|
+
|
28
30
|
h = SimpleConfig.new(config).to_h
|
29
31
|
dir, @urlbase, @edit_url, @css_url, xsl = \
|
30
32
|
%i(dir urlbase edit_url css_url xsl_path).map{|x| h[x]}
|
@@ -32,61 +34,61 @@ class ActivityLogger
|
|
32
34
|
@publish_html = true
|
33
35
|
|
34
36
|
end
|
35
|
-
|
37
|
+
|
36
38
|
Dir.chdir(dir) if dir
|
37
39
|
end
|
38
40
|
|
39
41
|
def create(desc='', time=Time.now, id: id=nil)
|
40
42
|
|
41
43
|
ddaily = DynarexDaily.new(nil, xslt: @xsl_path)
|
42
|
-
|
44
|
+
|
43
45
|
ddaily.create(time: time.to_s, desc: desc, id: id)
|
44
46
|
ddaily.save
|
45
47
|
|
46
48
|
if @publish_html then
|
47
|
-
|
49
|
+
|
48
50
|
File.write 'index.txt', ddaily.to_s
|
49
|
-
save_html()
|
51
|
+
save_html()
|
50
52
|
end
|
51
|
-
|
53
|
+
|
52
54
|
end
|
53
|
-
|
54
55
|
|
55
|
-
|
56
|
+
|
57
|
+
|
56
58
|
private
|
57
59
|
|
58
60
|
def add(summary, name, s)
|
59
61
|
summary.add Rexle::Element.new(name).add_text s
|
60
62
|
end
|
61
|
-
|
63
|
+
|
62
64
|
def render_html(doc)
|
63
65
|
|
64
66
|
xslt_buffer = if @xsl_path then
|
65
|
-
|
66
|
-
buffer, _ =
|
67
|
+
|
68
|
+
buffer, _ = RXFReader.read @xsl_path
|
67
69
|
buffer
|
68
|
-
|
70
|
+
|
69
71
|
else
|
70
|
-
|
72
|
+
|
71
73
|
puts 'activity-logger: warning: .xsl file not found, using notices.xsl'
|
72
74
|
fetch_file('notices.xsl')
|
73
75
|
|
74
76
|
end
|
75
77
|
|
76
78
|
# jr280416 xslt = Nokogiri::XSLT(xslt_buffer)
|
77
|
-
# jr280416 out = xslt.transform(Nokogiri::XML(doc.xml))
|
78
|
-
|
79
|
+
# jr280416 out = xslt.transform(Nokogiri::XML(doc.xml))
|
80
|
+
|
79
81
|
out = Rexslt.new(xslt_buffer, doc.xml).to_s
|
80
82
|
|
81
|
-
|
83
|
+
FileX.write 'index.html', out
|
82
84
|
end
|
83
|
-
|
85
|
+
|
84
86
|
def save_html()
|
85
|
-
|
87
|
+
|
86
88
|
newfile = 'formatted.xml'
|
87
|
-
|
88
|
-
doc = Rexle.new
|
89
|
-
|
89
|
+
FileX.cp 'dynarexdaily.xml', newfile
|
90
|
+
doc = Rexle.new FileX.read(newfile)
|
91
|
+
|
90
92
|
summary = doc.root.element('summary')
|
91
93
|
|
92
94
|
|
@@ -95,28 +97,28 @@ class ActivityLogger
|
|
95
97
|
add summary, 'edit_url', @edit_url
|
96
98
|
summary.element('date').text = date
|
97
99
|
add summary, 'css_url', @css_url
|
98
|
-
add summary, 'published', Time.now.strftime("%d-%m-%Y %H:%M")
|
100
|
+
add summary, 'published', Time.now.strftime("%d-%m-%Y %H:%M")
|
99
101
|
|
100
102
|
doc.root.xpath('records/entry') do |entry|
|
101
|
-
|
103
|
+
|
102
104
|
e = entry.element('time')
|
103
105
|
e.text = Time.parse(e.text).strftime("%-l:%M%P")
|
104
106
|
desc = entry.element('desc')
|
105
107
|
desc.add Rexle.new("<span>%s</span>" % desc.text.unescape).root
|
106
|
-
desc.text = ''
|
108
|
+
desc.text = ''
|
107
109
|
end
|
108
|
-
|
109
|
-
|
110
|
+
|
111
|
+
FileX.write newfile, doc.xml(pretty: true)
|
110
112
|
render_html doc
|
111
|
-
|
113
|
+
|
112
114
|
# save the related CSS file locally if the file doesn't already exist
|
113
115
|
|
114
116
|
css_file = File.basename @css_url
|
115
|
-
|
116
|
-
if not
|
117
|
-
|
117
|
+
|
118
|
+
if not FileX.exists? css_file then
|
119
|
+
FileX.write css_file, fetch_file('notices.css')
|
118
120
|
end
|
119
121
|
|
120
122
|
end
|
121
123
|
|
122
|
-
end
|
124
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activity-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjIwMjIzMTk1ODM4WhcN
|
15
|
+
MjMwMjIzMTk1ODM4WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDcskqI
|
17
|
+
lOhUNo75I99EoIhtry73P9XpT0GLN7kjGwmbRvOSVPp7DCT8GTK5Sf9Ok1mcipvn
|
18
|
+
LwpiIXKyzbgd+dtSTZpYnwFFqSor1ezMfM7Ui/KP44tDhmpsAqxDDDdWx0qfibgJ
|
19
|
+
CqdELbGL2T70AXo1yGBgVqQ/HPEewbUBlYVFsvyIi48g/gKILagsh9TPzQ7c85WS
|
20
|
+
5wPWt07Xmxij88fBjCYaqlyMu+SALP1lCC9La20pnnl3dg5mBy3okxhiS03mE/zJ
|
21
|
+
6ax+di6wDIP40I6hH78Y5ZhwP6l6nwYGZZ4Cr3rGtggjDOdwkQzEGorSOCt6R44R
|
22
|
+
fFTBOtyFquWaa4UnACU3EFSr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
date:
|
38
|
+
date: 2022-02-23 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
41
|
name: dynarex-daily
|
@@ -39,42 +43,62 @@ dependencies:
|
|
39
43
|
requirements:
|
40
44
|
- - "~>"
|
41
45
|
- !ruby/object:Gem::Version
|
42
|
-
version: '0.
|
46
|
+
version: '0.5'
|
43
47
|
- - ">="
|
44
48
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.
|
49
|
+
version: 0.5.1
|
46
50
|
type: :runtime
|
47
51
|
prerelease: false
|
48
52
|
version_requirements: !ruby/object:Gem::Requirement
|
49
53
|
requirements:
|
50
54
|
- - "~>"
|
51
55
|
- !ruby/object:Gem::Version
|
52
|
-
version: '0.
|
56
|
+
version: '0.5'
|
53
57
|
- - ">="
|
54
58
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.
|
59
|
+
version: 0.5.1
|
56
60
|
- !ruby/object:Gem::Dependency
|
57
61
|
name: simple-config
|
58
62
|
requirement: !ruby/object:Gem::Requirement
|
59
63
|
requirements:
|
60
64
|
- - "~>"
|
61
65
|
- !ruby/object:Gem::Version
|
62
|
-
version: '0.
|
66
|
+
version: '0.7'
|
63
67
|
- - ">="
|
64
68
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.
|
69
|
+
version: 0.7.2
|
66
70
|
type: :runtime
|
67
71
|
prerelease: false
|
68
72
|
version_requirements: !ruby/object:Gem::Requirement
|
69
73
|
requirements:
|
70
74
|
- - "~>"
|
71
75
|
- !ruby/object:Gem::Version
|
72
|
-
version: '0.
|
76
|
+
version: '0.7'
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 0.7.2
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rxfileio
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - "~>"
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0.2'
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.2.1
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.2'
|
73
97
|
- - ">="
|
74
98
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
99
|
+
version: 0.2.1
|
76
100
|
description:
|
77
|
-
email:
|
101
|
+
email: digital.robertson@gmail.com
|
78
102
|
executables: []
|
79
103
|
extensions: []
|
80
104
|
extra_rdoc_files: []
|
@@ -99,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
123
|
- !ruby/object:Gem::Version
|
100
124
|
version: '0'
|
101
125
|
requirements: []
|
102
|
-
|
103
|
-
rubygems_version: 2.5.1
|
126
|
+
rubygems_version: 3.2.22
|
104
127
|
signing_key:
|
105
128
|
specification_version: 4
|
106
129
|
summary: Uses the Dynarex-daily gem to log notices for the day
|
metadata.gz.sig
CHANGED
Binary file
|