Skip to content

Instantly share code, notes, and snippets.

@iamjarvo
Forked from areichman/app.bash
Created July 1, 2013 18:17
Show Gist options
  • Save iamjarvo/5903232 to your computer and use it in GitHub Desktop.
Save iamjarvo/5903232 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Print the usage statement and exit if no options are provided. Otherwise, set
# the required variables.
#
if [ $# -lt 1 ]
then
echo "Usage:"
echo "app console Start the console application"
echo "app test Run the test suite"
echo "app env Show details about the application environment"
exit
else
DIR="$( cd "$( dirname "$0" )" && pwd )"
cd $DIR/..
export GEM_HOME=vendor/bundler_gems
export GEM_PATH=$GEM_HOME
app_runner="java -cp lib/jruby-core-1.6.4.jar:lib/jruby-stdlib-1.6.4.jar org.jruby.Main -r ../META-INF/init" # relative to app.war/WEB-INF/lib
fi
# Run the specified utility
#
case "$1" in
console)
$app_runner script/rails console
;;
test)
$app_runner -S rake test
;;
env)
$app_runner -S rake about
echo ""
$app_runner -S gem env
$app_runner -S gem list
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment