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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30753497dc3cb89192e2b16e2830a26ce5fef29c
4
- data.tar.gz: fce05e271fa0d471391284a2218ca863e21135f5
3
+ metadata.gz: c718e4e10749b20081db90c763d090b2312fd2fa
4
+ data.tar.gz: 0f829facfea639a3e3db7eac450527129fb4874f
5
5
  SHA512:
6
- metadata.gz: 6790149b80e859dcd6486c79266a940be2d87eea37d076bf6008842d0a7e42ebe362f5a4bc3fcd45c9b92e858f9aac4915401190521fdf7f97469aab8e7e3d5d
7
- data.tar.gz: 48f055d6452018949ddcc81ee853ea4bf9e2c233397f8d03ec2d69dd74c2bc4c6f57728f81d36d4303da4341e8c8ac2621183d339a2ff0df0677f66787dfd67f
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(path= '.', recursive: false, index: 'dir.xml')
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
- self
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 'directory[title,file_path]/file(name, ' + \
138
+ dx = Dynarex.new('directory[title,file_path]/file(name, ' + \
126
139
  'type, ext, ctime, mtime, atime, description, owner, ' + \
127
- 'group, permissions)'
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 File.join(@path, @index)
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.0
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
- 8ixkARkWAmV1MB4XDTE1MDQyNTE1MjcyMloXDTE2MDQyNDE1MjcyMlowSDESMBAG
15
+ 8ixkARkWAmV1MB4XDTE2MDczMTE1MDg0MFoXDTE3MDczMTE1MDg0MFowSDESMBAG
16
16
  A1UEAwwJZ2VtbWFzdGVy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YDVR0RBB8w
25
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==
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAC6wZQVPx
27
+ H8PVmazVDwrxyllTrkeVFSgr3qVyigcBGpm+/sGyTDYnYWhV2GH9vYHM/OI1pJup
28
+ 0q2bFjmKFR1xSHtlMzCTulPY+OpKY403Wg0VZepzTjh9ZDS19/0tQQoaFRd6Y0CT
29
+ y8cHVYq+Ij6Ug16AA5KRuViQ1vaanElSlRKEmoWom3gkt5fkZ3SMVu/I/Bpx2j6u
30
+ wqDD24RYravGp0su86eLBFeVjwF8kMUx1VA64kCz8FDTws+tozgFi2HMWPO/B603
31
+ KsWUx1RJXP2nrd/DuPwuyaNM0fcsnnqFnbAO7RjbYXWS96dGA0WVmxdO7PcMnJ9K
32
+ PneSyA3VrnMuNQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-12-25 00:00:00.000000000 Z
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.4.8
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