dir-to-xml 1.0.3 → 1.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0af1114575e0707f202c03b2660d623e91f34422b607bfec18e688d658a44740
4
- data.tar.gz: bda192469bb816b363a1a9725da3c134ec40fce2a29bcb8777baa253df8e4920
3
+ metadata.gz: f155b43f7372db3ad7636b3c54f8369d78387d155ec4230f24b2ecf6a6b7d206
4
+ data.tar.gz: 3def96a9380e89e249275346f39ca5d6eebcbc60996e66c5d2a5786d9a250f03
5
5
  SHA512:
6
- metadata.gz: e411adb17ec8d8b92bc1180bced2f7975a957bcb1ac811647732b18ebd402aab598349f10a2258a1b9d5a02b5acbb0e1c21ecd9b654049a37a20f51e6e2ce256
7
- data.tar.gz: 78dfc760cd59ba6b525ee4fca05e56a7b1f8150f3fd877256234d309c7e28ce547e60430ad6bc1180786105940cb07cda02d4403092d890c125b0590875ee237
6
+ metadata.gz: ade701a7b673a6305a73f52f10ce05e828588f4d235acc747aa5adb72a7e02a4dd11ac7312f0661ef843a8df9d848943eb8ddac53c954bc4b5176b0838efcfa0
7
+ data.tar.gz: a542531fdbfe27e2621c7f0db8b034b32528f0aa284e4038c9ee1239655e419a00d9e5e82c98ab5c7e86e634e1cba56677e1186318b8e58598632f08fb8b8af6
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -16,6 +16,7 @@ class DirToXML
16
16
  @debug = debug
17
17
 
18
18
  @dx = nil
19
+ @activity = {new: [], modified: []}
19
20
 
20
21
  if x.is_a? DxLite then
21
22
 
@@ -41,7 +42,7 @@ class DirToXML
41
42
  else
42
43
 
43
44
  @dx = DxLite.new('directory[title, file_path, last_modified, ' + \
44
- 'description]/fi`le(name, type, ext, ctime, mtime, atime, ' + \
45
+ 'description]/file(name, type, ext, ctime, mtime, atime, ' + \
45
46
  'description, owner, group, permissions)')
46
47
 
47
48
  puts 'before title' if @debug
@@ -84,24 +85,33 @@ class DirToXML
84
85
  puts 'nothing to do' if @debug
85
86
 
86
87
  file = a2.max_by {|x| x[:mtime]}
88
+ puts 'file: ' + file.inspect if @debug
87
89
  return if Time.parse(@dx.last_modified) >= (file[:mtime])
88
90
 
89
91
  end
90
92
 
91
93
 
92
94
 
93
- if @dx and @dx.respond_to? :last_modified \
94
- and @dx.last_modified.length > 0 then
95
+ if @dx and @dx.respond_to? :last_modified then
95
96
 
96
- t = Time.parse(@dx.last_modified)
97
+ if @dx.last_modified.length > 0 then
97
98
 
98
- # find the most recently modified cur_files
99
- recent = a2.select {|x| x[:mtime] > t }.map {|x| x[:name]} \
100
- - %w(dir.xml dir.json)
101
-
102
- # is it a new file or recently modified?
103
- new_files = recent - @dx.to_a.map {|x| x[:name]}
104
- modified = recent - new_files
99
+ t = Time.parse(@dx.last_modified)
100
+
101
+ # find the most recently modified cur_files
102
+ recent = a2.select {|x| x[:mtime] > t }.map {|x| x[:name]} \
103
+ - %w(dir.xml dir.json)
104
+
105
+ # is it a new file or recently modified?
106
+ new_files = recent - @dx.to_a.map {|x| x[:name]}
107
+ modified = recent - new_files
108
+
109
+ else
110
+
111
+ new_files = a2.select {|x| x[:type] == 'file'}.map {|x| x[:name]}
112
+ modified = []
113
+
114
+ end
105
115
 
106
116
  @activity = {modified: modified, new: new_files}
107
117
 
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.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file