Class: BuildpackUtils::GlobalCache

Inherits:
DownloadCache show all
Defined in:
lib/buildpack-utils/global_cache.rb

Overview

An extension of DownloadCache that is configured to use the global cache. The global cache location is defined by the BUILDPACK_CACHE environment variable

Instance Method Summary collapse

Methods inherited from DownloadCache

#delete_file, #evict, #get

Constructor Details

#initializeGlobalCache

Creates an instance that is configured to use the global cache. The global cache location is defined by the BUILDPACK_CACHE environment variable

Raises:

  • if the BUILDPACK_CACHE environment variable is nil



26
27
28
29
30
# File 'lib/buildpack-utils/global_cache.rb', line 26

def initialize
  global_cache_directory = ENV['BUILDPACK_CACHE']
  raise 'Global cache directory is undefined' if global_cache_directory.nil?
  super(global_cache_directory)
end