Created
September 18, 2012 18:23
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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