Class: BuildpackSupport::BaseBuildpack
- Inherits:
-
Object
- Object
- BuildpackSupport::BaseBuildpack
- Defined in:
- lib/buildpack_support/base_buildpack.rb
Overview
A base class for all buildpack implementations to extend from. This implementation provides a number of utility methods for dealing with components.
Class Method Summary collapse
-
.with_buildpack(app_dir, message) {|Buildpack| ... } ⇒ Object
Main entry to the buildpack.
Instance Method Summary collapse
-
#compile ⇒ Void
Transforms the application directory such that the engine, and frameworks can run the application.
-
#detect ⇒ Array<String>
Iterates over all of the components to detect if this buildpack can be used to run an application.
-
#release ⇒ String
Generates the payload required to run the application.
Class Method Details
.with_buildpack(app_dir, message) {|Buildpack| ... } ⇒ Object
Main entry to the buildpack. Initializes the buildpack and all of its dependencies and yields a new instance to any given block. Any exceptions thrown as part of the buildpack setup or execution are handled
139 140 141 142 143 144 145 146 147 |
# File 'lib/buildpack_support/base_buildpack.rb', line 139 def with_buildpack(app_dir, ) app_dir = Pathname.new(File.(app_dir)) application = Component::Application.new(app_dir) Logging::LoggerFactory.instance.setup app_dir yield new(app_dir, application) if block_given? rescue => e handle_error(e, ) end |
Instance Method Details
#compile ⇒ Void
Transforms the application directory such that the engine, and frameworks can run the application
40 41 42 |
# File 'lib/buildpack_support/base_buildpack.rb', line 40 def compile fail "Method 'compile' must be defined" end |
#detect ⇒ Array<String>
Iterates over all of the components to detect if this buildpack can be used to run an application
33 34 35 |
# File 'lib/buildpack_support/base_buildpack.rb', line 33 def detect fail "Method 'detect' must be defined" end |
#release ⇒ String
Generates the payload required to run the application. The payload format is defined by the Heroku Buildpack API.
48 49 50 |
# File 'lib/buildpack_support/base_buildpack.rb', line 48 def release fail "Method 'release' must be defined" end |