Skip to content

Instantly share code, notes, and snippets.

@lorennorman
Created September 26, 2009 20:03
Show Gist options
  • Save lorennorman/194395 to your computer and use it in GitHub Desktop.
Save lorennorman/194395 to your computer and use it in GitHub Desktop.
A Rails template for a bare bones, but checked in, install. Used this as a starting point and add your favorite gems, scripts, and libraries.
# Basic Rails project, default files cleaned up and checked into Git
# Partly taken from: http://github.com/jeremymcanally/rails-templates/blob/master/newgit.rb
# Use it like this:
# rails your_app_name -m http://gist.github.com/194395.txt
# rails:rm_tmp_dirs
["./tmp/pids", "./tmp/sessions", "./tmp/sockets", "./tmp/cache"].each do |f|
run("rmdir ./#{f}")
end
# Remove unnecessary Rails files
run 'rm README'
run 'rm public/index.html'
run 'rm public/favicon.ico'
run 'rm public/images/rails.png'
# Freeze our Rails gems
rake "rails:freeze:gems"
# git:hold_empty_dirs
run("find . \\( -type d -empty \\) -and \\( -not -regex ./\\.git.* \\) -exec touch {}/.gitignore \\;")
# git:rails:new_app
git :init
file '.gitignore', <<-CODE
log/*.log
log/*.pid
db/*.db
db/*.sqlite3
db/schema.rb
tmp/**/*
.DS_Store
doc/api
doc/app
config/database.yml
CODE
run "cp config/database.yml config/database.yml.sample"
git :add => "."
git :commit => "-a -m 'A fresh Rails checkout! Make sure to copy config/database.yml.sample to config/database.yml'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment