Created
March 21, 2012 12:59
-
-
Save kschiess/2146730 to your computer and use it in GitHub Desktop.
Hunts down your unicorn workers and kills them
This file contains hidden or 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 'guard/guard' | |
| module Guard | |
| class UnicornHunter < Guard | |
| # Called on file(s) modifications that the Guard watches. | |
| # @param [Array<String>] paths the changes files or paths | |
| # @raise [:task_has_failed] when run_on_change has failed | |
| def run_on_change(paths) | |
| if system("killall -m 'unicorn worker'") | |
| puts "Unicorn hunter has found a unicorn..." | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment