class LambdaRubyBundler::Volume

Wrapper around [Docker::Volume] for creating and fetching bundler volumes, which are used to cache built gems. This speeds up the process significantly. @api private

Constants

NAME_TEMPLATE

Attributes

application_name[R]

Public Class Methods

new(application_name) click to toggle source
# File lib/lambda_ruby_bundler/volume.rb, line 13
def initialize(application_name)
  @application_name = application_name
end

Public Instance Methods

id() click to toggle source
# File lib/lambda_ruby_bundler/volume.rb, line 17
def id
  volume.id
end
Also aliased as: name
name()
Alias for: id

Private Instance Methods

fetch_volume() click to toggle source
# File lib/lambda_ruby_bundler/volume.rb, line 27
def fetch_volume
  name = format(NAME_TEMPLATE, app: application_name)

  Docker::Volume.get(name)
rescue Docker::Error::NotFoundError
  Docker::Volume.create(name)
end
volume() click to toggle source
# File lib/lambda_ruby_bundler/volume.rb, line 23
def volume
  @volume ||= fetch_volume
end