Skip to content

Instantly share code, notes, and snippets.

@andersondias
Created May 8, 2009 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andersondias/108573 to your computer and use it in GitHub Desktop.
Save andersondias/108573 to your computer and use it in GitHub Desktop.
A rails template
# template.rb
# from Anderson Dias
#====================
# PLUGINS
#====================
# Testing
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git'
plugin 'cucumber', :git => 'git://github.com/aslakhellesoy/cucumber.git'
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git'
plugin 'webrat', :git => 'git://github.com/brynary/webrat.git'
# Others
plugin 'hoptoad_notifier', :git => 'git://github.com/thoughtbot/hoptoad_notifier.git'
plugin 'asset_packager', :git => 'git://github.com/sbecker/asset_packager.git'
plugin 'squirrel', :git => 'git://github.com/thoughtbot/squirrel.git'
plugin 'i18n_label', :git => 'git://github.com/iain/i18n_label.git'
plugin 'aasm', :git => 'git://github.com/rubyist/aasm.git'
plugin 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git'
plugin 'formtastic', :git => 'git://github.com/justinfrench/formtastic.git'
plugin 'dry-scaffold', :git => 'git://github.com/grimen/dry_scaffold.git'
plugin 'inherited_resources', :git => 'git://github.com/josevalim/inherited_resources.git'
#====================
# GEMS
#====================
# Testing
if yes?('Do you want to use machinist instead of factory_girl?')
gem 'notahat-machinist ', :source => 'http://gems.github.com'
else
gem 'thoughtbot-factory_girl', :source => 'http://gems.github.com'
end
gem 'remarkable_rails'
gem 'rcov'
gem 'warden', :source => 'http://gemcutter.org/'
gem 'device', :source => 'http://gemcutter.org/'
# Others
plugin 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git'
gem 'thoughtbot-pacecar', :source => 'http://gems.github.com'
gem 'haml'
gem 'anderson-nifty-generator', :source => 'http://gems.github.com'
# ====================
# TEST
# ====================
inside ('test') do
run 'mkdir factories'
end
# ====================
# FINALIZE
# ====================
# Delete unnecessary files
run 'rm README'
run 'rm public/index.html'
run 'rm public/robots.txt'
run 'rm public/favicon.ico'
run 'rm public/images/rails.png'
run 'rm -f public/javascripts/*'
# Initialize app
run 'haml . --rails'
rake('gems:install', :sudo => true)
rake('gems:unpack')
generate :nifty_scaffold
generate :rspec
generate :cucumber
generate :authenticated, 'user session'
generate :roles, 'Role User'
# Git
file '.gitignore', <<-GITIGNORE
log/\\*.log
log/\\*.pid
db/\\*.db
db/\\*.sqlite3
db/schema.rb
tmp/\\*\\*/\\*
.DS_Store
ToDo
tmp/**/*
sphinx/*.sp*
coverage
*.swp
**/*.swp
# Other useful tidbits
.DS_Store
doc/api
doc/app
# Config files
config/pa_billing.yml
config/database.yml
# database schema
db/schema.rb
GITIGNORE
run 'find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec touch {}/.gitignore \;'
git :init
git :add => '.'
git :commit => '-a -m "Initial project commit"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment