socketstream/socketstream — pull request #226 by madscoaducom (2012-04-24 20:48:42+00:00)
Title: Live Reload only reloads once - when using Vim

Hi,

This fixed Live Reload for me using Vim on Linux.

Note that the patch includes my change to the live_reload.coffee file plus the make generated change to live_reload.js - let me know if you only want the coffeescript file change.

- Symptom: When using an editor (e.g. like Vim) that renames a file
when saving changes, socketstream Live Reload will stop
working after the first change reload.

- Change: Check for the "rename" event, close old watch
and open a new watch for the file.

- Test: Besides testing functionality, run in bash:
` ls -l /proc//fd | grep inotify | wc -l`
and ensure line count stays the same across multiple
watch file changes.
`` is the process id of the running socketstream node app.

- Based on Trevor Burnhams answer to:
http://stackoverflow.com/questions/8280915/coffeescript-1-1-3-watch-only-works-once

- OS: Ubuntu 10.04