Skip to content

Instantly share code, notes, and snippets.

@Psli
Created May 5, 2011 06:42
Show Gist options
  • Save Psli/956645 to your computer and use it in GitHub Desktop.
Save Psli/956645 to your computer and use it in GitHub Desktop.
rails 3.1 m
# remove files
run "rm README"
run "rm public/index.html"
run "rm app/assets/images/rails.png"
run "cp config/database.yml config/database.yml.example"
# install gems
run "rm Gemfile"
run "curl -L https://gist.github.com/956650.txt > Gemfile"
# bundle install
run "bundle install"
gsub_file 'config/application.rb', /(config.generators.test_framework = false)/,
"config.generators.test_framework = :rspec"
# generate rspec
generate "rspec:install"
# copy files
run "curl -L https://github.com/Psli/rails3-app-template/raw/master/watchr.rb > script/watchr.rb"
run "curl -L https://github.com/Psli/rails3-app-template/raw/master/dev.rake > lib/tasks/dev.rake"
# add time format
# environment 'Time::DATE_FORMATS.merge!(:default => "%Y-%m-%d %I:%M %p", :ymd => "%Y-%m-%d")'
# .gitignore
append_file '.gitignore', <<-CODE
config/database.yml
*.tmproj
cmd.txt
Thumbs.db
.DS_Store
tmp/*
coverage/*
.sass-cache
CODE
# keep tmp and log
run "touch tmp/.gitkeep"
run "touch log/.gitkeep"
# git commit
git :init
git :add => '.'
git :add => 'tmp/.gitkeep -f'
git :add => 'log/.gitkeep -f'
git :commit => "-a -m 'init'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment