dir-to-xml 0.5.0 → 0.6.1
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 +4 -4
- checksums.yaml.gz.sig +1 -1
- data.tar.gz.sig +0 -0
- data/lib/dir-to-xml.rb +23 -3
- metadata +5 -5
- 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: ed5f8bafed3e8cfa92001c6d5c54f70d7064249d
|
4
|
+
data.tar.gz: 87274e0a85304ff94b2c078e38f5cd87dedf1745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fb91655f1708f30ec7d4ec33d315fc9c373284d17a9635e8f4b1e1220374c579ac2f3a39787aa116803a882514eb4841da18a894c8f24cc17d563c142eb0ec9
|
7
|
+
data.tar.gz: 405474333bf1a6c012ed1f89130a027e237c82869668ba4c35bfbc9e299a47b719afd79957650905aa37c3f7c649d6f5f83525b48966f351fe6ed70693cbb736
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
(l�lpŋ�/��X�B6'��(z�qs���+�Ui��;%>�.��+�rI�����Ac���z��U��kf�T�oJb$A|�t0�n���dGw,V[�R�"R�A#����{���v�K{TA����ߍ�e�&�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dir-to-xml.rb
CHANGED
@@ -8,8 +8,9 @@ class DirToXML
|
|
8
8
|
|
9
9
|
attr_reader :status
|
10
10
|
|
11
|
-
def initialize(path= '.')
|
11
|
+
def initialize(path= '.', recursive: false)
|
12
12
|
super()
|
13
|
+
|
13
14
|
old_path = Dir.pwd
|
14
15
|
raise "Directory not found." unless File.exists? path
|
15
16
|
Dir.chdir path
|
@@ -22,6 +23,10 @@ class DirToXML
|
|
22
23
|
Dir.chdir old_path #File.expand_path('~')
|
23
24
|
@h = self.to_dynarex.to_h
|
24
25
|
@object = @h
|
26
|
+
|
27
|
+
@path = path
|
28
|
+
@recursive = recursive
|
29
|
+
|
25
30
|
end
|
26
31
|
|
27
32
|
def filter(pattern=/.*/)
|
@@ -29,8 +34,23 @@ class DirToXML
|
|
29
34
|
self
|
30
35
|
end
|
31
36
|
|
37
|
+
def last_modified()
|
38
|
+
a = sort_by :last_modified
|
39
|
+
a2 = a.reject {|x| x[:name] == 'dir.xml'}
|
40
|
+
|
41
|
+
|
42
|
+
lm = a2[-1]
|
43
|
+
|
44
|
+
if @recursive and lm[:type] == 'directory' then
|
45
|
+
return [lm, DirToXML.new(File.join(@path, lm[:name])).last_modified]
|
46
|
+
else
|
47
|
+
lm
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
32
51
|
def select_by_ext(ext)
|
33
|
-
|
52
|
+
|
53
|
+
@object = ext != '*' ? @h.select{|x| x[:ext][/#{ext}/]} : @h
|
34
54
|
self
|
35
55
|
end
|
36
56
|
|
@@ -149,4 +169,4 @@ summary = "
|
|
149
169
|
File.write 'dir.xml', doc.xml(pretty: true)
|
150
170
|
[doc, "updated"]
|
151
171
|
end
|
152
|
-
end
|
172
|
+
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.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
iqgRYucyTfq3VLTy6wrGN2HJj8unXh4JIFjyEvR3yvcCYl6IaHxuDfgoDfBI6MeQ
|
32
32
|
Em7HctRLQorltw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-
|
34
|
+
date: 2015-08-12 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.5'
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.5.
|
45
|
+
version: 1.5.33
|
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.5'
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.5.
|
55
|
+
version: 1.5.33
|
56
56
|
description:
|
57
57
|
email: james@r0bertson.co.uk
|
58
58
|
executables: []
|
@@ -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.4.
|
83
|
+
rubygems_version: 2.4.8
|
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
|