dir-to-xml 0.4.3 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ec027c2c2452bc9559469830c0a42382e81aedc
4
- data.tar.gz: 6ef254eae0c663a8805337f26a6b62a75e6e76e8
3
+ metadata.gz: f5724ab2239ea5a850d8ad3c261f1f3e55ff0874
4
+ data.tar.gz: 08fd250577adfefdad667a129a9faac9c9561922
5
5
  SHA512:
6
- metadata.gz: 3649db45223135804b8a7d7c01f53b51434008203fba151f7f494f0f7656c91746f5d9ca1a023bce9160816da216c9a69a92d939ca41bb33873c92abedddd2d9
7
- data.tar.gz: 6b7d6347aa1226ac4eb2fb4c3db93507abb9cd24e6631dded4639b12115f848b2cf2b26e5475cdbea32bdc18250053ebdb252a495c375c531ad801fc87d6c2b7
6
+ metadata.gz: c0edd5aeca3dcf6a13161d0adb669af15e216081ef3d16179d68ef750dbfd7c388835cb9b1fa9bf0455bcc8b00a697c1550d0bb76718353655eb7715c9142c43
7
+ data.tar.gz: 797242126a3768d9e3371ccd8137318a9d1f8cfe566e1498fc76ce41dcb7f02e2921453aef273071faf6fb66362942c4a153d86896aadf9b248e9b8c361e76e8
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -24,48 +24,11 @@ class DirToXML
24
24
  @object = @h
25
25
  end
26
26
 
27
- def select_by_ext(ext)
28
- @object = @h.select{|x| x[:ext][/#{ext}/]}
27
+ def filter(pattern=/.*/)
28
+ @object = @h.select {|x| x[:name] =~ pattern }
29
29
  self
30
30
  end
31
31
 
32
- def sort_by(sym)
33
- procs = [[:last_modified, lambda{|obj| obj\
34
- .sort_by{|x| x[:last_modified]}}]]
35
- proc1 = procs.assoc(sym).last
36
- proc1.call(@object)
37
- end
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
-
45
- def to_h
46
- @object || @h
47
- end
48
-
49
- class DirToXML
50
-
51
- attr_reader :status
52
-
53
- def initialize(path= '.')
54
- super()
55
- old_path = Dir.pwd
56
- raise "Directory not found." unless File.exists? path
57
- Dir.chdir path
58
-
59
- a = Dir.glob("*").sort
60
-
61
- command = a.include?('dir.xml') ? 'run' : 'new_run'
62
- @doc, @status = self.send command, a
63
-
64
- Dir.chdir old_path #File.expand_path('~')
65
- @h = self.to_dynarex.to_h
66
- @object = @h
67
- end
68
-
69
32
  def select_by_ext(ext)
70
33
  @object = @h.select{|x| x[:ext][/#{ext}/]}
71
34
  self
@@ -186,4 +149,4 @@ summary = "
186
149
  File.write 'dir.xml', doc.xml(pretty: true)
187
150
  [doc, "updated"]
188
151
  end
189
- end
152
+ 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.3
4
+ version: 0.5.0
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-04-26 00:00:00.000000000 Z
34
+ date: 2015-04-27 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: dynarex
metadata.gz.sig CHANGED
Binary file