-
Notifications
You must be signed in to change notification settings - Fork 0
/
rails-template.rb
67 lines (51 loc) · 1.61 KB
/
rails-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
gem_group :development, :test do
# Optional other debugging tools
# gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
# gem "pry-rails
# incompatible with rails 8
# lets move to https://github.com/drwl/annotaterb
# gem "annotate", "~> 3.2"
gem "letter_opener_web", "~> 2.0"
# Security tooling to
# gem "brakeman"
# gem "bundler-audit", github: "rubysec/bundler-audit"
# gem "simplecov", require: false
# Testing
gem "factory_bot_rails"
gem "faker"
gem "rspec-rails", "~> 6.0.0"
end
gem_group :development do
#gem 'guard', "~> 2.14", require: false
#gem 'guard-rspec', "~> 4.7", require: false
# A fully configurable and extendable Git hook manager
gem "overcommit", require: false
# Rubocop
#gem "rubocop-rails-omakase", require: false
end
gem_group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
# gem "capybara", ">= 3.26"
# gem "selenium-webdriver"
# gem "webdrivers"
# Clean database during tests
gem "database_cleaner-active_record"
end
run "bundle install"
if yes? 'Do you wish to generate a root controller? (y/n)'
name = ask('What do you want to call it?').to_s.underscore
generate :controller, "#{name} show"
route "root to: '#{name}\#show'"
route "resource :#{name}, controller: :#{name}, only: [:show]"
end
rails_command "rspec:install"
rails_command "css:install:tailwind"
rails_command "javascript:install:esbuild"
rails_command "stimulus:install"
rails_command "turbo:install"
rubocop_yml = <<-EOL
require: standard
inherit_gem:
rubocop-rails-omakase: rubocop.yml
EOL
create_file ".rubocop.yml", rubocop_yml