Class: Vara::Tarball

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/vara/tarball.rb

Overview

Represents a binary file that is packaged in a .pivotal product

Instance Method Summary collapse

Methods included from Loggable

included, #log

Constructor Details

#initialize(metadata, target_dir) ⇒ Tarball

Returns a new instance of Tarball.

Parameters:

  • metadata (#basename, #url, #md5)
  • target_dir (String)

    path to folder where binary should be saved



13
14
15
16
# File 'lib/vara/tarball.rb', line 13

def initialize(, target_dir)
  @metadata = 
  @target_dir = target_dir
end

Instance Method Details

#sync_local_copyString

Based on the metadata, downloads the binary from the metadata#url and verifies the checksum.

Returns:

  • (String)

    path to the downloaded/verified release taball

Raises:

  • (RuntimeError)

    if the checksum of the downloaded file does not match the expected checksum



21
22
23
24
25
26
# File 'lib/vara/tarball.rb', line 21

def sync_local_copy
  download
  validate_tarball
  validate_checksum
  path_to_binary
end