Guest User

Untitled

a guest
Dec 11th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. require 'find'
  2.  
  3. def traverse_paths *paths, prune_dirs: []
  4. Find.find *paths do |path|
  5. Find.prune if File.directory?(path) && prune_dirs.include?(File.basename(path))
  6.  
  7. puts path # Whatever you're doing here.
  8. end
  9. end
  10.  
  11. traverse_paths '.', prune_dirs: %w[node_modules]
Add Comment
Please, Sign In to add comment