Skip to content

Instantly share code, notes, and snippets.

@kenoir
Created September 18, 2012 18:23
Show Gist options
  • Save kenoir/3744833 to your computer and use it in GitHub Desktop.
Save kenoir/3744833 to your computer and use it in GitHub Desktop.
Rake task to watch changes to .php files and run a phpunit rake task
require 'watchr'
desc 'Start watching PHP changes and run PHPUnit'
task :watch_php do
script = Watchr::Script.new
script.watch('./(.*)\.php') {|m|
Rake::Task["phpunit"].reenable
Rake::Task["phpunit"].invoke
}
handler = Watchr.handler.new;
controller = Watchr::Controller.new(script,handler);
controller.run
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment