dir-to-xml 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d3847feaade1ff658c8dda0403e10b0a98c6350333b01fc4048e97d86cdcd0d
4
- data.tar.gz: 99a0cad18703df51c90405b585a2aeab5820dca22b52d27acba5dc96dc5e1bb8
3
+ metadata.gz: c4612af405a2a24d589028a583d28b3217c7c44db120ad68d015c412efe86b16
4
+ data.tar.gz: 8d66e4b320b585972be52e6085186858b2fd99dbd369b3d3c0919cc0cd36afa2
5
5
  SHA512:
6
- metadata.gz: 37bee8d677c8a5801715d92d2d0617be2d8b559244d4f58b0d0b6fb0cef37f0e803d1a76214dcc92b09012a6fe5d15b51bfe0949feb0bdaa3af6d9e53721d515
7
- data.tar.gz: 60d691388d4e8f46f15307b50e01f4358fad88ced3f6656d29b8be9e1fa408a256f20f641146b8d375041800952818ed752d78043b79d03e4bae93868781d979
6
+ metadata.gz: bd2821ac72de327ed54318f5d2ac63c14c184dae26181e6ff38ba455466a067de75dffd48b3749ce5b9ba03ca542d98db4ac94818e929f9e6ce86df43406a4ff
7
+ data.tar.gz: 48852e32ca730dc65bc3a4363bf87eb8d365742ea20add65ec22adf97e9e80fabf59716cf1cdcea171a234bda6f3dc7dac4ecf994314e26241863b66f3957380
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
- @dx = DxLite.new(File.join(@path, @index), debug: @debug)
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 @dx.last_modified.length > 0 then
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.respond_to? :last_modified and @dx.last_modified.length > 0 then
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
@@ -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.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file