Skip to content

Instantly share code, notes, and snippets.

@drio
Created April 15, 2009 18:33
Show Gist options
  • Save drio/95944 to your computer and use it in GitHub Desktop.
Save drio/95944 to your computer and use it in GitHub Desktop.
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