Created
May 27, 2011 18:24
-
-
Save johnbintz/995843 to your computer and use it in GitHub Desktop.
Use Guard to restart Rails development server when important things change
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
def rails | |
system %{sh -c '[[ -f tmp/pids/development.pid ]] && kill $(cat tmp/pids/development.pid)'} | |
system %{rails s -d} | |
end | |
guard 'shell' do | |
watch(%r{config/(.*)}) { rails } | |
watch(%r{lib/(.*)}) { rails } | |
end | |
rails |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment