#!/usr/bin/env bash # # r - Rails shortcut command. # r() { local action args action="$1" ; shift args="$@" case "$action" in c) action=console ;; db) action=dbconsole ;; g) action=generate ;; h|help) action="-h" ;; esac if [[ -s config.ru ]] ; then ruby ./script/rails $args else if [[ -s ./script/$action ]] ; then ruby ./script/$action $args else printf "ERROR: Missing script ./script/$action !!!" fi fi }