class LambdaRubyBundler::CLI::BaseRunner

Runs the executor. @api private

Attributes

app_path[R]
root_path[R]

Public Class Methods

new(root_path, app_path) click to toggle source
# File lib/lambda_ruby_bundler/cli/base_runner.rb, line 10
def initialize(root_path, app_path)
  @root_path = root_path
  @app_path = app_path
end

Private Instance Methods

bundle(build_dependencies) click to toggle source
# File lib/lambda_ruby_bundler/cli/base_runner.rb, line 17
def bundle(build_dependencies)
  executor = LambdaRubyBundler::Executor.new(
    root_path, app_path, build_dependencies
  )

  result = executor.run

  save(result[:application_bundle], paths[:application_bundle])
  return unless build_dependencies

  save(result[:dependency_layer], paths[:dependency_layer])
end
save(io, path) click to toggle source
# File lib/lambda_ruby_bundler/cli/base_runner.rb, line 30
def save(io, path)
  File.open(path, 'wb+') { |file| file.write(io.read) }
end