dynarex-daily 0.4.0 → 0.5.1
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 +0 -0
- data/lib/dynarex-daily.rb +42 -27
- data.tar.gz.sig +0 -0
- metadata +32 -29
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 298993b50800fc403aeb22df85ec8d1274f55ffce9192eafd7114cb868ea9d0e
|
4
|
+
data.tar.gz: e1363575685faba891e1730f113a09a314d3dee9d032f744849366ad4724833b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17e5133b4dee869ea5a68d7decc7affac4880bb18eb5a1acda1687bd43b9442e4239e441d13e3914f6eae768a5760f6e388f5c9a51dc580f999faa514b71dba7
|
7
|
+
data.tar.gz: 424ee27e16edee68b20dc9812753d49b045c81f2602bd46c65276fa83326070fed13d95af3fc516e65521e779735363e719254d7becad8bce7dee366c7ec9aa3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dynarex-daily.rb
CHANGED
@@ -3,13 +3,15 @@
|
|
3
3
|
# file: dynarex-daily.rb
|
4
4
|
|
5
5
|
require 'dynarex'
|
6
|
+
require 'rxfileio'
|
6
7
|
|
7
8
|
|
8
|
-
class DynarexDaily < Dynarex
|
9
|
-
|
10
|
-
|
9
|
+
class DynarexDaily < Dynarex
|
10
|
+
include RXFileIOModule
|
11
|
+
|
12
|
+
def initialize(stringx=nil, dir_archive: :days, xslt: '',
|
11
13
|
filename: 'dynarexdaily.xml', debug: false)
|
12
|
-
|
14
|
+
|
13
15
|
@dir_archive = dir_archive
|
14
16
|
|
15
17
|
@filename = filename
|
@@ -17,29 +19,31 @@ class DynarexDaily < Dynarex
|
|
17
19
|
@default_key = 'uid'
|
18
20
|
@debug = debug
|
19
21
|
|
22
|
+
puts 'DynarexDaily::initialize stringx: ' + stringx.inspect if @debug
|
23
|
+
|
20
24
|
if stringx then
|
21
|
-
s, type =
|
22
|
-
@filename = stringx if type == :file
|
25
|
+
s, type = RXFReader.read(stringx)
|
26
|
+
@filename = stringx if type == :file or type == :dfs
|
23
27
|
end
|
24
|
-
|
28
|
+
|
25
29
|
puts 'DynarexDaily::initialize @filename: ' + @filename.inspect if @debug
|
26
|
-
|
30
|
+
|
27
31
|
if FileX.exists?(@filename) then
|
28
|
-
|
29
|
-
super @filename
|
30
|
-
|
32
|
+
|
33
|
+
super @filename, debug: debug
|
34
|
+
|
31
35
|
if !summary[:date].empty? and \
|
32
36
|
Date.parse(summary[:date]) != Date.today then
|
33
|
-
|
37
|
+
|
34
38
|
archive_file Date.parse(summary[:date])
|
35
39
|
create_file
|
36
|
-
end
|
37
|
-
|
40
|
+
end
|
41
|
+
|
38
42
|
else
|
39
43
|
puts 'before super: stringx: ' + stringx.inspect if @debug
|
40
44
|
super( stringx || @schema , debug: debug)
|
41
45
|
puts 'after super' if @debug
|
42
|
-
@delimiter = ' # '
|
46
|
+
@delimiter = ' # '
|
43
47
|
create_file
|
44
48
|
end
|
45
49
|
|
@@ -47,37 +51,37 @@ class DynarexDaily < Dynarex
|
|
47
51
|
end
|
48
52
|
|
49
53
|
def create(h)
|
50
|
-
|
54
|
+
|
51
55
|
if !summary[:date].empty? and \
|
52
56
|
Date.parse(summary[:date]) != Date.today then
|
53
|
-
|
57
|
+
|
54
58
|
archive_file Date.parse(summary[:date])
|
55
59
|
create_file
|
56
|
-
end
|
57
|
-
|
60
|
+
end
|
61
|
+
|
58
62
|
super(h)
|
59
63
|
end
|
60
|
-
|
61
|
-
|
64
|
+
|
65
|
+
|
62
66
|
def save(filename=@filename, options={})
|
63
67
|
|
64
68
|
puts 'inside DynarexDaily::save() filename: ' + filename.inspect if @debug
|
65
69
|
super(filename, options)
|
66
70
|
|
67
71
|
end
|
68
|
-
|
72
|
+
|
69
73
|
def schema=(s)
|
70
74
|
super(s.sub(/^\w+(?=\/)/,'\0[date]'))
|
71
75
|
summary[:date] = Date.today.to_s
|
72
|
-
summary[:order] = 'descending'
|
76
|
+
summary[:order] = 'descending'
|
73
77
|
end
|
74
78
|
|
75
79
|
private
|
76
|
-
|
80
|
+
|
77
81
|
def create_file()
|
78
|
-
|
79
|
-
puts 'inside DynarexDaily::create_file' if @debug
|
80
|
-
|
82
|
+
|
83
|
+
puts 'inside DynarexDaily::create_file' if @debug
|
84
|
+
|
81
85
|
openx(@schema)
|
82
86
|
summary[:date] = Date.today.to_s
|
83
87
|
summary[:order] = 'descending'
|
@@ -87,6 +91,8 @@ class DynarexDaily < Dynarex
|
|
87
91
|
|
88
92
|
def archive_file(t)
|
89
93
|
|
94
|
+
puts 'inside DynarexDaily::archive_file' if @debug
|
95
|
+
|
90
96
|
dir, file = if @dir_archive == :days then
|
91
97
|
['days', t.strftime("d%d%m%y.xml")]
|
92
98
|
else
|
@@ -94,7 +100,16 @@ class DynarexDaily < Dynarex
|
|
94
100
|
end
|
95
101
|
|
96
102
|
FileX.mkdir_p dir unless FileX.exist? dir
|
103
|
+
|
104
|
+
if @debug then
|
105
|
+
puts 'inside DynarexDaily::archive_file '
|
106
|
+
puts ' @filename: %s' % [@filename]
|
107
|
+
puts ' dir: %s; file: %s' % [dir, file]
|
108
|
+
puts ' FileX: %s' % [dir, FileX.pwd]
|
109
|
+
end
|
110
|
+
|
97
111
|
FileX.mv(@filename, "%s/%s" % [dir, file])
|
112
|
+
puts 'inside DynarexDaily::archive_file after FileX.mv' if @debug
|
98
113
|
|
99
114
|
end
|
100
115
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynarex-daily
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
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
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjIwMjIzMTI0MTQyWhcN
|
15
|
+
MjMwMjIzMTI0MTQyWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC5OZWx
|
17
|
+
pUEpHvFjiIdiIuY5fhIeew52YizZ3AWQL349rf1mUn6JwpLCFxwhteHlp5W/CNq4
|
18
|
+
HeZXt0HT1OKbHcQyfVWa1FpRBXEkSiu3oKCCdlQfcKKxcCePavZbKfpmyX2C4cQH
|
19
|
+
4xS4vozBYzfCu+cjznHHtV3pb4o5mrpHAEDhwK8nKJbn1ZIteglmCvvijv009tDZ
|
20
|
+
xtV42oF5TgPsmC/y5WZAzuVN1NeQbrls29Bp/+b5OgR90Q3/xEwMLRHf94wFf7XE
|
21
|
+
AjbFk9rIwbdDUbb5rV6kAGj7OzLKTFxYGUin3M4Zy+ZCrvgVdQmslPE1TBvgPtYR
|
22
|
+
BqKMrhipeUkxEwjeIPhC7X4oop6FGB2eaN2fbFcDVvL3MBveXHPJDP6eAHYcU3kk
|
23
|
+
NDeED+5rHB8dE8dVm54dO6fH8iA1EVKsOc4h9zmp3g5Xy7Rc65YHh7Ae2fStGrfl
|
24
|
+
xsSx0WVbeU3v+8EbRse6kD/2s34RY0w351akjlZN/MhiqlvXWiX501b2HWsCAwEA
|
25
|
+
AaOBijCBhzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUxZYG+J4A
|
26
|
+
lIoHRRXUwnOuLki1MHAwJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
|
27
|
+
c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEAAwp3FQ25zTPATQjmVIklqX5sdfxDy4deOpjUqrrU
|
29
|
+
ErI6MOPjKgGyUz2XHeb1hivNv41l3MbKPaQYIZuQUn94qgeDuxQfcFRMpGpvoNsn
|
30
|
+
nftbZTuYptK/E2nJL24Uzr7E/X4sr/uiriqqwKX4tAZn+j9+h81u8wKtvg1fkw+i
|
31
|
+
iJwJQ3C1/6xUdw4f597JaGMlpHdvO+/2caJq41A5kgBjC6No7BR3+W8ghHGzWHG2
|
32
|
+
v9g/1Wjkc2oxfUHC2w+LBDEpws7akfTTHk7kE6uI6bclul4SZuUuzeCt6psWcCbo
|
33
|
+
SJlpQdU28Sxyk+aKq7kvP28nQtyzv3ly9KzoHPXzQrY/5ld0HzIPEJfYxSKflNJU
|
34
|
+
y1A0kX6aus0cgGs6ph8C64DTPnnhqLva+jg5fZ5KYFyWwAu6s3cfTGe383IjMxul
|
35
|
+
E/GgkjQ28u/f6qcQgMPVvPiO6Ku2M2Zp4D5AL6Pb4ipSACsLEZZHMWo/CJBLOQ7f
|
36
|
+
KYgoP6fr0Bkw0gyMZIHEwNMH
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
38
|
+
date: 2022-02-23 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
41
|
name: dynarex
|
@@ -39,22 +43,22 @@ dependencies:
|
|
39
43
|
requirements:
|
40
44
|
- - "~>"
|
41
45
|
- !ruby/object:Gem::Version
|
42
|
-
version: '1.
|
46
|
+
version: '1.9'
|
43
47
|
- - ">="
|
44
48
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.
|
49
|
+
version: 1.9.6
|
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: '1.
|
56
|
+
version: '1.9'
|
53
57
|
- - ">="
|
54
58
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.
|
59
|
+
version: 1.9.6
|
56
60
|
description:
|
57
|
-
email:
|
61
|
+
email: digital.robertson@gmail.com
|
58
62
|
executables: []
|
59
63
|
extensions: []
|
60
64
|
extra_rdoc_files: []
|
@@ -79,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
83
|
- !ruby/object:Gem::Version
|
80
84
|
version: '0'
|
81
85
|
requirements: []
|
82
|
-
|
83
|
-
rubygems_version: 2.7.6
|
86
|
+
rubygems_version: 3.2.22
|
84
87
|
signing_key:
|
85
88
|
specification_version: 4
|
86
89
|
summary: A Dynarex flavoured log file for humans which is archived daily
|
metadata.gz.sig
CHANGED
Binary file
|