Created
January 12, 2009 01:22
-
-
Save Lytol/45845 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails template for a basic project assuming the following: | |
# | |
# - MySQL for the DB | |
# - Git for version control | |
# | |
# Example: rails myapp -d mysql -m RailsTemplate.rb | |
# | |
# Author: Brian Smith ([email protected]) | |
# | |
# Actions: | |
# | |
# - Rename README to README.md | |
# - Remove public/index.html and public/images/rails.png | |
# | |
# - Create config/database.yml with development and test db's (mysql) | |
# - Copy config/database.yml{,-example} | |
# - Add config/database.yml to gitignore | |
# | |
# - Init git repo | |
# - Initial commit | |
run "rm public/index.html" | |
run "rm public/images/rails.png" | |
run "rm public/favicon.ico" | |
run "mv README README.md" | |
File.open("config/database.yml-example","w") do |f| | |
f.write <<-EOF | |
development: | |
adapter: mysql | |
database: #{app_name}_dev | |
test: | |
adapter: mysql | |
database: #{app_name}_test | |
EOF | |
end | |
run "cp config/database.yml-example config/database.yml" | |
rake "db:create:all" | |
rake "db:migrate" | |
# Git Setup | |
# | |
File.open(".gitignore","w") do |f| | |
f.write <<-EOF | |
.DS_Store | |
.bundle | |
log/*.log | |
tmp/**/* | |
config/database.yml | |
doc/api | |
doc/app | |
EOF | |
end | |
git :init | |
git :add => "." | |
git :commit => "-a -m 'Initial commit'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment