Skip to content

Instantly share code, notes, and snippets.

@BDQ
Created August 10, 2011 15:03
Show Gist options
  • Save BDQ/1137041 to your computer and use it in GitHub Desktop.
Save BDQ/1137041 to your computer and use it in GitHub Desktop.
desc "Duplicates images from all app/assets directories"
task :cache_images_for_development => :environment do
image_paths = Rails.application.assets.paths.select {|path| path.ends_with? "/images" }
image_paths.reverse.each do |path|
Dir.glob(File.join(path, "**/*")) do |file|
puts file.to_s.sub(path, '')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment