From: Pistos Christou Date: 2006-04-07T00:40:46+09:00 Subject: Re: Rake: Making "cleanup" task Jim Weirich wrote: >> Is this possible? If so, how? :) > > There's no direct way to do this in Rake task, but you can always wrap > your task in begin/ensure/end yourself. > > For example: > > task :test do > begin > ruby 'test_example.rb' > ensure > puts "OK" > end > end > > will always print "OK", even if the tests fail. Unfortunately, the > built-in test task does not have any hooks for this, but it its not hard > to roll your own in this case. /me nods. At the moment, I have a wrapper script which calls rake [args, if any] rake cleanup_task It's too bad Rake can't do this [yet]. :\ Pistos -- Posted via http://www.ruby-forum.com/.