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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff6bef1e716e78a61ceefc6011be6a4365028401
4
- data.tar.gz: ef80bb1bf5fe351176b68779bf23c5ab787e61df
3
+ metadata.gz: 5e9d8d45fee2c726648215d516e350ba2bc48e3f
4
+ data.tar.gz: 626342bee2eae420f6198e5301b052f74ba44004
5
5
  SHA512:
6
- metadata.gz: ed7bf4c3e1bdff8eb1fef444f164453f62bb9e42a4145772db990c3603085a029eab9579a9874a2353b4b0c66544b03000c6b53056d1e5a528a3f800e420e551
7
- data.tar.gz: 1013bdc40b5d4ee99e6fb5583375d92be9eb8e13be19079a434b6a804519000638edf8ad88ab7ff4a04dbb7f06836290a45b50065e479286e1a2f4857a5aaafc
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.sort_by{|x| x[:last_modified]}}]]
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), File::mtime(x), File::atime(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, last_modified, last_accessed, description, owner, group, permissions)</schema>
92
- </summary>"
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.3.3
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,41 +10,49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w+tTwLYyKecy4JBbIqkWUHWZSXq
29
+ uxaJ5n8v9CPew049BRNnL+tDM/dorEYEfXb1Zb0CmXj0XuQp74/3GdIE6aRFrsPl
30
+ nhZ1BvQZozn60v0vnPx3mVqzApX7trqIjGywkjR+bVzCRlfxJgt5DNLExdpUSUpm
31
+ iqgRYucyTfq3VLTy6wrGN2HJj8unXh4JIFjyEvR3yvcCYl6IaHxuDfgoDfBI6MeQ
32
+ Em7HctRLQorltw==
31
33
  -----END CERTIFICATE-----
32
- date: 2013-07-27 00:00:00.000000000 Z
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: '0'
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: '0'
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: '0'
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.0.0.rc.2
83
+ rubygems_version: 2.4.6
76
84
  signing_key:
77
85
  specification_version: 4
78
- summary: dir-to-xml saves a directory listing in a Dynarex XML format
86
+ summary: Dir-to-xml saves a directory listing in the Dynarex XML format
79
87
  test_files: []
metadata.gz.sig CHANGED
Binary file