Class: Babushka::TarResource

Inherits:
Resource show all
Defined in:
lib/babushka/resource.rb

Constant Summary

Constant Summary

Constants inherited from Resource

Resource::CLASSES, Resource::TYPES

Instance Attribute Summary

Attributes inherited from Resource

#name, #path

Instance Method Summary (collapse)

Methods inherited from Resource

#archive_prefix, #content_subdir, detect_type_by_contents, detect_type_by_extension, download, extract, #extract, #filename, for, get, #identity_dirs, #initialize, #process_extract, #supported?, type, #type

Methods included from PathHelpers

#cd, #in_build_dir, #in_dir, #in_download_dir

Methods included from ShellHelpers

#cmd_dir, #failable_shell, #log_shell, #login_shell, #raw_shell, #shell, #shell!, #shell?, #sudo, #which

Methods included from LogHelpers

#debug, #log, #log_block, #log_error, #log_ok, #log_verbose, #log_warn

Constructor Details

This class inherits a constructor from Babushka::Resource

Instance Method Details

- (Object) extract_command



154
155
156
# File 'lib/babushka/resource.rb', line 154

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

- (Object) extract_option(type)



157
158
159
160
161
162
163
# File 'lib/babushka/resource.rb', line 157

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