Ruby Findings

digging for gems

Subversion setup rake task for rails

Posted by Bill Marquette Wed, 05 Sep 2007 21:16:00 GMT

Found this nice little rake task to setup your rails app in a new subversion repository over at DZone Snippets the other day.

desc "Configure Subversion for Rails"
task :configure_for_svn do
  system "svn remove log/*"
  system "svn commit -m 'removing all log files from subversion'"
  system 'svn propset svn:ignore "*.log" log/'
  system "svn update log/"
  system "svn commit -m 'Ignoring all files in /log/ ending in .log'"
  system 'svn propset svn:ignore "*.db" db/'
  system "svn update db/"
  system "svn commit -m 'Ignoring all files in /db/ ending in .db'"
  system "svn move config/database.yml config/database.example"
  system "svn commit -m 'Moving database.yml to database.example to provide a template for anyone who checks out the code'"
  system 'svn propset svn:ignore "database.yml" config/'
  system "svn update config/"
  system "svn commit -m 'Ignoring database.yml'"
  system "svn remove tmp/*"
  system "svn commit -m 'Removing /tmp/ folder'"
  system 'svn propset svn:ignore "*" tmp/'
end

desc "Add new files to subversion"
task :add_new_files do
   system "svn status | grep '^\?' | sed -e 's/? *//' | sed -e 's/ /\ /g' | xargs svn add"
end

desc "shortcut for adding new files"
task :add => [ :add_new_files ]

Posted in | no comments | Tags , | atom

Trackbacks

Use the following link to trackback from your own site:
http://www.rubyfindings.com/trackbacks?article_id=subversion-setup-rake-task-for-rails&day=05&month=09&year=2007

Comments

Leave a response

Leave a comment