Class: LambdaRubyBundler::CLI::CacheRunner
- Inherits:
-
BaseRunner
- Object
- BaseRunner
- LambdaRubyBundler::CLI::CacheRunner
- Defined in:
- lib/lambda_ruby_bundler/cli/cache_runner.rb
Overview
Runs the executor in Cache Mode.
Constant Summary collapse
- MD5_EXTRACT_REGEX =
/build(?:dep)?-([a-f0-9]{32}).zip/.freeze
Instance Attribute Summary collapse
-
#cache_dir ⇒ Object
readonly
Returns the value of attribute cache_dir.
Attributes inherited from BaseRunner
Instance Method Summary collapse
-
#initialize(root_path, app_path, cache_dir) ⇒ CacheRunner
constructor
Creates new instance of cache runner.
-
#run ⇒ Hash
Runs the executor, if necessary.
Constructor Details
#initialize(root_path, app_path, cache_dir) ⇒ CacheRunner
Creates new instance of cache runner.
19 20 21 22 |
# File 'lib/lambda_ruby_bundler/cli/cache_runner.rb', line 19 def initialize(root_path, app_path, cache_dir) super(root_path, app_path) @cache_dir = cache_dir end |
Instance Attribute Details
#cache_dir ⇒ Object (readonly)
Returns the value of attribute cache_dir.
9 10 11 |
# File 'lib/lambda_ruby_bundler/cli/cache_runner.rb', line 9 def cache_dir @cache_dir end |
Instance Method Details
#run ⇒ Hash
Runs the executor, if necessary. Returns hash with two keys:
:application_bundle => path to the application code bundle
:dependency_layer => path to dependency bundle
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/lambda_ruby_bundler/cli/cache_runner.rb', line 29 def run build_dependencies = !dependencies_builds.key?(dependencies_hash) build_application = !application_builds.key?(application_hash) if build_application || build_dependencies clear_cache bundle(build_dependencies) end paths end |