class Listen::Record::SymlinkDetector

Constants

Error
README_URL

Public Class Methods

new() click to toggle source
# File lib/listen/record/symlink_detector.rb, line 24
def initialize
  @real_dirs = Set.new
end

Public Instance Methods

verify_unwatched!(entry) click to toggle source
# File lib/listen/record/symlink_detector.rb, line 28
def verify_unwatched!(entry)
  real_path = entry.real_path
  @real_dirs.add?(real_path) or _fail(entry.sys_path, real_path)
end

Private Instance Methods

_fail(symlinked, real_path) click to toggle source
# File lib/listen/record/symlink_detector.rb, line 35
def _fail(symlinked, real_path)
  warn(format(SYMLINK_LOOP_ERROR, symlinked, real_path))
  raise ::Listen::Error::SymlinkLoop, 'Failed due to looped symlinks'
end