neonblack

Project Deleter v1.0

Aug 27th, 2015
396
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ##-----------------------------------------------------------------------------
  2. #  Project Destroyer v1.0
  3. #  Created by Neon Black
  4. #  v1.0 - 8.27.15 - Main script completed
  5. #  For both commercial and non-commercial use as long as credit is given to
  6. #  Neon Black and any additional authors.  Licensed under Creative Commons
  7. #  CC BY 4.0 - http://creativecommons.org/licenses/by/4.0/
  8. ##-----------------------------------------------------------------------------
  9.  
  10. ##-----------------------------------------------------------------------------
  11. #  This script deletes everything it can in your project folder without
  12. #  warning.  This script is provided as is!  I take NO responsibility for
  13. #  projects lost by using this script since that is EXACTLY what it is meant
  14. #  to do.  USE AT YOUR OWN RISK!!!
  15. ##-----------------------------------------------------------------------------
  16.  
  17.  
  18. module ProjectDeath
  19.   def self.delete_directory(dir)
  20.     Dir::foreach(dir) do |file|
  21.       begin
  22.         next if ['.','..','Game.exe'].include?(file)
  23.         if File::directory?("#{dir}/#{file}")
  24.           delete_directory("#{dir}/#{file}")
  25.           Dir::rmdir("#{dir}/#{file}")
  26.         else
  27.           File::delete("#{dir}/#{file}")
  28.         end
  29.       rescue
  30.         next
  31.       end
  32.     end
  33.   end
  34.  
  35.   def self.delete_all
  36.     delete_directory(Dir::pwd)
  37.     exit
  38.   end
  39. end
  40.  
  41. ProjectDeath.delete_all
RAW Paste Data