Created
September 2, 2011 15:42
-
-
Save douhashi/1188958 to your computer and use it in GitHub Desktop.
my application template for rails 3.x
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
#################################################### | |
# | |
# Name: rails application template | |
# Author: douhashi | |
# Usage: | |
# rails new your_app_name [-d mysql] -T --skip-bundle -m https://raw.github.com/gist/1188958 | |
# | |
#################################################### | |
inject_into_file 'Gemfile', :after => "# gem 'debugger'" do | |
<<-GEMFILE | |
# VIEW AND CSS | |
gem "twitter-bootstrap-rails" | |
gem 'simple_form', '~> 2.0.0' | |
gem 'kaminari' | |
# DEVELOP AND TESTING ##################### | |
group :development, :test do | |
gem "rspec-rails", "~> 2.0" | |
gem 'spork' | |
gem "rails3-generators", :git => "https://github.com/neocoin/rails3-generators.git" | |
end | |
gem 'factory_girl_rails' | |
# DEPLOY ################################## | |
group :development do | |
gem "capistrano" | |
gem "capistrano-ext" | |
gem "capistrano_colors" | |
gem 'capistrano_rsync_with_remote_cache' | |
gem 'rvm-capistrano' | |
end | |
# Use unicorn as the app server | |
gem 'unicorn' | |
GEMFILE | |
end | |
### copy thor task | |
# get "https://raw.github.com/gist/1189753", "lib/tasks/setup.thor" | |
### clean up rails | |
remove_file 'public/index.html' | |
remove_file 'public/images/rails.png' | |
run 'cp config/database.yml config/database.yml.example' | |
run "echo 'config/database.yml' >> .gitignore" | |
run "echo '.DS_Store' >> .gitignore" | |
### git | |
#git :init | |
#git :add => "." | |
#git :commit => "-a -m 'create initial application'" | |
docs = <<-DOCS | |
Run the following commands to complete the setup of #{app_name.humanize}: | |
$ cd #{app_name} | |
$ rvm use --create --rvmrc default@#{app_name} | |
$ gem install bundler | |
$ bundle install | |
$ thor setup:all | |
DOCS | |
say docs, Thor::Shell::Color::YELLOW |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment