-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.rb
75 lines (67 loc) · 1.36 KB
/
template.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# frozen_string_literal: true
def add_gems
gem 'slim'
gem_group :development do
gem 'rubocop', require: false
gem 'rubocop-rails'
gem 'rubocop-rspec'
end
gem_group :development, :test do
gem 'fabrication'
gem 'rspec-rails'
end
end
def remove_unnecessary_files
run 'rm -r app/channels'
run 'rm -r app/controllers/concerns'
run 'rm -r app/helpers'
run 'rm -r app/jobs'
run 'rm -r app/models/concerns'
run 'rm -r storage'
end
def add_rubocop_config
file '.rubocop.yml', <<-CODE
require:
- rubocop-rails
- rubocop-rspec
AllCops:
Exclude:
- '**/config.ru'
- '**/Rakefile'
- 'bin/**/*'
- 'db/**/*'
- 'log/**/*'
- 'node_modules/**/*'
- 'tmp/**/*'
- 'vendor/**/*'
NewCops: enable
Documentation:
Enabled: false
Style/SymbolArray:
EnforcedStyle: brackets
Layout/LineLength:
Exclude:
- 'config/**/*'
Metrics/BlockLength:
Exclude:
- 'spec/**/*_spec.rb'
- 'config/routes.rb'
Metrics/AbcSize:
Max: 20
Rails:
Enabled: true
Rails/FilePath:
EnforcedStyle: arguments
RSpec/ExampleLength:
Max: 50
RSpec/MultipleExpectations:
Enabled: false
CODE
end
add_gems
remove_unnecessary_files
add_rubocop_config
after_bundle do
# rails_command 'generate rspec:install'
run 'bundle exec rubocop --auto-correct-all'
end