Class: BuildpackSupport::Repository::ConfiguredItem
- Inherits:
-
Object
- Object
- BuildpackSupport::Repository::ConfiguredItem
- Defined in:
- lib/buildpack_support/repository/configured_item.rb
Overview
A class encapsulating details of a file stored in a versioned repository.
Instance Method Summary collapse
-
#find_item(component_name, configuration) {|version| ... } ⇒ String, TokenizedVersion
Finds an instance of the file based on the configuration and wraps any exceptions to identify the component.
-
#initialize(version_resolver = WildcardVersionResolver.new) ⇒ ConfiguredItem
constructor
Creates a new instance.
Constructor Details
#initialize(version_resolver = WildcardVersionResolver.new) ⇒ ConfiguredItem
Creates a new instance
30 31 32 |
# File 'lib/buildpack_support/repository/configured_item.rb', line 30 def initialize(version_resolver = WildcardVersionResolver.new) @version_resolver = version_resolver end |
Instance Method Details
#find_item(component_name, configuration) {|version| ... } ⇒ String, TokenizedVersion
Finds an instance of the file based on the configuration and wraps any exceptions to identify the component.
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/buildpack_support/repository/configured_item.rb', line 45 def find_item(component_name, configuration) repository_root = repository_root(configuration) version = version(configuration) yield version if block_given? index = index(repository_root) index.find_item version rescue => e raise RuntimeError, "#{component_name} error: #{e.}", e.backtrace end |