Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

74 lines (59 sloc) 1.531 kb
require 'pathname'
def apply(name)
super "#{File.dirname(__FILE__)}/templates/#{name}.rb"
end
# Remove Rails cruft
%w(
README
test
public/index.html
public/favicon.ico
public/robots.txt
public/images/rails.png
).each { |path| remove_file path }
# Create a sensible .rvmrc file
create_file '.rvmrc', <<-EOS
rvm_gemset_create_on_use_flag=1
rvm use 1.9.2@#{app_name}
EOS
# Create custom .gitignore file
create_file '.gitignore', <<-EOS
.bundle
db/*.sqlite3
log/*.log
*.log
tmp/
*.swp
*~
.project
.DS_Store
config/database.yml
EOS
# Add my favourite gems to Gemfile
apply 'gems'
# Add Guardfile
apply 'guardfile'
# MySQL configuration
apply 'database_config'
run "cp config/database.yml config/database.yml.sample"
# Keep these directories even though we ignore what's in them
create_file 'log/.gitkeep'
create_file 'tmp/.gitkeep'
run "rvm gemset create #{app_name}"
run "rvm use 1.9.2@#{app_name}"
run 'gem install bundler && bundle install'
# Setup RSpec/Capybara
generate 'rspec:install'
run "mkdir -p spec/support spec/models spec/routing"
# Tweak spec_helper to use capybara-webkit
insert_into_file "spec/spec_helper.rb", "require 'capybara/rspec'\n\nCapybara.javascript_driver = :webkit\n", :after => "require 'rspec/rails'\n"
# Run miscellaneous generators
generate 'jquery:install'
generate 'friendly_id'
generate 'simple_form:install'
# Initialise devise and User model
generate 'devise:install'
generate 'devise User'
apply 'factories'
git :init
git :add => ".", :commit => "-m 'Initial commit.'"
Jump to Line
Something went wrong with that request. Please try again.