Skip to content

Instantly share code, notes, and snippets.

@chrismcg
Created February 9, 2012 10:59
Show Gist options
  • Save chrismcg/1779285 to your computer and use it in GitHub Desktop.
Save chrismcg/1779285 to your computer and use it in GitHub Desktop.
Avoid rails projects called s or server, c or console
function listener() {
if [[ -f Procfile ]]; then
echo "Starting Foreman"
bundle exec foreman start
else
if [[ -x script/server ]]; then
echo "Starting Rails 2 listener"
script/server $*
else
echo "Starting Rails 3 listener"
bundle exec rails s $*
fi
fi
}
function console() {
if [[ -x script/console ]]; then
script/console $*
else
bundle exec rails c $*
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment