Class: Babushka::TarAsset

Inherits:
Asset show all
Defined in:
lib/babushka/asset.rb

Constant Summary

Constants inherited from Asset

Asset::ASSET_TYPES

Instance Attribute Summary

Attributes inherited from Asset

#name, #path

Instance Method Summary collapse

Methods inherited from Asset

#build_prefix, #content_subdir, detect_type_by_contents, detect_type_by_extension, #extract, #filename, for, #identity_dirs, #initialize, #process_extract, #supported?, type, #type

Methods included from ShellHelpers

cmd_dir, current_username, log_shell, login_shell, raw_shell, shell, shell!, shell?, shell_cmd, sudo, which

Methods included from LogHelpers

debug, deprecated!, log, log_block, log_error, log_ok, log_stderr, log_warn, removed!

Methods included from PathHelpers

cd, in_build_dir, in_download_dir

Constructor Details

This class inherits a constructor from Babushka::Asset

Instance Method Details

#extract_commandObject


119
120
121
# File 'lib/babushka/asset.rb', line 119

def extract_command
  "tar -#{extract_option(type)}xf '#{path}'"
end

#extract_option(type) ⇒ Object


123
124
125
126
127
128
129
# File 'lib/babushka/asset.rb', line 123

def extract_option type
  {
    :tar => '',
    :gzip => 'z',
    :bzip2 => 'j'
  }[type]
end