Ruby script for creating a rails app

Posted by topher
on Thursday, June 21

A few months ago I saw this ruby script by Akhil Bansal which creates a rails app and imports it to svn, ignoring and removing files like database.yml, tmp directory and log files.

I modified it to use the trunk, tags, and branches directories and updated some of the code. Here’s what the script does:
  • create a rails app in your local machine
  • create trunk, tags and branches directories in the svn repository
  • svn import the rails app
  • delete the app in your local machine
  • check out from svn
  • remove log files from svn
  • ignore log files
  • ignore tmp directory
  • remove tmp directory from svn
  • move database.yml to database.yml.sample
  • ignore database.yml

Download the script here.

Run it with “ruby create_rails_with_subversion.rb” on the command line. You need svn installed on your local machine and a subversion repository.