dir-to-xml 0.3.3 → 0.4.2
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 +34 -26
- 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: 5e9d8d45fee2c726648215d516e350ba2bc48e3f
|
4
|
+
data.tar.gz: 626342bee2eae420f6198e5301b052f74ba44004
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4edd92bdc409f270e1679aedad1107494cafe1f98d633ac717fc1f3694296e94ad83fa45e02ba6531b58e43592caeb25c58d495a1ccb5e2bd371c55c08a0ac4c
|
7
|
+
data.tar.gz: f4a9816b87ac2fa6a9aeba0ebd73e1e31206a4e1ca369053d67ca8a03f8272881b4207230ec11c6a5adf05b0f23d8de991dea8ad4cb55dd5e968f9117c4590eb
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dir-to-xml.rb
CHANGED
@@ -15,8 +15,10 @@ class DirToXML
|
|
15
15
|
Dir.chdir path
|
16
16
|
|
17
17
|
a = Dir.glob("*").sort
|
18
|
+
|
18
19
|
command = a.include?('dir.xml') ? 'run' : 'new_run'
|
19
20
|
@doc, @status = self.send command, a
|
21
|
+
|
20
22
|
Dir.chdir old_path #File.expand_path('~')
|
21
23
|
@h = self.to_dynarex.to_h
|
22
24
|
@object = @h
|
@@ -28,13 +30,20 @@ class DirToXML
|
|
28
30
|
end
|
29
31
|
|
30
32
|
def sort_by(sym)
|
31
|
-
procs = [[:last_modified, lambda{|obj| obj
|
33
|
+
procs = [[:last_modified, lambda{|obj| obj\
|
34
|
+
.sort_by{|x| x[:last_modified]}}]]
|
32
35
|
proc1 = procs.assoc(sym).last
|
33
36
|
proc1.call(@object)
|
34
37
|
end
|
35
38
|
|
39
|
+
def sort_by_last_modified()
|
40
|
+
sort_by :last_modified
|
41
|
+
end
|
42
|
+
|
43
|
+
alias sort_by_lastmodified sort_by_last_modified
|
44
|
+
|
36
45
|
def to_h
|
37
|
-
@h
|
46
|
+
@object || @h
|
38
47
|
end
|
39
48
|
|
40
49
|
def to_xml
|
@@ -69,12 +78,15 @@ class DirToXML
|
|
69
78
|
end
|
70
79
|
|
71
80
|
def add_files(doc, a)
|
81
|
+
|
72
82
|
dir_files = a.map do |x|
|
73
|
-
[x, File.extname(x), File::ftype(x), File::ctime(x),
|
83
|
+
[x, File.extname(x), File::ftype(x), File::ctime(x), \
|
84
|
+
File::mtime(x), File::atime(x)]
|
74
85
|
end
|
75
86
|
|
76
87
|
records = doc.root.element('records')
|
77
88
|
i = '0'
|
89
|
+
|
78
90
|
dir_files.each do |name, ext, type, ctime, mtime, atime|
|
79
91
|
records.add_element new_file(name, type, ext, ctime, mtime, atime)
|
80
92
|
i.succ!
|
@@ -88,8 +100,9 @@ summary = "
|
|
88
100
|
<title>Index of #{File.basename(Dir.pwd)}</title>
|
89
101
|
<file_path>#{File.dirname(Dir.pwd)}</file_path>
|
90
102
|
<recordx_type>dynarex</recordx_type>
|
91
|
-
<schema>directory[title,file_path]/file(name, type, ext, created,
|
92
|
-
|
103
|
+
<schema>directory[title,file_path]/file(name, type, ext, created, " \
|
104
|
+
+ "last_modified, last_accessed, description, owner, group, permissions)" \
|
105
|
+
+ "</schema>\n</summary>"
|
93
106
|
|
94
107
|
buffer = "<directory>%s<records/></directory>" % summary
|
95
108
|
doc = Rexle.new(buffer)
|
@@ -130,4 +143,4 @@ summary = "
|
|
130
143
|
File.open('dir.xml','w'){|f| doc.write f}
|
131
144
|
[doc, "updated"]
|
132
145
|
end
|
133
|
-
end
|
146
|
+
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.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,41 +10,49 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE1MDQyNTE1MjcyMloXDTE2MDQyNDE1MjcyMlowSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
17
|
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
18
|
+
ggEBAPJeaqGdHXjc83YCQgzVIypRPJyhJrtlLg7rysiil2upvnY8ulaMpV88oGy9
|
19
|
+
5CO9xpYvsIRjPMmRs/EvRcN++MAAQ45QJXI9FoR87wWR+V0TB9N8wZdAugjaxaEQ
|
20
|
+
uvV7YAt0+Fz5oa0hz/2+qMLtD5SfvnnGMX0SpPt4zD1iFpsCy51+TkvdTNyACxA4
|
21
|
+
/AVBQbOqJsCTYlEQ/GaoY7gOWOqcO22vFRgrZWvSu8vcg2LzJHyhgv+JvIsaVmkf
|
22
|
+
LI6keFED231GX7WfKoXfC2AZKb4kqrFVx4FqbWT+ESmByqrIxU8WPT/9wkdrs9B2
|
23
|
+
PCYWQjvzZKCkU9snRtdtAGbgELcCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUNrwmCbXzpJdaLliUwrrVgd3UtGUwJgYDVR0RBB8w
|
25
|
+
HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAH//G/vGj
|
27
|
+
i97fIMfCG6iIvrjGje5I8LRmEL3rO8PufXK/AxQdLqUK4tv4/3C4R6NT4p8yF/qI
|
28
|
+
M+Zb2fQn2pwn7OhtIgpnR6x7lNgPAhX5K3RB9w+tTwLYyKecy4JBbIqkWUHWZSXq
|
29
|
+
uxaJ5n8v9CPew049BRNnL+tDM/dorEYEfXb1Zb0CmXj0XuQp74/3GdIE6aRFrsPl
|
30
|
+
nhZ1BvQZozn60v0vnPx3mVqzApX7trqIjGywkjR+bVzCRlfxJgt5DNLExdpUSUpm
|
31
|
+
iqgRYucyTfq3VLTy6wrGN2HJj8unXh4JIFjyEvR3yvcCYl6IaHxuDfgoDfBI6MeQ
|
32
|
+
Em7HctRLQorltw==
|
31
33
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
34
|
+
date: 2015-04-25 00:00:00.000000000 Z
|
33
35
|
dependencies:
|
34
36
|
- !ruby/object:Gem::Dependency
|
35
37
|
name: dynarex
|
36
38
|
requirement: !ruby/object:Gem::Requirement
|
37
39
|
requirements:
|
38
|
-
- -
|
40
|
+
- - "~>"
|
39
41
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
42
|
+
version: '1.5'
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.5.2
|
41
46
|
type: :runtime
|
42
47
|
prerelease: false
|
43
48
|
version_requirements: !ruby/object:Gem::Requirement
|
44
49
|
requirements:
|
45
|
-
- -
|
50
|
+
- - "~>"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '1.5'
|
53
|
+
- - ">="
|
46
54
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
55
|
+
version: 1.5.2
|
48
56
|
description:
|
49
57
|
email: james@r0bertson.co.uk
|
50
58
|
executables: []
|
@@ -62,18 +70,18 @@ require_paths:
|
|
62
70
|
- lib
|
63
71
|
required_ruby_version: !ruby/object:Gem::Requirement
|
64
72
|
requirements:
|
65
|
-
- -
|
73
|
+
- - ">="
|
66
74
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
75
|
+
version: 2.1.2
|
68
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
77
|
requirements:
|
70
|
-
- -
|
78
|
+
- - ">="
|
71
79
|
- !ruby/object:Gem::Version
|
72
80
|
version: '0'
|
73
81
|
requirements: []
|
74
82
|
rubyforge_project:
|
75
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.4.6
|
76
84
|
signing_key:
|
77
85
|
specification_version: 4
|
78
|
-
summary:
|
86
|
+
summary: Dir-to-xml saves a directory listing in the Dynarex XML format
|
79
87
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|