-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.rb
More file actions
55 lines (38 loc) · 1.7 KB
/
codegen.rb
File metadata and controls
55 lines (38 loc) · 1.7 KB
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
$main ||= self
require_relative 'functions.rb'
require_relative 'generator.rb'
Dir["#{__dir__}/generators/*.rb"].sort.each do |file|
require file
end
answers = {}
answers[:spring] = $main.yes?('Add Spring preloader? (y/n)')
answers[:slim] = $main.yes?('Use Slim templates? (y/n)')
# TODO: GraphQL or RESTful
answers[:product] = $main.yes?('Add README & docs? (y/n)')
if answers[:product]
answers[:product_name] = $main.ask('> Product name (for Readme) =')
answers[:product_specs] = $main.yes?('> Add templates for product specification? (y/n)')
end
# answers[:webpack] = !$main.options[:api]
answers[:webpack] = false # FIXME: temporarily disabled due to new front-end gems for Rails 7
answers[:design] = !$main.options[:api] && $main.yes?('Add tools for design? (y/n)')
if answers[:design]
answers[:design_bootstrap] = $main.yes?('> Use Bootstrap UI? (y/n)')
end
answers[:mail] =
!$main.options[:skip_action_mailer] && $main.yes?('Add settings & files for ActionMailer? (y/n)')
answers[:sorcery] = $main.yes?('Add Sorcery? (y/n)')
answers[:sidekiq] = !$main.options[:skip_active_job] && $main.yes?('Add Sidekiq? (y/n)')
answers[:redis] = answers[:sidekiq] || $main.yes?('Add Redis? (y/n)')
if answers[:webpack]
answers[:turbolinks] = $main.yes?('Add Turbolinks? (y/n)')
answers[:svelte] = $main.yes?('Add Svelte? (y/n)')
answers[:vue] = $main.yes?('Add Vue? (y/n)')
if answers[:vue]
answers[:vue_formulate] = $main.yes?('> Add Vue-Formulate? (y/n)')
answers[:vue_pug] = $main.yes?('> Add Pug? (y/n)')
end
answers[:axios] = (answers[:svelte] || answers[:vue]) && $main.yes?('Add Axios? (y/n)')
end
answers[:capistrano] = $main.yes?('Add Capistrano? (y/n)')
Generator.run_all(answers)