Remove Temporary Captcha Images
Join the DZone community and get the full member experience.
Join For Free
desc "Remove captcha images"
task :remove_captcha_files do
captcha_img_path = "#{RAILS_ROOT}/public/images/captcha_img/"
Dir.foreach(captcha_img_path){|file| File.delete(captcha_img_path+file) if (/^.*.jpg$/).match(file)} if File.exist?(captcha_img_path)
end
Opinions expressed by DZone contributors are their own.
Comments