Skip to content

Instantly share code, notes, and snippets.

@overture8
Created June 1, 2011 19:45
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 overture8/1003130 to your computer and use it in GitHub Desktop.
Save overture8/1003130 to your computer and use it in GitHub Desktop.
Rumble Labs Rails Template
# create rvmrc file
create_file ".rvmrc", "rvm 1.9.2"
gem "simple_form"
gem "devise"
gem "rake", "0.9.1"
run 'bundle install'
rake "db:create", :env => 'development'
rake "db:create", :env => 'test'
generate 'simple_form:install'
# authentication setup
generate "devise:install"
generate "devise User"
generate "devise:views"
rake "db:migrate"
# clean up rails defaults
remove_file 'public/index.html'
remove_file 'rm public/images/rails.png'
run 'cp config/database.yml config/database.example'
run "echo 'config/database.yml' >> .gitignore"
# Before filter for devise auth
inject_into_file 'app/controllers/application_controller.rb', "\n before_filter :authenticate_user!", :after => "protect_from_forgery"
# Create default seed data
append_file 'db/seeds.rb' do
<<-eos
User.create!(:first_name => 'Phil', :last_name => 'McClure', :email => 'pmcclure@rumblelabs.com', :password => 'password')
eos
end
rake "db:seed"
# commit to git
git :init
git :add => "."
git :commit => "-a -m 'create initial application'"
say <<-eos
============================================================================
Your new Rails application is ready to rumble.
eos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment