Hello,
I would like to start the database server (postgres) before tests are run
and stop it afterwards. For this, I have created a little wrapper around
rake:
$ cat run-rake
#! /bin/sh
DB=`pwd`/db/pgdata
# init database cluster if it does not exist yet
[ -d $DB ] || initdb -D$DB
# start the database server
pg_ctl -D$DB -o "-h '''' -k $DB" -l postgreslog
start
# wait for it to accept connections
sleep 1
# run rake with original arguments
rake "$*"
# we''re done, stop database server again
pg_ctl -D$DB -o "-h '''' -k $DB" -l postgreslog
stop
But this doesn''t "feel" like RoR, So I''d like to
integrate it into rake, so
I can say "rake foobar" instead of "run-rake foobar"
Any hints?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.