class Caco::FileLink

Public Instance Methods

ensure_target!(ctx, target_exist:, ensure_target: false, **) click to toggle source
# File lib/caco/file_link.rb, line 26
def ensure_target!(ctx, target_exist:, ensure_target: false, **)
  return false if !target_exist && ensure_target
  true
end
target_exist?(ctx, target:, **) click to toggle source
# File lib/caco/file_link.rb, line 16
def target_exist?(ctx, target:, **)
  ctx[:target_exist] = File.exist?(target)
  ctx[:target_realpath] = File.realdirpath(target) rescue nil
  ctx[:target_exist]
end