Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Peter Cooperx http://www.petercooper.co.uk/

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Useful Rake tasks for Subversion setup with Rails

This was originally written by Jake at http://blog.unquiet.net/archives/2005/11/06/helpful-rake-tasks-for-using-rails-with-subversion/ .. but that site seems not to be showing content properly, so I salvaged this from the Google cache. I also added two new lines to make it remove /tmp folder which is now in Rails.

Just dump this into a file called svn.rake in your lib/tasks folder, and use rake configure_for_svn to sort everything out on your initial check out:

   1  desc "Configure Subversion for Rails"
   2  task :configure_for_svn do
   3    system "svn remove log/*"
   4    system "svn commit -m 'removing all log files from subversion'"
   5    system 'svn propset svn:ignore "*.log" log/'
   6    system "svn update log/"
   7    system "svn commit -m 'Ignoring all files in /log/ ending in .log'"
   8    system 'svn propset svn:ignore "*.db" db/'
   9    system "svn update db/"
  10    system "svn commit -m 'Ignoring all files in /db/ ending in .db'"
  11    system "svn move config/database.yml config/database.example"
  12    system "svn commit -m 'Moving database.yml to database.example to provide a template for anyone who checks out the code'"
  13    system 'svn propset svn:ignore "database.yml" config/'
  14    system "svn update config/"
  15    system "svn commit -m 'Ignoring database.yml'"
  16    system "svn remove tmp/*"
  17    system "svn commit -m 'Removing /tmp/ folder'"
  18    system 'svn propset svn:ignore "*" tmp/'
  19  end
  20     
  21  desc "Add new files to subversion"
  22  task :add_new_files do
  23     system "svn status | grep '^\?' | sed -e 's/? *//' | sed -e 's/ /\ /g' | xargs svn add"
  24  end
  25  
  26  desc "shortcut for adding new files"
  27  task :add => [ :add_new_files ]
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS