Skip to content

Instantly share code, notes, and snippets.

@dominiek
Created June 21, 2010 11:54
Show Gist options
  • Save dominiek/446746 to your computer and use it in GitHub Desktop.
Save dominiek/446746 to your computer and use it in GitHub Desktop.
def loop_dir(dir)
Find.find(dir) do |path|
next if path == '.'
yield(path) unless ignore_path?(path)
end
end
def ignore_path?(path)
@ignored_path_regexes.detect { |regex| File.basename(path).match(regex) != nil }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment