rails new --help
to show default configuration options.
Useful options:
-d postgresql
Preconfigure for selected database
-T
Skip test
./
Create app in the current folder. App name, is the name of the folder.
GitHub - rspec/rspec-rails: RSpec for Rails-3+
- Add gem to gemfile &
bundle install
- Initialize the spec/ directory
rails generate rspec:install
- To include rails_helper by default, append to generated .rspec file:
--require rails_helper
- Add gem to gemfile &
bundle install
- Add Relaxed Rubocop (https://relaxed.ruby.style/): Add the following lines to your
.rubocop.yml
:
inherit_from:
https://relaxed.ruby.style/rubocop.yml
- Add more config in
.rubocop.yml
:
inherit_from:
- http://relaxed.ruby.style/rubocop.yml
AllCops:
DisplayStyleGuide: true
DisplayCopNames: true
Exclude:
- 'db/schema.rb'
- 'vendor/**/*'
- 'config/environments/*.rb'
- 'bin/*'
Rails:
Enabled: True
Style/FrozenStringLiteralComment:
Enabled: false
Metrics/BlockLength:
Exclude:
- 'spec/**/*.rb'
- 'Guardfile'
- 'vendor/bundle'