Skip to content

Instantly share code, notes, and snippets.

@simonrobson
Created September 21, 2009 02:51
Show Gist options
  • Save simonrobson/190042 to your computer and use it in GitHub Desktop.
Save simonrobson/190042 to your computer and use it in GitHub Desktop.
Rails template with git setup
# Basic rails template w/git setup. Slightly adapetd from...
# newgit.rb
# from Joao Vitor
# via http://github.com/jeremymcanally/rails-templates
# rails:rm_tmp_dirs
["./tmp/pids", "./tmp/sessions", "./tmp/sockets", "./tmp/cache"].each do |f|
run("rmdir ./#{f}")
end
# 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/*
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 'Initializing new app'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment