Skip to content

Instantly share code, notes, and snippets.

View ggomagundan's full-sized avatar
🎧
Working Working

ggomagundan

🎧
Working Working
View GitHub Profile
# It requires ACK - http://betterthangrep.com/
task :find_unused_images do
images = Dir.glob('app/assets/images/**/*')
images_to_delete = []
images.each do |image|
unless File.directory?(image)
# print "\nChecking #{image}..."
print '.'
result = `/Users/stereodenis/bin/ack -1 --type-set=mytype=.rb,.css,.scss,.haml,.coffee,.js,.erb,.en,.th,.html,.slim,.less,.sass #{File.basename(image)}`