class Dapp::Dimg::Config::Directive::Mount

Attributes

_from[R]
_to[R]
_type[R]

Public Class Methods

new(to, **kwargs, &blk) click to toggle source
Calls superclass method Dapp::Config::Directive::Base::new
# File lib/dapp/dimg/config/directive/mount.rb, line 10
def initialize(to, **kwargs, &blk)
  raise ::Dapp::Error::Config, code: :mount_to_absolute_path_required unless Pathname((to = to.to_s)).absolute?
  @_to = path_format(to)

  super(**kwargs, &blk)
end

Public Instance Methods

from(type) click to toggle source
# File lib/dapp/dimg/config/directive/mount.rb, line 17
def from(type)
  sub_directive_eval do
    type = type.to_sym
    raise ::Dapp::Error::Config, code: :mount_from_type_required unless [:tmp_dir, :build_dir].include? type
    @_type = type
  end
end
from_path(path) click to toggle source
# File lib/dapp/dimg/config/directive/mount.rb, line 25
def from_path(path)
  sub_directive_eval do
    @_from = path_format(path)
    @_type = :custom_dir
  end
end
validate!() click to toggle source
# File lib/dapp/dimg/config/directive/mount.rb, line 32
def validate!
  raise ::Dapp::Error::Config, code: :mount_from_or_from_path_required if _type.nil?
end