lib/mixlib/archive.rb in mixlib-archive-0.4.13 vs lib/mixlib/archive.rb in mixlib-archive-0.4.16

- old
+ new

@@ -38,17 +38,21 @@ def create(files = [], gzip: false) archiver.create(files, gzip: gzip) end def extract(destination, perms: true, ignore: []) - ignore = [/^\.$/, /\.{2}/] + Array(ignore) + ignore = [/^\.$/, /\.{2}#{path_separator}/] + Array(ignore) create_and_empty(destination) archiver.extract(destination, perms: perms, ignore: ignore) end private + + def path_separator + File::SEPARATOR + end def create_and_empty(destination) FileUtils.mkdir_p(destination) if @empty Dir.foreach(destination) do |entry|