namespace :svn do desc "Update everything before the tests" task :update do puts "Updating from svn repository... Please wait..." system "svn update" end desc "Run all tests, if all are OK, then commit everything to the svn repository" task :commit => [:check_modifications, :update, :test] do puts "No test failures, now we can commit it all..." param = "-m \"#{ARGV[1]}\"" if ARGV[1] exec "svn commit #{param}" end task :check_modifications do raise "There's nothing to commit!" if `svn diff`.length == 0 end end desc "Alias for the svn:commit task" task :commit => "svn:commit"