Dir-to-xml Now Features the Filter Method

require 'dir-to-xml'

media_src = '/tmp'

# to start off we will create a couple of sample files
File.write File.join(media_src, 'sample1.txt'), 'demo of dir2xml 123'
File.write File.join(media_src, 'sample2.txt'), '# Demo of Dir2XML 456'

# returns only the files which match the string *sample* at the beginning.
DirToXML.new(media_src).filter(/^sample/).to_h 


Resources