Class: BuildpackSupport::Rake::CachedArtifactFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/buildpack_support/rake/cached_artifact_finder.rb

Overview

A class that finds all artifacts eligible to be cached

Instance Method Summary collapse

Constructor Details

#initializeCachedArtifactFinder

Creates a new instance



30
31
32
33
34
35
# File 'lib/buildpack_support/rake/cached_artifact_finder.rb', line 30

def initialize
  @cache                   = BuildpackSupport::Cache::DownloadCache.new
  @configuration_utils     = BuildpackSupport::ConfigurationUtils.new
  @default_repository_root = @configuration_utils.load('repository')['default_repository_root'].chomp('/')
  @version_resolver        = BuildpackSupport::Repository::WildcardVersionResolver.new
end

Instance Method Details

#find(configurations) ⇒ Array<String>

Returns a collection of URIs to be cached

Parameters:

  • configurations (Array<Hash>)

    a collection of hashes that contain repository configurations

Returns:

  • (Array<String>)

    a collection of uris to be cached



41
42
43
44
45
46
47
# File 'lib/buildpack_support/rake/cached_artifact_finder.rb', line 41

def find(configurations)
  configurations.map do |configuration|
    index_uris(configuration).map do |index_uri|
      [index_uri, cached_artifact(configuration, index_uri)]
    end
  end.flatten
end