Skip to content

Instantly share code, notes, and snippets.

@crallen
Created June 21, 2010 15:26
Show Gist options
  • Save crallen/447010 to your computer and use it in GitHub Desktop.
Save crallen/447010 to your computer and use it in GitHub Desktop.
require 'find'
def copy_dir_tree(src_dir, dest_dir, ignored_exts)
Find.find(src_dir) do |file|
next if ignored_exts.include?(File.extname(file))
if File.directory?(file)
mkdir File.join(dest_dir, file)
else
cp file, File.join(dest_dir, file)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment