Last active
February 24, 2021 05:39
-
-
Save soruma/1cd9080310ae67076a23c86dc9a677f6 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
# frozen_string_literal: true | |
# using: `rails new . -m <this-file-url>` | |
gem_group :development, :test do | |
gem 'factory_bot_rails' | |
gem 'guard-rspec', require: false | |
gem 'guard-rubocop', require: false | |
gem 'rspec-rails' | |
gem 'rubocop-rails' | |
gem 'rubocop-rspec' | |
gem 'simplecov', require: false | |
end | |
gem 'rails-i18n', '~> 6.0.0' | |
gem 'slim-rails' | |
remove_dir 'test' | |
file '.rubocop.yml', <<~CODE | |
require: rubocop-rails | |
AllCops: | |
NewCops: enable | |
Exclude: | |
- bin/* | |
- db/schema.rb | |
- log/**/* | |
- node_modules/**/* | |
- tmp/**/* | |
- vendor/bundle/**/* | |
Layout/LineLength: | |
Max: 120 | |
Exclude: | |
- Gemfile | |
Metrics/BlockLength: | |
Exclude: | |
- Guardfile | |
- spec/**/* | |
Style/Documentation: | |
Enabled: false | |
CODE | |
application <<-APPEND_APPLICATION | |
config.generators do |generate| | |
generate.javascripts false | |
generate.stylesheets false | |
generate.helper false | |
generate.assets false | |
generate.test_framework :rspec, | |
fixture: true, | |
view_specs: false, | |
helper_specs: false, | |
routing_specs: false, | |
controller_specs: true, | |
request_specs: true | |
generate.fixture_replacement :factory_bot, dir: 'spec/factories' | |
end | |
APPEND_APPLICATION | |
after_bundle do | |
run 'bin/spring stop' # deal with the problem that rspec hangs up | |
generate 'rspec:install' | |
run 'bundle exec guard init rspec' | |
run 'bundle exec guard init rubocop' | |
run 'trap "bundle exec rubocop -A" 0' | |
git :init | |
git commit: %(--allow-empty -m 'Initial commit') | |
git add: '.' | |
git commit: %(-m 'First commit') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment