dir-to-xml 1.0.1 → 1.0.2
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.tar.gz.sig +0 -0
- data/lib/dir-to-xml.rb +14 -3
- metadata +1 -1
- 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: c4612af405a2a24d589028a583d28b3217c7c44db120ad68d015c412efe86b16
|
4
|
+
data.tar.gz: 8d66e4b320b585972be52e6085186858b2fd99dbd369b3d3c0919cc0cd36afa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd2821ac72de327ed54318f5d2ac63c14c184dae26181e6ff38ba455466a067de75dffd48b3749ce5b9ba03ca542d98db4ac94818e929f9e6ce86df43406a4ff
|
7
|
+
data.tar.gz: 48852e32ca730dc65bc3a4363bf87eb8d365742ea20add65ec22adf97e9e80fabf59716cf1cdcea171a234bda6f3dc7dac4ecf994314e26241863b66f3957380
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dir-to-xml.rb
CHANGED
@@ -15,6 +15,8 @@ class DirToXML
|
|
15
15
|
|
16
16
|
@debug = debug
|
17
17
|
|
18
|
+
@dx = nil
|
19
|
+
|
18
20
|
if x.is_a? DxLite then
|
19
21
|
|
20
22
|
@dx = x
|
@@ -29,12 +31,20 @@ class DirToXML
|
|
29
31
|
@path, @index, @recursive = path, index, recursive
|
30
32
|
|
31
33
|
raise "Directory not found." unless File.exists? path
|
34
|
+
filepath = File.join(path, index)
|
35
|
+
|
36
|
+
|
37
|
+
if File.exists? filepath then
|
32
38
|
|
33
|
-
|
39
|
+
@dx = DxLite.new(File.join(@path, @index), debug: @debug)
|
40
|
+
|
41
|
+
end
|
34
42
|
|
35
43
|
# has the directory been modified since last time?
|
36
44
|
#
|
37
|
-
if @dx.respond_to? :last_modified and
|
45
|
+
if @dx and @dx.respond_to? :last_modified and \
|
46
|
+
@dx.last_modified.length > 0 then
|
47
|
+
|
38
48
|
return if Time.parse(@dx.last_modified) >= \
|
39
49
|
File.mtime(File.expand_path(path))
|
40
50
|
end
|
@@ -64,7 +74,8 @@ class DirToXML
|
|
64
74
|
|
65
75
|
end
|
66
76
|
|
67
|
-
if @dx
|
77
|
+
if @dx and @dx.respond_to? :last_modified \
|
78
|
+
and @dx.last_modified.length > 0 then
|
68
79
|
|
69
80
|
t = Time.parse(@dx.last_modified)
|
70
81
|
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|