Class: LambdaRubyBundler::CLI::StandardRunner

Inherits:
BaseRunner
  • Object
show all
Defined in:
lib/lambda_ruby_bundler/cli/standard_runner.rb

Overview

Runs the executor with given parameters.

Instance Attribute Summary collapse

Attributes inherited from BaseRunner

#app_path, #root_path

Instance Method Summary collapse

Constructor Details

#initialize(root_path, app_path, build_dependencies, paths) ⇒ StandardRunner

Creates new instance of cache runner.

Parameters:

  • root_path (String)

    Path to the root of application (containing Gemfile.lock)

  • app_path (String)

    Path (relative to root_path) containing application code

  • build_dependencies (Boolean)

    Whether or not to build dependencies

  • paths (Hash)

    Hash with :application_bundle and :dependency_layer output paths



19
20
21
22
23
# File 'lib/lambda_ruby_bundler/cli/standard_runner.rb', line 19

def initialize(root_path, app_path, build_dependencies, paths)
  super(root_path, app_path)
  @build_dependencies = build_dependencies
  @paths = paths
end

Instance Attribute Details

#build_dependenciesObject (readonly)

Returns the value of attribute build_dependencies.



7
8
9
# File 'lib/lambda_ruby_bundler/cli/standard_runner.rb', line 7

def build_dependencies
  @build_dependencies
end

#pathsObject (readonly)

Returns the value of attribute paths.



7
8
9
# File 'lib/lambda_ruby_bundler/cli/standard_runner.rb', line 7

def paths
  @paths
end

Instance Method Details

#runHash

Runs the executo. Returns hash with two keys:

:application_bundle => path to the application code bundle
:dependency_layer => path to dependency bundle

Returns:

  • (Hash)

    Paths to the builds



30
31
32
# File 'lib/lambda_ruby_bundler/cli/standard_runner.rb', line 30

def run
  bundle(build_dependencies)
end