Skip to content

Instantly share code, notes, and snippets.

@epid
Created March 10, 2010 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epid/327906 to your computer and use it in GitHub Desktop.
Save epid/327906 to your computer and use it in GitHub Desktop.
Base Template for Rails Projects
# Setup git repository
git :init
# Setup .gitignore files
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore"
run %{find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore}
file '.gitignore', <<-END
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
END
run "perl -i -pe 's/UTC/Central Time (US \\& Canada)/' config/environment.rb" if yes?("Change to Central Time?")
run "perl -i -pe 's/^end/\\n # Use old style migration numbering\\n config.active_record.timestamped_migrations = false\\n\\nend/' config/environment.rb" if yes?("Old migration numbering?")
# Remove unnecessary files
run "rm README"
git :add => "."
git :commit => "-m 'Initial commit'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment