Class: Gonzui::TarGzipExtractor

Inherits:
AbstractExtractor show all
Defined in:
lib/gonzui/extractor.rb

Instance Attribute Summary

Attributes included from TemporaryDirectoryUtil

#temporary_directory

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractExtractor

#clean, #extract, #initialize

Methods included from TemporaryDirectoryUtil

#clean_temporary_directory, #prepare_temporary_directory, #set_temporary_directory

Methods included from Util

assert, assert_equal, assert_equal_all, assert_non_nil, assert_not_reached, benchmark, command_exist?, commify, eprintf, format_bytes, program_name, protect_from_signals, require_command, set_verbosity, shell_escape, unix?, vprintf, windows?, wprintf

Constructor Details

This class inherits a constructor from Gonzui::AbstractExtractor

Class Method Details

.commandsObject



164
165
166
# File 'lib/gonzui/extractor.rb', line 164

def self.commands
  ["tar", "gzip"]
end

.extnamesObject



168
169
170
# File 'lib/gonzui/extractor.rb', line 168

def self.extnames
  [".tar.gz", ".tgz"]
end

Instance Method Details

#do_extractObject



172
173
174
175
176
# File 'lib/gonzui/extractor.rb', line 172

def do_extract
  command_line = sprintf("gzip -d -c %s | tar xf -",
                         shell_escape(File.expand_path(@file_name)))
  run_extract_command(command_line, @file_name)
end