lib/zeus/server/file_monitor/fsevent.rb
# The biggest complicating factor here is that ruby doesn't fully resolve
# symlinks in paths, but FSEvents does. We resolve all paths fully with
# Pathname#realpath, and keep mappings in both directions.
# It's conceivable that the same file would be required by two different paths,
# so we keep an array and fire callbacks for all given paths matching a real
# path when a change is detected.
The biggest complicating factor here is that ruby doesn't fully resolve
symlinks in paths, but FSEvents does. We resolve all paths fully with
Pathname#realpath, and keep mappings in both directions.
It's conceivable that the same file would be required by two different paths,
so we keep an array and fire callbacks for all given paths matching a real
path when a change is detected.
The biggest complicating factor here is that ruby doesn ' t fully resolve symlinks in paths but FSEvents does . We resolve all paths fully with Pathname#realpath and keep mappings in both directions . It ' s conceivable that the same file would be required by two different paths so we keep an array and fire callbacks for all given paths matching a real path when a change is detected .
def watch(given)
          return false if @givenpath_to_realpath[given]
          real = realpath(given)
          @givenpath_to_realpath[given] = real
          @realpath_to_givenpath[real] ||= []
          @realpath_to_givenpath[real] << given
          @io_in.write("#{real}\n")
          true
        end
def watch ( given ) return false if @givenpath_to_realpath [ given ] real = realpath ( given ) @givenpath_to_realpath [ given ] = real @realpath_to_givenpath [ real ] ||= [ ] @realpath_to_givenpath [ real ] << given @io_in . write ( "#{real}\n" ) true end
The biggest complicating factor here is that ruby doesn't fully resolve
symlinks in paths, but FSEvents does.
The biggest complicating factor here is that ruby doesn ' t fully resolve symlinks in paths but FSEvents does .
given
<not_specific>