Bash Script to Load Common Ruby on Rails Tasks
Awesome time-saving script
Here’s a bash script (sh) that will help you setup your rails session by automatically loading up a terminal with several useful rails tabs. The script below will open the /script/console, development log, sql lite, IRB and the /script/server.
Save the script below to a file in your linux box and run it like this:
sh “file-name.sh” /complete/dir/path/to-your-rails-project/
#!/bin/bash
DIR="${1}"
if [ ! -d "${DIR}" ]; then
echo "Error: Use full directory path:"
echo "${0} file-name.sh /some/path/to/dir"
exit 1
fi
gnome-terminal --window --working-directory=${DIR} -t "Server" -e "script/server" \
--tab --working-directory=${DIR} -t "Console" -e "script/console" \
--tab --working-directory=${DIR} -t "DBConsole" -e "script/dbconsole" \
--tab --working-directory=${DIR} -t "IRB" -e "irb" \
--tab --working-directory=${DIR} -t "Dev Log" -e "tail -f log/development.log" \
--tab --working-directory=${DIR} -t "Terminal" &



















