#!/usr/bin/env python

import sys
import subprocess

if sys.argv[1] == 'start_postgres':
    # OS X only
    cmd = 'pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
elif sys.argv[1] == 'stop_postgres':
    # OS X only
    cmd = 'pg_ctl -D /usr/local/var/postgres stop -s -m fast'
elif sys.argv[1] == 'check_postgres':
    cmd = 'pg_ctl -D /usr/local/var/postgres status'
else:
    cmd = None

if cmd:
    subprocess.call(cmd.split(' '))

# customizing rails app name in current directory
# rails new . validations_in_controller_actions
