dir-to-xml 0.8.0 → 0.8.1
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 +19 -6
- metadata +18 -18
- 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: c718e4e10749b20081db90c763d090b2312fd2fa
|
4
|
+
data.tar.gz: 0f829facfea639a3e3db7eac450527129fb4874f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4ee85fa24b41ea48199b7abcd610403e7f7259be98529265cb8d9c4efb3296713ec55e77fbb4ad89ec11c9908430151900481c79c33e5612046340d9b8d8913
|
7
|
+
data.tar.gz: 0d42cbb31712b2c55d1329b78837e8a0d0457e706b0aa04385376d47b83dda3f70978e954a3b6a795f3493d55697ae387805f7bae3fc9feb3fc5b7d248340fb8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dir-to-xml.rb
CHANGED
@@ -9,10 +9,21 @@ class DirToXML
|
|
9
9
|
|
10
10
|
attr_reader :dx
|
11
11
|
|
12
|
-
def initialize(
|
12
|
+
def initialize(x= '.', recursive: false, index: 'dir.xml')
|
13
13
|
|
14
14
|
super()
|
15
15
|
|
16
|
+
if x.is_a? Dynarex then
|
17
|
+
|
18
|
+
@dx = x
|
19
|
+
@a = @dx.to_a
|
20
|
+
@object = @a
|
21
|
+
|
22
|
+
return self
|
23
|
+
end
|
24
|
+
|
25
|
+
path = x
|
26
|
+
|
16
27
|
@path, @index, @recursive = path, index, recursive
|
17
28
|
|
18
29
|
raise "Directory not found." unless File.exists? path
|
@@ -87,7 +98,9 @@ class DirToXML
|
|
87
98
|
def select_by_ext(ext)
|
88
99
|
|
89
100
|
@object = ext != '*' ? @a.select{|x| x[:ext][/#{ext}/]} : @a
|
90
|
-
|
101
|
+
dx = Dynarex.new json_out: false
|
102
|
+
dx.import @object
|
103
|
+
DirToXML.new(dx)
|
91
104
|
end
|
92
105
|
|
93
106
|
def sort_by(sym)
|
@@ -122,9 +135,9 @@ class DirToXML
|
|
122
135
|
|
123
136
|
def dxify(a)
|
124
137
|
|
125
|
-
dx = Dynarex.new
|
138
|
+
dx = Dynarex.new('directory[title,file_path]/file(name, ' + \
|
126
139
|
'type, ext, ctime, mtime, atime, description, owner, ' + \
|
127
|
-
|
140
|
+
'group, permissions)', json_out: false)
|
128
141
|
|
129
142
|
dx.title = 'Index of ' + File.basename(Dir.pwd)
|
130
143
|
dx.file_path = Dir.pwd
|
@@ -139,7 +152,7 @@ class DirToXML
|
|
139
152
|
|
140
153
|
def refresh(cur_files)
|
141
154
|
|
142
|
-
dx = Dynarex.new
|
155
|
+
dx = Dynarex.new(File.join(@path, @index), json_out: false)
|
143
156
|
|
144
157
|
prev_files = dx.to_a
|
145
158
|
|
@@ -154,4 +167,4 @@ class DirToXML
|
|
154
167
|
|
155
168
|
end
|
156
169
|
|
157
|
-
end
|
170
|
+
end
|
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.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE2MDczMTE1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OpKY403Wg0VZepzTjh9ZDS19/0tQQoaFRd6Y0CT
|
29
|
+
y8cHVYq+Ij6Ug16AA5KRuViQ1vaanElSlRKEmoWom3gkt5fkZ3SMVu/I/Bpx2j6u
|
30
|
+
wqDD24RYravGp0su86eLBFeVjwF8kMUx1VA64kCz8FDTws+tozgFi2HMWPO/B603
|
31
|
+
KsWUx1RJXP2nrd/DuPwuyaNM0fcsnnqFnbAO7RjbYXWS96dGA0WVmxdO7PcMnJ9K
|
32
|
+
PneSyA3VrnMuNQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2016-07-31 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynarex
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.5.1
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Dir-to-xml saves a directory listing in the Dynarex XML format
|
metadata.gz.sig
CHANGED
Binary file
|