dir-to-xml 1.1.0 → 1.2.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/dir-to-xml.rb +11 -6
- data.tar.gz.sig +0 -0
- metadata +13 -14
- 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: 95f3f9304511ed382a219b2a65296302d9bea293d775fd051ba6d3f6eb426d2d
|
4
|
+
data.tar.gz: 2736fc013064b22e0f51977b1ad1471390d9fd0b786585e58ecef31a3ff8d97d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3932719c3963587b52bb82edd0475badab68675c46c0f0d8e01a73b1f24d2890630486982dd13918efafb1ddb9af12a70724f83c85b618c8b619370975874665
|
7
|
+
data.tar.gz: 286e1826d10993011a9d565a89c214257504d6a1629362417a9d94936bb9ceeb81ac68a4fd3e534021b52e195c0e6342df3236a3738714e7fbbb05f9aee08624
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dir-to-xml.rb
CHANGED
@@ -31,6 +31,7 @@ require 'dxlite'
|
|
31
31
|
|
32
32
|
class DirToXML
|
33
33
|
using ColouredText
|
34
|
+
include RXFReadWriteModule
|
34
35
|
|
35
36
|
attr_reader :new_files, :deleted_files, :dx, :latest_files, :latest_file
|
36
37
|
|
@@ -101,7 +102,7 @@ class DirToXML
|
|
101
102
|
|
102
103
|
a = records.map {|x| x[:name]}
|
103
104
|
|
104
|
-
if
|
105
|
+
if FileX.exists? File.join(@path, @index) then
|
105
106
|
|
106
107
|
@dx = read()
|
107
108
|
|
@@ -127,10 +128,13 @@ class DirToXML
|
|
127
128
|
dtx_last_modified = Time.parse(@dx.last_modified)
|
128
129
|
|
129
130
|
select_records = records.select do |file|
|
130
|
-
|
131
|
+
|
132
|
+
file[:mtime] > dtx_last_modified or file[:type] == 'directory'
|
133
|
+
|
131
134
|
end
|
132
135
|
|
133
|
-
|
136
|
+
puts 'select_records: ' + select_records.inspect if @debug
|
137
|
+
find_latest(select_records) if select_records.any?
|
134
138
|
|
135
139
|
# Add any new files
|
136
140
|
#
|
@@ -179,6 +183,7 @@ class DirToXML
|
|
179
183
|
puts '@latest_files: ' + @latest_files.inspect if @debug
|
180
184
|
|
181
185
|
@latest_file = @latest_files[-1]
|
186
|
+
@latest_file[:path] = @path
|
182
187
|
puts ':@latest_file: ' + @latest_file.inspect if @debug
|
183
188
|
|
184
189
|
dir_list = directories()
|
@@ -201,12 +206,12 @@ class DirToXML
|
|
201
206
|
or latest_file.nil? \
|
202
207
|
or latest_file[:type] == 'directory') then
|
203
208
|
|
204
|
-
dir_latest.last[:path] = File.join(@path, dir_latest.first)
|
209
|
+
dir_latest.last[:path] = File.expand_path(File.join(@path, dir_latest.first))
|
205
210
|
dir_latest.last
|
206
211
|
|
207
212
|
elsif latest_file and latest_file[:type] == 'file'
|
208
213
|
|
209
|
-
latest_file[:path] = @path
|
214
|
+
latest_file[:path] = File.expand_path(@path)
|
210
215
|
latest_file
|
211
216
|
|
212
217
|
end
|
@@ -252,7 +257,7 @@ class DirToXML
|
|
252
257
|
|
253
258
|
def scan_dir(path)
|
254
259
|
|
255
|
-
a =
|
260
|
+
a = DirX.glob(File.join(path, "*")).map {|x| File.basename(x) }
|
256
261
|
a.delete @index
|
257
262
|
a.map {|filename| getfile_info(filename) }
|
258
263
|
|
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.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,48 +35,48 @@ cert_chain:
|
|
35
35
|
m7hEq9GAsvYejQNMhcxlvi+e70d3QiEg+2SVsBHaUGURzv0LjycCOjOaUxQA5swC
|
36
36
|
JKGINad8xoEL7XIDoO6EnBcY
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-02-
|
38
|
+
date: 2022-02-20 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: c32
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 0.3.0
|
47
44
|
- - "~>"
|
48
45
|
- !ruby/object:Gem::Version
|
49
46
|
version: '0.3'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.3.0
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: 0.3.0
|
57
54
|
- - "~>"
|
58
55
|
- !ruby/object:Gem::Version
|
59
56
|
version: '0.3'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.3.0
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: dxlite
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '0.
|
66
|
+
version: '0.6'
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 0.6.0
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '0.
|
76
|
+
version: '0.6'
|
77
77
|
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: 0.
|
79
|
+
version: 0.6.0
|
80
80
|
description:
|
81
81
|
email: digital.robertson@gmail.com
|
82
82
|
executables: []
|
@@ -103,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
|
107
|
-
rubygems_version: 2.7.10
|
106
|
+
rubygems_version: 3.2.22
|
108
107
|
signing_key:
|
109
108
|
specification_version: 4
|
110
109
|
summary: Dir-to-xml saves a directory listing in the Dynarex XML format
|
metadata.gz.sig
CHANGED
Binary file
|