Module: BuildpackSupport::Component::VersionedDownloads

Includes:
Downloads, Shell
Included in:
VersionedDependencyComponent
Defined in:
lib/buildpack_support/component/versioned_downloads.rb

Overview

A mixin that provides methods for downloading, caching, and unpacking files where a version and uri are available

Instance Method Summary collapse

Methods included from Downloads

#download

Methods included from WithTiming

#with_timing

Methods included from Shell

#shell

Instance Method Details

#download_tar(target_directory = @droplet.sandbox, name = @component_name) ⇒ Void

Downloads a given TAR file and expands it.

Parameters:

  • target_directory (Pathname) (defaults to: @droplet.sandbox)

    the directory to expand the TAR file to. Defaults to the component’s sandbox.

  • name (String) (defaults to: @component_name)

    an optional name for the download and expansion. Defaults to @component_name.

Returns:

  • (Void)


40
41
42
# File 'lib/buildpack_support/component/versioned_downloads.rb', line 40

def download_tar(target_directory = @droplet.sandbox, name = @component_name)
  super_download_tar @version, @uri, target_directory, name
end

#download_zip(strip_top_level = true, target_directory = @droplet.sandbox, name = @component_name) ⇒ Void

Downloads a given ZIP file and expands it.

Parameters:

  • strip_top_level (Boolean) (defaults to: true)

    whether to strip the top-level directory when expanding. Defaults to true.

  • target_directory (Pathname) (defaults to: @droplet.sandbox)

    the directory to expand the ZIP file to. Defaults to the component’s sandbox.

  • name (String) (defaults to: @component_name)

    an optional name for the download. Defaults to @component_name.

Returns:

  • (Void)


50
51
52
# File 'lib/buildpack_support/component/versioned_downloads.rb', line 50

def download_zip(strip_top_level = true, target_directory = @droplet.sandbox, name = @component_name)
  super_download_zip @version, @uri, strip_top_level, target_directory, name
end