lib/rbbt/util/tar.rb in rbbt-util-5.23.22 vs lib/rbbt/util/tar.rb in rbbt-util-5.23.23

- old
+ new

@@ -83,17 +83,24 @@ unzipped end def self._untar_cmd(io, destination) FileUtils.mkdir_p destination unless File.exist? destination - CMD.cmd("tar xvf - -C '#{destination}'", :in => io) + CMD.cmd_log("tar xvf - -C '#{destination}'", :in => io) nil end # untars the given IO into the specified # directory def self.untar(io, destination) - return _untar_cmd(io, destination) + io = io.find if Path === io + if String === io and File.exists?(io) + Open.open(io) do |f| + untar(f, destination) + end + else + return _untar_cmd(io, destination) + end end end ### Usage Example: ###