Created
June 6, 2012 17:00
-
-
Save cmhobbs/2883295 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'em-dir-watcher' | |
DIR = %x{pwd}.strip | |
EM.run { | |
dw = EMDirWatcher.watch DIR do |paths| | |
paths.each do |file| | |
if File.exists? file | |
puts "! FILE MODIFIED #{file}" | |
else | |
puts "! FILE REMOVED #{file}" | |
end | |
end | |
end | |
puts "! WATCHER INITIALIZED" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment