Last Updated: February 25, 2016
·
240
· felippemr

Delete trees of files

Don't resort to using the shell to delete directories. Ruby comes with a handy file utilities library called FileUtils that can do the hard work:

require 'fileutils'
FileUtils.rm_r 'somedir'