# This Rails 2.3.x template will create a new git-based Rails project
# with Cucumber, RSpec and Remarkable pre-installed and ready to go.
#
# (C) 2009 under the MIT License by Ariejan de Vroom <ariejan@ariejan.net>
#
# USAGE:
# rails -d mysql -m http://gist.github.com/181167.txt APP_NAME
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
run "rm -f public/javascripts/*"
# Set up git repository
git :init
# Copy database.yml for distribution use
run "cp config/database.yml config/database.yml.example"
# Create the database, if necessary
run "rake db:create:all"
# 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
.DS_Store
log/*.log
tmp/**/*
tmp/restart.txt
config/database.yml
db/*.sqlite3
END
# Install gems
gem 'settingslogic'
gem 'factory_girl', :lib => false, :source => 'http://gemcutter.org'
gem 'remarkable_rails', :lib => false
gem 'remarkable_activerecord', :lib => false
gem 'cucumber', :lib => false
gem 'rspec', :lib => false
gem 'rspec-rails', :lib => false
gem 'haml'
# Plugins
plugin 'bootstrapper', :git => 'git://github.com/sevenwire/bootstrapper.git'
# Install any missing gems.
rake "gems:install", :sudo => true
# Set up sessions, RSpec and Cucumber
generate "rspec"
generate "cucumber"
# Setup HAML
run "haml --rails ."
# Commit all work so far to the repository
git :add => '.'
git :commit => "-a -m 'Generated new rails project from http://gist.github.com/gists/181167'"
# Success!