require 'fileutils' puts "\n - Uninstalling" cache_dir = "tmp/cache/gravatars" image_dir = "public/images/gravatars" # remove caching directory if it exists puts "REMOVING gravatar caching directory (and its contents) at '#{cache_dir}'" if File.exists?(cache_dir) FileUtils.rm_r cache_dir or abort("FAILED to remove gravatar cache directory '#{cache_dir}'") end # removing symbolic link between public gravatar image directory and tmp cached gravatar directory puts "REMOVING symbolic link (ln -s) to the gravatar cache '#{image_dir}' -> '../../#{cache_dir}'" FileUtils.rm_r image_dir