dir-to-xml 1.2.1 → 1.2.3
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/lib/dir-to-xml.rb +30 -6
- data.tar.gz.sig +0 -0
- metadata +30 -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: d551bade9cfc68eb4cc6181db4642b56fde754f913e579318d9df92009fac23e
|
4
|
+
data.tar.gz: ab750c2c8ad808f974c6d34fe426d58e5e6c7e751dab08b5b79dcf0bbbd0617e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e6ce861e1816744e1ce701519edd3e4b5685bc36d00d2efa2b1e3bac120056095c15d547b92ae0f36a5d3ea4b25729abf8e67d5cf20b5e9976c937c7d02ce0a
|
7
|
+
data.tar.gz: 6e054d864cde8354887f403299da67c8b48abcdd240ce3fc3f643809e06edad4357e8af9698cb421657f5ff4d2b41c1b20571d6130b816bcfa1517e2bae9901c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dir-to-xml.rb
CHANGED
@@ -74,11 +74,33 @@ class DirToXML
|
|
74
74
|
|
75
75
|
alias changes activity
|
76
76
|
|
77
|
-
|
77
|
+
# Returns a list of directory names
|
78
|
+
#
|
79
|
+
# note: if recursive is true then it will return a 1-dimensional Array
|
80
|
+
# object containing all directory paths including nested directories
|
81
|
+
#
|
82
|
+
def directories(recursive: false)
|
78
83
|
|
79
84
|
a = @dx.all
|
80
85
|
puts 'inside directories() a: ' + a.inspect if @debug
|
81
|
-
|
86
|
+
|
87
|
+
if recursive then
|
88
|
+
|
89
|
+
directories.flat_map do |dir_name|
|
90
|
+
|
91
|
+
#puts 'dir_name: ' + dir_name.inspect
|
92
|
+
#puts 'path+dir: ' + File.join(@path, dir_name).inspect
|
93
|
+
dtx = DirToXML.new(File.join(@path, dir_name), verbose: false, debug: false)
|
94
|
+
list = dtx.directories(recursive: true)
|
95
|
+
r = [File.join(@path, dir_name)]
|
96
|
+
r.concat list if list.any?
|
97
|
+
|
98
|
+
r
|
99
|
+
end
|
100
|
+
|
101
|
+
else
|
102
|
+
a.select {|x| x.type == 'directory'}.map(&:name)
|
103
|
+
end
|
82
104
|
|
83
105
|
end
|
84
106
|
|
@@ -107,7 +129,7 @@ class DirToXML
|
|
107
129
|
|
108
130
|
a = records.map {|x| x[:name]}
|
109
131
|
|
110
|
-
if FileX.
|
132
|
+
if FileX.exist? File.join(@path, @index) then
|
111
133
|
|
112
134
|
@dx = read()
|
113
135
|
|
@@ -164,7 +186,7 @@ class DirToXML
|
|
164
186
|
else
|
165
187
|
|
166
188
|
@dx = new_index(records)
|
167
|
-
find_latest(records)
|
189
|
+
find_latest(records) if records.any?
|
168
190
|
|
169
191
|
end
|
170
192
|
|
@@ -198,6 +220,8 @@ class DirToXML
|
|
198
220
|
@latest_file[:path] = @path
|
199
221
|
puts ':@latest_file: ' + @latest_file.inspect if @debug
|
200
222
|
|
223
|
+
return unless @recursive
|
224
|
+
|
201
225
|
puts 'before directories()' if @debug
|
202
226
|
dir_list = directories()
|
203
227
|
puts 'dir_list: ' + dir_list.inspect if @debug
|
@@ -208,7 +232,7 @@ class DirToXML
|
|
208
232
|
|
209
233
|
puts 'dir: ' + dir.inspect if @debug
|
210
234
|
dtx2 = DirToXML.new(File.join(@path, dir), index: @index,
|
211
|
-
recursive:
|
235
|
+
recursive: @recursive, verbose: false, debug: @debug)
|
212
236
|
[dir, dtx2.latest_file]
|
213
237
|
|
214
238
|
end.reject {|_,latest| latest.nil? }.sort_by {|_, x| x[:mtime]}.last
|
@@ -262,7 +286,7 @@ class DirToXML
|
|
262
286
|
dx.title = 'Index of ' + @path
|
263
287
|
dx.file_path = @path
|
264
288
|
dx.last_modified = Time.now
|
265
|
-
dx.import records.reverse
|
289
|
+
dx.import records.reverse if records.any?
|
266
290
|
dx.save File.join(@path, @index)
|
267
291
|
|
268
292
|
return dx
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dir-to-xml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,32 +10,33 @@ 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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
13
|
+
MIIEljCCAv6gAwIBAgIBATANBgkqhkiG9w0BAQsFADBIMRIwEAYDVQQDDAlnZW1t
|
14
|
+
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
+
8ixkARkWAmV1MB4XDTIzMDQwMjExNDIwOVoXDTI0MDQwMTExNDIwOVowSDESMBAG
|
16
|
+
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
|
+
EjAQBgoJkiaJk/IsZAEZFgJldTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoC
|
18
|
+
ggGBAMTjX7u9FdpS8NJxoIwVcXGjgoHs3yO5t2R0GOSYkyl1m30oLXdVVF/6jg69
|
19
|
+
k9NKWFfSzexEe3b9j6isg6bmqfPLHQ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
|
+
yEX/NYTeFgBlQvOt45Nnf+dtnIACJMguZkWkuFXfTGcKfgZVtemirco4OJvEDVkL
|
35
|
+
LgSLSrbDBCEGQCNhEsNZpN1tpRmoG/S6Cz0ghONvyvGe3oUXg8Tjt2auOeXJ6PB0
|
36
|
+
/4mJzXKb3M5rjD/PyDzU06flVZYZVtaq0G1u/4Gwr/t1x3B6nEal/NNHvYQ8vRyN
|
37
|
+
yu/2dFC/tlJR6wcd8KB/YxGAuDYtPO7zMoU=
|
37
38
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
39
|
+
date: 2023-04-02 00:00:00.000000000 Z
|
39
40
|
dependencies:
|
40
41
|
- !ruby/object:Gem::Dependency
|
41
42
|
name: dxlite
|
@@ -46,7 +47,7 @@ dependencies:
|
|
46
47
|
version: '0.6'
|
47
48
|
- - ">="
|
48
49
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.6.
|
50
|
+
version: 0.6.5
|
50
51
|
type: :runtime
|
51
52
|
prerelease: false
|
52
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -56,7 +57,7 @@ dependencies:
|
|
56
57
|
version: '0.6'
|
57
58
|
- - ">="
|
58
59
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.6.
|
60
|
+
version: 0.6.5
|
60
61
|
description:
|
61
62
|
email: digital.robertson@gmail.com
|
62
63
|
executables: []
|
@@ -83,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
84
|
- !ruby/object:Gem::Version
|
84
85
|
version: '0'
|
85
86
|
requirements: []
|
86
|
-
rubygems_version: 3.
|
87
|
+
rubygems_version: 3.4.4
|
87
88
|
signing_key:
|
88
89
|
specification_version: 4
|
89
90
|
summary: Dir-to-xml saves a directory listing in the Dynarex XML format
|
metadata.gz.sig
CHANGED
Binary file
|