Class: BuildpackSupport::Component::VersionedDependencyComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- BuildpackSupport::Component::VersionedDependencyComponent
- Includes:
- VersionedDownloads
- Defined in:
- lib/buildpack_support/component/versioned_dependency_component.rb
Overview
A convenience base class for all components that have a versioned dependency. In addition to the functionality inherited from BaseComponent
this class also ensures that managed dependencies are handled in a uniform manner.
Instance Method Summary collapse
-
#detect ⇒ Array<String>, ...
If the component should be used when staging an application.
-
#initialize(context, configured_item = BuildpackSupport::Repository::ConfiguredItem.new, &version_validator) ⇒ VersionedDependencyComponent
constructor
Creates an instance.
Methods included from VersionedDownloads
Methods included from Downloads
#download, #download_tar, #download_zip
Methods included from WithTiming
Methods included from Shell
Methods inherited from BaseComponent
Constructor Details
#initialize(context, configured_item = BuildpackSupport::Repository::ConfiguredItem.new, &version_validator) ⇒ VersionedDependencyComponent
Creates an instance. In addition to the functionality inherited from BaseComponent
, @version and @uri instance variables are exposed.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/buildpack_support/component/versioned_dependency_component.rb', line 37 def initialize(context, configured_item = BuildpackSupport::Repository::ConfiguredItem.new, &version_validator) super(context) if supports? @version, @uri = configured_item.find_item(@component_name, @configuration, &version_validator) else @version = nil @uri = nil end end |
Instance Method Details
#detect ⇒ Array<String>, ...
If the component should be used when staging an application
49 50 51 |
# File 'lib/buildpack_support/component/versioned_dependency_component.rb', line 49 def detect @version ? id(@version) : nil end |