Created
April 15, 2009 18:33
-
-
Save drio/95944 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FindFiles | |
def self.find(ldirs, re) | |
dirs = dirs.is_a?(String) ? File.open(ldirs).readlines : ldirs | |
your_files = [] | |
dirs.each do |d| | |
Dir["#{d}/*"].each { |f| your_files << f if f =~ re } | |
end | |
your_files | |
end | |
end | |
assert_equal([ @r1_fpath ], FindFiles::find([@r1_path], re)) # ==> not true :( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment