Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danieljohnmorris/398936 to your computer and use it in GitHub Desktop.
Save danieljohnmorris/398936 to your computer and use it in GitHub Desktop.
r3 app tpl - obvious stuff ie. remove public.html etc
# usage (in app dir):
# rake rails:template LOCATION=http://gist.github.com/398938.txt
# make a sensible gitignore
file ".gitignore", <<-EOF
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
db/schema.rb
EOF
# Stub readme file
run "echo TODO > README"
# get rid of logs before adding files to git
run "rm log/*.log"
# setup git repo, make sure some folders ignored, and move db.yml to sample conf (leaving actual unversioned)
git :init
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore .bundle/.gitignore"
run "cp config/database.yml config/example_database.yml"
git :add => ".", :commit => "-m 'initial commit.'"
# TODO - Could move home controller into an optional 'yes?' block, or make the name assigned through 'ask'
# setup initial controller & remove public.html
generate :controller, "home index"
route "map.root :controller => 'home'"
git :rm => "public/index.html"
git :add => ".", :commit => "-m 'adding home controller.'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment