Rails application creation – script

I was recently starting many new Rails application. I was doing some tests, and I needed setup new Rails applications ready to run with Subversion. I’m a lazy person (for most IT folks it is a huge advantage ;)) ) so I wrote script to automate this task.

Now I want to share with my work. What this script does? It asks about Rails application name and Subversion repository root (I assume repository will be stored locally on file system). Next, in current directory:

  • creates Subversion repository under given root with chosen project name
  • generates Rails application and makes it local copy of svn repository
  • prepares Subversion tags like svn:ignore for logs and temporary files and commits all changes
  • asks whether fetch my Rake task to handle commits of all changes on later stage

Usage:

 ./svninit.sh | tee outp.txt

I was using suggestions from Ruby on Rails Wiki. I tried to remember make all needed checks to avoid any mess, but test it in Your environment, before using it in production ;-)) Rake addon to handle all Subversion task on later stage is described in this blog entry: https://nhw.pl/wp/2006/08/05/yet-another-rake-and-subversion-task/

As usual script was developed on FreeBSD, so all path to binaries are specific to this platform, but You can easily adjust it to Your needs.

And finally script can be fetched from http://nhw.pl/download/svninit.sh

UPDATE (29.08.2006)
I was too tired, and made one mistake – after fetching svn task for rake, I did not merged properly old Rakefile with patch. Now script is corrected. I hope I made no more major errors in it…

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.