# File lib/mixlib/archive/lib_archive.rb, line 25
      def extract(destination, perms: true, ignore: [])
        ignore_re = Regexp.union(ignore)
        flags = perms ? ::Archive::EXTRACT_PERM : nil
        FileUtils.mkdir_p(destination)

        # @note Dir.chdir is applied to the process, thus it is not thread-safe
        # and must be synchronized.
        # TODO: figure out a better alternative to chdir
        Mixlib::Archive::LibArchive.mutex_chdir.synchronize do
          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
      end