Skip to content

Instantly share code, notes, and snippets.

@cmhobbs
Created June 6, 2012 17:00
Show Gist options
  • Save cmhobbs/2883295 to your computer and use it in GitHub Desktop.
Save cmhobbs/2883295 to your computer and use it in GitHub Desktop.
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