Class: LambdaRubyBundler::Executor
- Inherits:
-
Object
- Object
- LambdaRubyBundler::Executor
- Defined in:
- lib/lambda_ruby_bundler/executor.rb
Overview
Main entrypoint to the application, which packages the code from given directory into ZIP.
The packaging is done inside a container resembling Lambda environment, ensuring that the gems with C extensions will work there properly.
Instance Attribute Summary collapse
-
#app_path ⇒ Object
readonly
Returns the value of attribute app_path.
-
#build_dependencies ⇒ Object
readonly
Returns the value of attribute build_dependencies.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
Instance Method Summary collapse
-
#initialize(root_path, app_path, build_dependencies) ⇒ Executor
constructor
Creates new instance of the Executor.
-
#run ⇒ Hash{:application_bundle, :dependency_layer => StringIO}
Generates the ZIP contents.
Constructor Details
#initialize(root_path, app_path, build_dependencies) ⇒ Executor
Creates new instance of the Executor.
46 47 48 49 50 |
# File 'lib/lambda_ruby_bundler/executor.rb', line 46 def initialize(root_path, app_path, build_dependencies) @root_path = root_path @app_path = app_path @build_dependencies = build_dependencies end |
Instance Attribute Details
#app_path ⇒ Object (readonly)
Returns the value of attribute app_path.
34 35 36 |
# File 'lib/lambda_ruby_bundler/executor.rb', line 34 def app_path @app_path end |
#build_dependencies ⇒ Object (readonly)
Returns the value of attribute build_dependencies.
34 35 36 |
# File 'lib/lambda_ruby_bundler/executor.rb', line 34 def build_dependencies @build_dependencies end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
34 35 36 |
# File 'lib/lambda_ruby_bundler/executor.rb', line 34 def root_path @root_path end |
Instance Method Details
#run ⇒ Hash{:application_bundle, :dependency_layer => StringIO}
Generates the ZIP contents.
57 58 59 60 61 62 |
# File 'lib/lambda_ruby_bundler/executor.rb', line 57 def run zipped_contents, = container.run.tap { container.destroy } contents = JSON.parse(zipped_contents.join) decode(contents) end |