-
-
Save thedersen/576053 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove stuff we don't want | |
run "rm public/index.html" | |
run "rm public/images/rails.png" | |
# Add jQuery | |
run "curl http://code.jquery.com/jquery-1.4.2.min.js > public/javascripts/jquery-1.4.2.min.js" | |
run "curl http://github.com/rails/jquery-ujs/raw/master/src/rails.js > public/javascripts/rails.js" | |
# Create a readme file | |
run "echo TODO: Explain yourself! > README.md" | |
# Required gems | |
gem "mongo_mapper" | |
gem "bson_ext" | |
# Testing gems | |
gem "rspec", :group => :test, :spec, :cucumber | |
gem "rspec-rails", :version => ">= 2.0.0.beta.20", :group => :test, :spec, :cucumber | |
gem "database_cleaner", :group => :test, :spec, :cucumber | |
gem 'capybara', :group => :test, :spec, :cucumber | |
gem 'cucumber-rails', :group => :test, :spec, :cucumber | |
gem 'cucumber', :group => :test, :spec, :cucumber | |
gem 'spork', :group => :test, :spec, :cucumber | |
gem 'launchy', :group => :test, :spec, :cucumber | |
run "bundle install" | |
# MongoDB | |
db_name = ask('What should I call the database? ') | |
initializer 'database.rb', <<-CODE | |
logger = Logger.new("log/mongodb-\#{Rails.env}.log") | |
MongoMapper.connection = Mongo::Connection.new('127.0.0.1', 27017, :logger => logger) | |
MongoMapper.database = "#{db_name}-\#{Rails.env}" | |
CODE | |
run "rails g rspec:install" | |
file 'spec/spec_helper.rb', <<-CODE | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment')) | |
require 'spec' | |
require 'spec/rails' | |
require 'database_cleaner' | |
Spec::Runner.configure do |config| | |
config.mock_with :rspec | |
config.fixture_path = "\#{::Rails.root}/spec/fixtures" | |
config.before(:suite) do | |
DatabaseCleaner.strategy = :truncation | |
end | |
config.after(:each) do | |
DatabaseCleaner.clean | |
end | |
end | |
CODE | |
run "rails g cucumber:install --capybara --rspec --skip-database" | |
# Source control | |
file '.gitignore', <<-FILES | |
.DS_Store | |
**/.DS_Store | |
log/* | |
tmp/* | |
tmp/**/* | |
config/database.yml | |
coverage/* | |
coverage/**/* | |
FILES | |
git :init | |
git :add => '.' | |
git :commit => '-am "Initial commit"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment