Skip to content

Instantly share code, notes, and snippets.

@mislav
Created January 31, 2014 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mislav/8723314 to your computer and use it in GitHub Desktop.
Save mislav/8723314 to your computer and use it in GitHub Desktop.
Track filesystem changes on a lower level with Guard
require 'guard'
listener = Guard::Listener.select_and_init '/',
:relativize_paths => false,
:ignore_paths => ['Caches', 'Saved Application State']
listener.on_change do |files|
p files
end
listener.start
stopped = false
trap(:INT) { stopped = true }
loop do
sleep 0.1
break if stopped
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment