lib/pe_build/unpack/tar.rb in vagrant-pe_build-0.5.0 vs lib/pe_build/unpack/tar.rb in vagrant-pe_build-0.6.0

- old
+ new

@@ -1,7 +1,6 @@ require 'archive/tar/minitar' -require 'zlib' module PEBuild module Unpack class Tar @@ -10,21 +9,21 @@ def initialize(src, dst) @src, @dst = src, dst end def unpack - ::Archive::Tar::Minitar.unpack(zip, @dst) + ::Archive::Tar::Minitar.unpack(file_stream, @dst) end # @return [String] The file/dir that will be created as a result of unpack def creates File.join(@dst, dirname) end # @return [String] The base directory contained in the tar archive def dirname - input = ::Archive::Tar::Minitar::Input.new(zip) + input = ::Archive::Tar::Minitar::Input.new(file_stream) base = nil input.each do |entry| path = entry.name base = path.split(File::SEPARATOR).first @@ -33,11 +32,11 @@ base end private - def zip - Zlib::GzipReader.new(File.open(@src, 'rb')) + def file_stream + File.open(@src, 'rb') end end end end