Skip to content

Instantly share code, notes, and snippets.

@benschwarz
Created July 8, 2009 03:16
Show Gist options
  • Save benschwarz/142536 to your computer and use it in GitHub Desktop.
Save benschwarz/142536 to your computer and use it in GitHub Desktop.
# Rails app generator
# Remove unnecessary Rails files
run 'rm README'
run 'rm public/index.html'
run 'rm public/favicon.ico'
run 'rm public/images/rails.png'
# Copy database.yml
run 'cp config/database.yml config/database.yml.example'
rake 'db:create:all'
rake 'db:migrate' # Allows tests to be run straight away
# Environment, deps
gem 'rubyist-aasm', :lib => 'aasm', :source => 'http://gems.github.com'
gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com'
plugin 'authlogic', :git => 'git://github.com/binarylogic/authlogic.git'
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git'
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git'
# Test environment, deps
gem 'sevenwire-forgery', :lib => 'forgery', :source => 'http://gems.github.com', :env => 'test'
gem 'fakeweb', :version => '1.2.4', :env => 'test'
gem 'rspec', :lib => false, :version => ">=1.2.6", :env => 'test'
gem 'rspec-rails', :lib => 'spec/rails', :version => ">=1.2.6", :env => 'test'
gem 'remarkable_rails', :lib => false, :env => 'test'
gem 'notahat-machinist', :source => "http://gems.github.com", :env => 'test'
gem 'cucumber', :env => 'test'
rake 'gems:install'
rake 'gems:install', :env => 'test'
rake 'gems:unpack:dependencies'
# Run generators
generate 'rspec'
generate 'cucumber'
append_file 'spec/spec_helper.rb' <<-EOS.gsub(/^ /, '')
require 'remarkable_rails'
require 'fakeweb'
FakeWeb.allow_net_connect = false
require File.dirname(__FILE__) + '/blueprints'
EOS
file 'spec/blueprints.rb', <<-EOS.gsub(/^ /, '')
require 'machinist/active_record'
require 'sham'
require 'forgery'
EOS
# Create .gitignore file
file '.gitignore', <<-FILE
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
FILE
# Set up git repository
git :init
git :add => '.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment