Skip to content

Instantly share code, notes, and snippets.

@garyharan
Created June 20, 2011 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garyharan/1036255 to your computer and use it in GitHub Desktop.
Save garyharan/1036255 to your computer and use it in GitHub Desktop.
Bash functions for rails 2/3
#!/bin/sh
# script/server with Rails 3 support
ss() {
if [ -f ./script/rails ]; then
./script/rails server $@
else
./script/server $@
fi
}
# script/console with Rails 3 support
sc() {
if [ -f ./script/rails ]; then
./script/rails console $@
else
./script/console $@
fi
}
# script/generate with Rails 3 support
sg() {
if [ -f ./script/rails ]; then
./script/rails generate $@
else
./script/generate $@
fi
}
rr() {
rake
if [ $? -gt 0 ]; then
say "Some tests failed."
echo "Some tests failed."
else
say "All tests green."
echo "All tests green."
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment