Created
February 20, 2009 19:25
-
-
Save peterberkenbosch/67644 to your computer and use it in GitHub Desktop.
This file contains 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
# Link to local copy of edge rails | |
inside('vendor') { run 'ln -s ~/dev/rails rails' } | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/robots.txt" | |
run "rm public/images/rails.png" | |
run "rm -f public/javascripts/*" | |
# Download JQuery | |
#run "curl -s -L http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js > public/javascripts/jquery.js" | |
#run "curl -s -L http://jqueryjs.googlecode.com/svn/trunk/plugins/form/jquery.form.js > public/javascripts/jquery.form.js" | |
# Set up git repository | |
git :init | |
git :add => '.' | |
# Copy database.yml for distribution use | |
run "cp config/database.yml config/database.yml.example" | |
# Set up .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 | |
#Install the plugins | |
plugin 'shoulda', :git => 'git://github.com/thoughtbot/shoulda.git', :submodule => true | |
plugin 'factory_girl_on_rails', :git => 'git://github.com/technicalpickles/factory_girl_on_rails.git', :submodule => true | |
plugin 'hoptoad_notifier', :git => 'git://github.com/thoughtbot/hoptoad_notifier.git', :submodule => true | |
plugin 'jrails', :svn => 'http://ennerchi.googlecode.com/svn/trunk/plugins/jrails' | |
plugin 'shoulda_generator', :git => 'git://github.com/technicalpickles/shoulda_generator.git', :submodule => true | |
# Install all gems | |
gem 'thoughtbot-factory_girl', :lib => 'factory_girl', :source => 'http://gems.github.com' | |
rake('gems:install', :sudo => true) | |
# Initialize submodules | |
git :submodule => "init" | |
# Set up session store initializer | |
initializer 'session_store.rb', <<-END | |
ActionController::Base.session = { :session_key => '_#{(1..6).map { |x| (65 + rand(26)).chr }.join}_session', :secret => '#{(1..40).map { |x| (65 + rand(26)).chr }.join}' } | |
ActionController::Base.session_store = :active_record_store | |
END | |
rake('db:sessions:create') | |
rake('db:migrate') | |
# Commit all work so far to the repository | |
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