-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.rb
57 lines (48 loc) · 1.13 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
# frozen_string_literal: true
ruby_version = ask('Ruby version', default: '2.7.1')
node_version = ask('Nodejs version', default: '12.18.3')
create_file '.tool-versions', force: true do
"ruby #{ruby_version}\nnodejs #{node_version}"
end
run 'bundle'
if yes?('Do initial commit?')
git :init
git add: '.'
git commit: '-m "initial"'
end
rake 'db:create db:migrate' if yes?('Create database?')
if yes?('Add Rspec?')
gem_group :test do
gem 'webmock'
gem 'vcr'
end
gem_group :development, :test do
gem 'rspec-rails'
gem 'factory_bot_rails'
# TODO: Add support file
end
gem_group :development do
gem 'spring'
gem 'spring-commands-rspec'
end
run 'bundle'
run 'bin/spring binstub --all'
generate 'rspec:install'
end
if yes?('Add Pry?')
gem_group :development, :test do
gem 'pry-rails'
gem 'pry-byebug'
end
run 'bundle'
end
if yes?('Add Devise')
gem 'devise'
generate 'devise:install'
model_name = ask('What would you like the user model to be called? [user]')
model_name = 'user' if model_name.blank?
generate 'devise', model_name
end
git :init
git add: '.'
git commit: '-m "gems"'