class Mixlib::Archive::LibArchive

def extract(destination, perms: true, ignore: [])

ignore[Array]:: an array of matches of file paths to ignore
perms:: should the extracter use permissions from the archive.
=== Parameters

Extracts the archive to the given +destination+
def extract(destination, perms: true, ignore: [])
  ignore_re = Regexp.union(ignore)
  flags = perms ? ::Archive::EXTRACT_PERM : nil
  FileUtils.mkdir_p(destination)
  Dir.chdir(destination) do
    reader = ::Archive::Reader.open_filename(@archive)
    reader.each_entry do |entry|
      if entry.pathname =~ ignore_re
        Mixlib::Archive::Log.warn "ignoring entry #{entry.pathname}"
        next
      end
      reader.extract(entry, flags.to_i)
    end
    reader.close
  end
end