Created
June 20, 2011 18:42
-
-
Save garyharan/1036255 to your computer and use it in GitHub Desktop.
Bash functions for rails 2/3
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
#!/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