Sha256: 25815d62a050dc8b8b4bc5721b3e067c9464e35a6876d278f94bbd7a8348b5af
Contents?: true
Size: 840 Bytes
Versions: 55
Compression:
Stored size: 840 Bytes
Contents
require 'set' module Listen # @private api class Record class SymlinkDetector WIKI = 'https://github.com/guard/listen/wiki/Duplicate-directory-errors'.freeze SYMLINK_LOOP_ERROR = <<-EOS.freeze ** ERROR: directory is already being watched! ** Directory: %s is already being watched through: %s MORE INFO: #{WIKI} EOS class Error < RuntimeError end def initialize @real_dirs = Set.new end def verify_unwatched!(entry) real_path = entry.real_path @real_dirs.add?(real_path) || _fail(entry.sys_path, real_path) end private def _fail(symlinked, real_path) STDERR.puts format(SYMLINK_LOOP_ERROR, symlinked, real_path) fail Error, 'Failed due to looped symlinks' end end end end
Version data entries
55 entries across 48 versions & 9 rubygems