I'm looking for a way to delete files in sub-directories no matter the depth but also keep an exclusion list of files not to delete. 

exclude list = [my.file]

*given folder structure (folders end with /)*

```
one/
  my.file
  two/
    x.x
    x.x
    xxx/
      xx
      my.file
    xxxx/
      xx

```

*after delete (every file that is not in the exclude list gets deleted, and the folder gets deleted if there are no children)*

```
one/
  my.file
  two/
    xxx/
      my.file

```

I've been using this so far but it doesn't go below the first level

```
    inside(directory) do
        FileUtils.rm_rf Dir.glob('*').reject { |f| whitelist.include?(f) }
    end

```