Skip to content

Instantly share code, notes, and snippets.

@Marchino
Created November 10, 2011 14:15
Show Gist options
  • Save Marchino/1354942 to your computer and use it in GitHub Desktop.
Save Marchino/1354942 to your computer and use it in GitHub Desktop.
watch directory
Marcos-MacBook-Pro:~ marcocrepaldi$ ps aux
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
marcocrepaldi 25226 0.0 2.7 2557336 114636 s004 S+ 3:11PM 0:14.09 ruby path/to/rake watcher:start
require 'guard'
namespace :watcher do
desc "starts watching catalogues directory"
task :start => :environment do
listener = Guard::Listener.select_and_init('/Users/marcocrepaldi/catalogues')
listener.on_change do |files|
puts files
end
listener.start
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment