#!/bin/bash set -e notice () { echo "$@" } ruby_detect () { ( test -f Gemfile && test -f Rakefile ) && ( notice "found ruby project" ) } rails_detect () { test -f Gemfile && cat Gemfile | grep gem | grep -q rails } rails_gen_database_spec_for_pg () { bundle show pg > /dev/null && ( notice 'create config/database.yml for postgresql' cat > config/database.yml < /dev/null && ( notice 'create config/database.yml for mysql' cat > config/database.yml < /dev/null && ( notice 'create config/database.yml for sqlite3' cat > config/database.yml <