Skip to content

Instantly share code, notes, and snippets.

@karmi
Created August 26, 2009 13:35
Show Gist options
  • Save karmi/175510 to your computer and use it in GitHub Desktop.
Save karmi/175510 to your computer and use it in GitHub Desktop.
Minimal Rails app template (Git setup, Gems)
# Delete/Move Rails default files
log 'moving', 'Rails default files'
run "mv README doc/README_FOR_RAILS"
run "rm public/index.html"
# Copy database.yml
log "copying", "database.yml"
run "cp config/database.yml config/database.example.yml"
# Set up .gitignore files
log 'creating', '.gitignore files'
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore"
file '.gitignore', <<-END
.DS_Store
*/.DS_Store
log/*
!log/.gitignore
tmp/**/*
!tmp/.gitignore
config/database.yml
db/*.sqlite3
doc/**/*
public/system/**/*
END
# Set up git repository
log 'initializing', 'Git repository'
git :init
git :add => '.'
git :commit => "-a -m 'Initial commit -- Blank Rails application'"
# Install Rubygems
log 'configure', 'rubygems'
gem 'sqlite3-ruby', :lib => 'sqlite3'
gem 'thoughtbot-factory_girl', :lib => 'factory_girl', :source => 'http://gems.github.com'
gem 'thoughtbot-shoulda', :lib => 'shoulda', :source => 'http://gems.github.com'
git :add => '.'
git :commit => "-m 'Added gems configuration'"
# Create bootstrap Rake tasks
log 'creating', 'bootstrap Rake tasks'
rakefile "bootstrap.rake", <<CODE
namespace :app do
task :bootstrap do
end
task :install do
end
end
CODE
git :add => '.'
git :commit => "-m 'Created bootstrap tasks'"
log ' *** ALL DONE ***'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment