Skip to content

Instantly share code, notes, and snippets.

@bkeepers
Created May 19, 2009 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkeepers/113874 to your computer and use it in GitHub Desktop.
Save bkeepers/113874 to your computer and use it in GitHub Desktop.
PLUGINS = {
'rspec' => 'git://github.com/dchelimsky/rspec.git',
'rspec-rails' => 'git://github.com/dchelimsky/rspec-rails.git',
'rspec-on-rails-matchers' => 'git://github.com/brandon/rspec-on-rails-matchers.git',
'awesomeness' => 'git://github.com/collectiveidea/awesomeness.git',
'awesome-backup' => 'git://github.com/collectiveidea/awesome-backup.git',
'exception_notification' => 'git://github.com/collectiveidea/exception_notification.git',
'action_mailer_optional_tls' => 'git://github.com/collectiveidea/action_mailer_optional_tls.git',
'cucumber' => 'git://github.com/aslakhellesoy/cucumber.git',
'webrat' => 'git://github.com/brynary/webrat.git',
'annotate_models' => 'git://github.com/collectiveidea/annotate_models.git',
'factory_girl' => 'git://github.com/thoughtbot/factory_girl.git'
}
rails_dir = File.expand_path('~/.rails')
if File.exists?(rails_dir)
inside rails_dir do
run "git checkout master"
run "git pull origin master"
end
else
run "git clone git://github.com/rails/rails.git #{rails_dir}"
end
run "rm -r test README public/index.html log/*.log public/images/rails.png"
run "cp config/database.{,sample.}yml"
file '.gitignore', %w(
config/database.yml
tmp/*
log/*.log
db/*.sqlite3
.DS_Store
.rake_tasks
backups
coverage
) * "\n"
git :init
run "touch {tmp,log}/.gitignore"
git :add => '.'
git :add => '-f tmp/.gitignore'
git :commit => "-a -m 'Initial Rails app'"
in_root do
run "cp -r ~/.rails vendor/rails"
git :submodule => "add git://github.com/rails/rails.git vendor/rails"
rake "rails:update"
git :commit => "-m 'Added Rails as a submodule'"
end
PLUGINS.each do |name,repo|
plugin name, :git => repo, :submodule => true
git :commit => "-am 'Added #{repo} as a submodule'"
end
generate 'rspec'
git :add => '.'
git :commit => "-m 'Generated RSpec'"
generate 'cucumber'
git :add => '.'
git :commit => "-m 'Generated Cucumber'"
load_template File.expand_path("~/.rails_template.rb")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment