Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'find'
- def traverse_paths *paths, prune_dirs: []
- Find.find *paths do |path|
- Find.prune if File.directory?(path) && prune_dirs.include?(File.basename(path))
- puts path # Whatever you're doing here.
- end
- end
- traverse_paths '.', prune_dirs: %w[node_modules]
Add Comment
Please, Sign In to add comment