Skip to content

Instantly share code, notes, and snippets.

@kaichen
Created March 18, 2009 12:40
Show Gist options
  • Save kaichen/81097 to your computer and use it in GitHub Desktop.
Save kaichen/81097 to your computer and use it in GitHub Desktop.
# base.rb
# rails2p3 app template
# from Kai Chen
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
# Copy database.yml for distribution use
run "cp config/database.yml config/database.yml.example"
# Install blueprint css framework
run "wget http://github.com/joshuaclayton/blueprint-css/tarball/master; tar xvf *blueprint*; cp -r *blueprint*/blueprint/* public/stylesheets;rm -rf *blueprint*"
# 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
*~
*.swp
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
db/*.db
END
file 'TODO', <<-END
ADD ...
END
file 'README', <<-END
new rails app
END
# Git initialize
git :init
git :add => '.'
# Install submoduled plugins
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git', :submodule => true
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git', :submodule => true
plugin 'asset_packager', :git => 'git://github.com/sbecker/asset_packager.git', :submodule => true
plugin 'role_requirement', :git => 'git://github.com/timcharper/role_requirement.git', :submodule => true
plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git', :submodule => true
plugin 'state_machine', :git => 'git://github.com/pluginaweek/state_machine.git', :submodule => true
plugin 'exception_notifier', :git => 'git://github.com/rails/exception_notification.git', :submodule => true
plugin 'nifty-generators', :git => 'git://github.com/ryanb/nifty-generators.git', :submodule => true
plugin 'jrails', :svn => "http://ennerchi.googlecode.com/svn/trunk/plugins/jrails"
# Install all gems
gem 'thoughtbot-factory_girl', :lib => 'factory_girl', :source => 'http://gems.github.com'
gem 'sqlite3-ruby', :lib => 'sqlite3'
gem 'mysql', :lib => 'mysql'
gem 'RedCloth'
gem 'mocha'
gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com'
gem "mbleigh-acts-as-taggable-on", :source => "http://gems.github.com", :lib => "acts-as-taggable-on"
rake 'gems:install', :sudo => true
# Set up sessions, RSpec, user model, OpenID, etc, and run migrations
rake 'db:sessions:create'
generate "authenticated", "user session"
generate "roles", "Role User"
generate "rspec"
generate "acts_as_taggable_on_migration"
generate 'nifty_layout'
rake 'db:migrate'
rake 'jrails:install:javascripts'
generate "controller", "home index about help"
route "map.root :controller => 'home'"
route "map.about '/about', :controller => 'home', :action => 'about'"
route "map.help '/help', :controller => 'home', :action => 'help'"
# Initialize submodules
git :submodule => "init"
# Commit all work so far to the repository
git :add => '.'
git :commit => "-a -m 'Initial commit'"
# Success!
puts "DONE!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment