Skip to content

Instantly share code, notes, and snippets.

@cfcosta
Created April 13, 2010 17:43
Show Gist options
  • Save cfcosta/364864 to your computer and use it in GitHub Desktop.
Save cfcosta/364864 to your computer and use it in GitHub Desktop.
#encoding: utf-8
# GIT configuration
git :init
git :add => '.', :commit => %(-m "Initial Commit")
append_file '.gitignore', "*~"
append_file '.gitignore', "\n#*#"
append_file '.gitignore', "\n*.swp"
append_file '.gitignore', "\nnbproject"
# Project tidying
run 'rm public/index.html'
run 'rm -rf doc README'
# Fixes :)
if RUBY_VERSION.to_f >= 1.9
gsub_file 'Gemfile', /sqlite3-ruby/, 'sqlite3'
end
# Dependencies
gem 'rspec-rails', '>= 2.0.0.beta.1'
gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
gem 'database_cleaner', :git => 'git://github.com/bmabey/database_cleaner.git'
gem 'cucumber-rails', :git => 'git://github.com/aslakhellesoy/cucumber-rails.git'
gem 'devise', '>= 1.1.rc0'
run 'bundle install'
# Gem configurations
generate 'rspec:install'
generate :cucumber, '--rspec --capybara'
generate :devise_install
gsub_file 'config/environments/development.rb', /^end\n/, " config.action_mailer.default_url_options = { :host => 'localhost:3000' }\nend"
generate :devise_views
generate :devise, 'User'
# Application setup
generate :controller, 'homepage'
route %(root :to => "homepage#index")
file '.rvmrc', 'rvm ruby-1.9.1'
initializer 'monkey_patching.rb', <<-CODE
class Object
def not_nil?
!nil?
end
def not_blank?
!blank?
end
end
class Array
def not_empty?
!empty?
end
end
CODE
git :add => '.', :commit => %(-a -m "Automatic project tidying and setup")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment