dir-to-xml 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/dir-to-xml.rb +14 -6
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ba9da801c35ecbddd2ed5fd3aace787d067fe2b
|
4
|
+
data.tar.gz: 3afedd7094acbfa9f240bd74d325338439c5d1a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3992e373581f366d0028663f7b58e78d9cfd45e96be93ab9e37e03862c18555c21cd322646aaf7fb75df095969a2dd088590d9ac635c44b0fe63fc4ec47e0d9e
|
7
|
+
data.tar.gz: 954b6e2a23e3233efb6701e222598ca956cb84939462b1f003b44f0b481bff23d4799cdece9da003127e645c009acda7c8ff421184c709a4192c0022b6450e6f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dir-to-xml.rb
CHANGED
@@ -10,7 +10,7 @@ class DirToXML
|
|
10
10
|
attr_reader :dx
|
11
11
|
|
12
12
|
def initialize(x= '.', recursive: false, index: 'dir.xml')
|
13
|
-
|
13
|
+
|
14
14
|
super()
|
15
15
|
|
16
16
|
if x.is_a? Dynarex then
|
@@ -31,7 +31,7 @@ class DirToXML
|
|
31
31
|
a = Dir.glob(File.join(path, "*")).map{|x| File.basename(x) }.sort
|
32
32
|
|
33
33
|
a.delete index
|
34
|
-
|
34
|
+
|
35
35
|
a2 = a.inject([]) do |r, filename|
|
36
36
|
|
37
37
|
x = File.join(path, filename)
|
@@ -52,11 +52,19 @@ class DirToXML
|
|
52
52
|
end
|
53
53
|
|
54
54
|
command = File.exists?(File.join(path, index)) ? :refresh : :dxify
|
55
|
-
|
55
|
+
|
56
56
|
@dx = self.method(command).call a2
|
57
57
|
|
58
58
|
@a = @dx.to_a
|
59
59
|
@object = @a
|
60
|
+
|
61
|
+
if recursive then
|
62
|
+
|
63
|
+
self.filter_by(type: :directory).to_a.each do |x|
|
64
|
+
path2 = File.join(path, x[:name])
|
65
|
+
dtx = DirToXML.new(path2, recursive: true)
|
66
|
+
end
|
67
|
+
end
|
60
68
|
|
61
69
|
end
|
62
70
|
|
@@ -83,7 +91,7 @@ class DirToXML
|
|
83
91
|
alias find_by_file find_by_filename
|
84
92
|
|
85
93
|
def last_modified(ext=nil)
|
86
|
-
|
94
|
+
|
87
95
|
if ext and ext != '*' then
|
88
96
|
@object = @a.select{|x| x[:ext][/#{ext}/] or x[:type] == 'directory'}
|
89
97
|
end
|
@@ -147,8 +155,8 @@ class DirToXML
|
|
147
155
|
'type, ext, ctime, mtime, atime, description, owner, ' + \
|
148
156
|
'group, permissions)', json_out: false)
|
149
157
|
|
150
|
-
dx.title = 'Index of ' +
|
151
|
-
dx.file_path =
|
158
|
+
dx.title = 'Index of ' + @path
|
159
|
+
dx.file_path = @path
|
152
160
|
|
153
161
|
dx.import a
|
154
162
|
|
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: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
KsWUx1RJXP2nrd/DuPwuyaNM0fcsnnqFnbAO7RjbYXWS96dGA0WVmxdO7PcMnJ9K
|
32
32
|
PneSyA3VrnMuNQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-
|
34
|
+
date: 2017-06-11 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynarex
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
version: '1.7'
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.7.
|
45
|
+
version: 1.7.22
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
version: '1.7'
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.7.
|
55
|
+
version: 1.7.22
|
56
56
|
description:
|
57
57
|
email: james@jamesrobertson.eu
|
58
58
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|