Skip to content

Instantly share code, notes, and snippets.

@parndt
Last active November 30, 2017 02:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parndt/5750490 to your computer and use it in GitHub Desktop.
Save parndt/5750490 to your computer and use it in GitHub Desktop.
Rails 2, Rails 3, Rails 4, Hanami Server and Console
# Rails 2, 3, 4, and Hanami console
function rc {
if [ -e "./script/console" ]; then
./script/console $@
elif [ -e "./bin/rails" ]; then
./bin/rails console $@
elif [ -e "./apps" ]; then
hanami console $@
else
script/rails console $@
fi
}
# Rails 2, 3, 4, and Hanami server
function rs {
if [ -e "./script/server" ]; then
./script/server $@
elif [ -e "./bin/rails" ]; then
./bin/rails server $@
elif [ -d "./apps" ]; then
hanami server
else
./script/rails server $@
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment