Skip to content

Instantly share code, notes, and snippets.

@johnbintz
Created May 27, 2011 18:24
Show Gist options
  • Save johnbintz/995843 to your computer and use it in GitHub Desktop.
Save johnbintz/995843 to your computer and use it in GitHub Desktop.
Use Guard to restart Rails development server when important things change
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