Module: Rustywind::Ruby::Upstream::TarGz
- Defined in:
- lib/rustywind/ruby/upstream/tar_gz.rb
Class Method Summary collapse
Class Method Details
.extract(tar_file, destination) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/rustywind/ruby/upstream/tar_gz.rb', line 7 def self.extract(tar_file, destination) Gem::Package::TarReader.new(Zlib::GzipReader.open(tar_file)) do |tar| tar.each do |entry| next unless entry.file? File.write(File.join(destination, File.basename(entry.full_name)), entry.read) end end end |