Ruby has * nix rm -rf in the FileUtils module, which you can use to delete both files and non-empty folders
FileUtils.rm_rf('dir/to/remove')
To save the directory itself and delete its contents:
FileUtils.rm_rf(Dir.glob('dir/to/remove/*'))
maprihoda Dec 16 '11 at 18:25 2011-12-16 18:25
source share