Skip to content

Instantly share code, notes, and snippets.

@netzpirat
Created December 29, 2011 09:37
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 netzpirat/1533227 to your computer and use it in GitHub Desktop.
Save netzpirat/1533227 to your computer and use it in GitHub Desktop.
Listen to file changes with Guard
require 'guard/listener'
listener = Guard::Listener.select_and_init({
watchdir: '/tmp',
watch_all_modifications: true
})
listener.on_change do |files|
puts "File change: #{ files.join(',') }"
end
listener.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment