Skip to content

Instantly share code, notes, and snippets.

@blueplanet
Last active December 19, 2015 17:49
Show Gist options
  • Save blueplanet/5994259 to your computer and use it in GitHub Desktop.
Save blueplanet/5994259 to your computer and use it in GitHub Desktop.
Rails application template with Rails 4.0
# gems
gem 'slim-rails'
gem 'bootstrap-sass'
gem 'thin'
gem_group :development, :test do
gem 'rspec-rails'
gem 'launchy'
end
gem_group :development do
gem 'guard-rspec'
gem 'guard-livereload'
gem 'rack-livereload'
gem 'growl'
gem 'pry-rails'
gem 'spring', '~> 1.0.0'
end
gem_group :test do
gem "shoulda-matchers"
gem 'factory_girl_rails'
gem 'database_cleaner', '~> 1.0.1'
gem 'faker'
gem 'capybara'
end
run "bundle install"
# execute generate
generate "rspec:install"
inject_into_file 'spec/spec_helper.rb', after: " config.order = ""random""\n" do <<-'RUBY'
config.before(:all) do
FactoryGirl.reload
end
RUBY
end
run 'bundle exec guard init livereload'
run 'bundle exec guard init rspec'
gsub_file 'Guardfile', /^guard \:rspec do$/, 'guard :rspec, cmd: "spring rspec" do'
# application generators customize
application <<-APPEND_APPLICATION
config.generators do |g|
g.stylesheets false
g.helper false
g.view_specs false
g.assets false
end
APPEND_APPLICATION
# git init
git :init
git add: "."
git commit: "-m 'Init commit'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment