rails_app_generator 0.1.28 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -1
- data/CHANGELOG.md +8 -0
- data/after_templates/addons/acts_as_list/_.rb +0 -14
- data/after_templates/addons/mini_magick/_.rb +1 -1
- data/docs/last_run/app_generator_class.json +406 -0
- data/docs/last_run/app_generator_data.json +44 -0
- data/docs/last_run/rails_options_class.json +406 -0
- data/docs/last_run/rails_options_data.json +53 -0
- data/exe/rag +2 -0
- data/lib/rails_app_generator/addons/twilio_ruby.rb +13 -0
- data/lib/rails_app_generator/app_generator.rb +37 -157
- data/lib/rails_app_generator/cli/profile.rb +3 -1
- data/lib/rails_app_generator/configuration/rag_configuration.rb +18 -0
- data/lib/rails_app_generator/configuration/rag_configuration_extension.rb +14 -0
- data/lib/rails_app_generator/options/build_option.rb +14 -9
- data/lib/rails_app_generator/options/options_builder.rb +57 -9
- data/lib/rails_app_generator/options/rails_options.rb +6 -68
- data/lib/rails_app_generator/rag_initializer.rb +250 -0
- data/lib/rails_app_generator/util.rb +26 -0
- data/lib/rails_app_generator/version.rb +1 -1
- data/lib/rails_app_generator.rb +4 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/profiles/addons/mini_magick.json +2 -1
- data/templates/thor_task/addon/addon.tt +2 -6
- metadata +24 -2
@@ -0,0 +1,250 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# frozen__tring_literal: true
|
4
|
+
|
5
|
+
KConfig.configure do |config|
|
6
|
+
# https://railsbytes.com/public/templates
|
7
|
+
# http://www.railscomposer.com/
|
8
|
+
# https://github.com/RailsApps/rails-composer
|
9
|
+
# https://github.com/carbonfive/raygun-rails
|
10
|
+
# https://github.com/abhaynikam/boring_generators
|
11
|
+
|
12
|
+
# config.rag.add_option :test , type: :string , default: 'rspec'
|
13
|
+
|
14
|
+
# # Gem Current Latest Requested Groups
|
15
|
+
# # aws-sdk
|
16
|
+
# # capistrano-bundler 1.6.0 2.1.0 ~> 1.2 development, test
|
17
|
+
# # capybara 3.33.0 3.37.1 = 3.33.0 development, test
|
18
|
+
# # clamby 1.6.6 1.6.8 = 1.6.6 default
|
19
|
+
# # createsend 5.1.1 6.0.0 ~> 5.1 default
|
20
|
+
# # database_cleaner 1.7.0 2.0.1 = 1.7.0 development, test
|
21
|
+
# # erubi 1.10.0 1.11.0
|
22
|
+
# # factory_bot 5.2.0 6.2.1
|
23
|
+
# # factory_bot_rails 5.2.0 6.2.0 = 5.2.0 development, test
|
24
|
+
# # guard-bundler 2.2.1 3.0.0 = 2.2.1 development, test
|
25
|
+
# # guard-rubocop 1.4.0 1.5.0 = 1.4.0 development, test
|
26
|
+
# # http-accept 1.7.0 2.2.0
|
27
|
+
# # net-ssh 6.1.0 7.0.1
|
28
|
+
# # oauth2 1.4.10 2.0.6
|
29
|
+
# # omniauth-oauth2 1.7.3 1.8.0
|
30
|
+
# # paper_trail 10.3.1 12.3.0 ~> 10.3 default
|
31
|
+
# # pg 0.21.0 1.4.2 ~> 0.20 default
|
32
|
+
# # pg_search 2.3.0 2.3.6 ~> 2.0 default
|
33
|
+
# # pry 0.13.1 0.14.1
|
34
|
+
# # public_suffix 2.0.5 5.0.0 ~> 2.0 default
|
35
|
+
# # pusher 1.4.3 2.0.2 ~> 1.3 default
|
36
|
+
# # rack-mini-profiler 0.10.7 3.0.0 ~> 0.10 default
|
37
|
+
# # rack-test 0.6.3 2.0.2
|
38
|
+
# # rails 5.0.7.2 7.0.3.1 = 5.0.7.2 default
|
39
|
+
# # railties 5.0.7.2 7.0.3.1
|
40
|
+
# # ransack 1.8.10 3.2.1 ~> 1.8 default
|
41
|
+
# # redis 3.3.5 4.7.1 ~> 3.3 default
|
42
|
+
# # redis-store 1.6.0 1.9.1
|
43
|
+
# # regexp_parser 1.8.2 2.5.0
|
44
|
+
# # rspec 3.10.0 3.11.0
|
45
|
+
# # rspec-core 3.10.1 3.11.0 = 3.10.1 development, test
|
46
|
+
# # rspec-expectations 3.10.1 3.11.0 = 3.10.1 development, test
|
47
|
+
# # rspec-mocks 3.10.2 3.11.1 = 3.10.2 development, test
|
48
|
+
# # rspec-rails 4.1.2 5.1.2 = 4.1.2 development, test
|
49
|
+
# # rspec-support 3.10.2 3.11.0 = 3.10.2 development, test
|
50
|
+
# # rubyzip 1.3.0 2.3.2 ~> 1.3 default
|
51
|
+
# # scenic 1.5.4 1.6.0 = 1.5.4 default
|
52
|
+
# # scout_apm 4.1.2 5.2.0 ~> 4.1 default
|
53
|
+
# # selenium-webdriver 3.142.7 4.3.0 = 3.142.7 development, test
|
54
|
+
# # shoulda-matchers 4.0.1 5.1.0 = 4.0.1 development, test
|
55
|
+
# # sidekiq 4.2.10 6.5.1 ~> 4.2 default
|
56
|
+
# # sidekiq-pool 1.9.3 2.0.1 ~> 1.8 default
|
57
|
+
# # sidekiq-unique-jobs 6.0.25 7.1.27 ~> 6.0 default
|
58
|
+
# # spring 2.1.1 4.0.0 ~> 2.0 development, test
|
59
|
+
# # sprockets 3.7.2 4.1.1 ~> 3.7 default
|
60
|
+
# # sprockets-rails 3.2.2 3.4.2
|
61
|
+
# # timecop 0.8.1 0.9.5 = 0.8.1 development, test
|
62
|
+
# # tzinfo 1.2.10 2.0.5
|
63
|
+
# # uglifier 3.2.0 4.2.0 ~> 3.2 default
|
64
|
+
# # unicorn 5.8.0 6.1.0 ~> 5.3 default
|
65
|
+
# # webmock 3.13.0 3.16.0 = 3.13.0 development, test
|
66
|
+
# # websocket-driver 0.6.5 0.7.5
|
67
|
+
|
68
|
+
# # acts_as_list 0.9.19 1.0.4 ~> 0.9 default
|
69
|
+
# # arel 7.1.4 9.0.0
|
70
|
+
# # bigdecimal 1.4.4 3.1.2 ~> 1.4 development, test
|
71
|
+
# # binding_of_caller 0.8.0 1.0.0 ~> 0.8 default
|
72
|
+
# # browser 2.7.1 5.3.1 ~> 2.3 default
|
73
|
+
# # capistrano-bundler 1.6.0 2.1.0 ~> 1.2 development, test
|
74
|
+
# # capybara 3.33.0 3.37.1 = 3.33.0 development, test
|
75
|
+
# # chartkick 2.3.5 4.2.0 ~> 2.3 default
|
76
|
+
# # childprocess 3.0.0 4.1.0
|
77
|
+
# # clamby 1.6.6 1.6.8 = 1.6.6 default
|
78
|
+
# # createsend 5.1.1 6.0.0 ~> 5.1 default
|
79
|
+
# # database_cleaner 1.7.0 2.0.1 = 1.7.0 development, test
|
80
|
+
# # factory_bot 5.2.0 6.2.1
|
81
|
+
# # factory_bot_rails 5.2.0 6.2.0 = 5.2.0 development, test
|
82
|
+
# # faker 1.9.6 2.22.0 ~> 1.7 default
|
83
|
+
# # groupdate 4.3.0 6.1.0 ~> 4.1 default
|
84
|
+
# # guard-bundler 2.2.1 3.0.0 = 2.2.1 development, test
|
85
|
+
# # guard-rubocop 1.4.0 1.5.0 = 1.4.0 development, test
|
86
|
+
# # hashie 3.6.0 5.0.0
|
87
|
+
# # http-accept 1.7.0 2.1.1
|
88
|
+
# # k_log 0.0.18 0.0.33 = 0.0.18 development, test
|
89
|
+
# # net-ssh 6.1.0 7.0.1
|
90
|
+
# # oauth2 1.4.10 2.0.6
|
91
|
+
# # omniauth-oauth2 1.7.3 1.8.0
|
92
|
+
# # paper_trail 10.3.1 12.3.0 ~> 10.3 default
|
93
|
+
# # pg 0.21.0 1.4.2 ~> 0.20 default
|
94
|
+
# # pg_search 2.3.0 2.3.6 ~> 2.0 default
|
95
|
+
# # pry 0.13.1 0.14.1
|
96
|
+
# # public_suffix 2.0.5 5.0.0 ~> 2.0 default
|
97
|
+
# # pusher 1.4.3 2.0.2 ~> 1.3 default
|
98
|
+
# # rack-mini-profiler 0.10.7 3.0.0 ~> 0.10 default
|
99
|
+
# # rack-test 0.6.3 2.0.2
|
100
|
+
# # rails 5.0.7.2 7.0.3.1 = 5.0.7.2 default
|
101
|
+
# # railties 5.0.7.2 7.0.3.1
|
102
|
+
# # ransack 1.8.10 3.2.1 ~> 1.8 default
|
103
|
+
# # redis 3.3.5 4.7.1 ~> 3.3 default
|
104
|
+
# # redis-store 1.6.0 1.9.1
|
105
|
+
# # regexp_parser 1.8.2 2.5.0
|
106
|
+
# # rspec 3.10.0 3.11.0
|
107
|
+
# # rspec-core 3.10.1 3.11.0 = 3.10.1 development, test
|
108
|
+
# # rspec-expectations 3.10.1 3.11.0 = 3.10.1 development, test
|
109
|
+
# # rspec-mocks 3.10.2 3.11.1 = 3.10.2 development, test
|
110
|
+
# # rspec-rails 4.1.2 5.1.2 = 4.1.2 development, test
|
111
|
+
# # rspec-support 3.10.2 3.11.0 = 3.10.2 development, test
|
112
|
+
# # rubyzip 1.3.0 2.3.2 ~> 1.3 default
|
113
|
+
# # scenic 1.5.4 1.6.0 = 1.5.4 default
|
114
|
+
# # scout_apm 4.1.2 5.2.0 ~> 4.1 default
|
115
|
+
# # selenium-webdriver 3.142.7 4.3.0 = 3.142.7 development, test
|
116
|
+
# # shoulda-matchers 4.0.1 5.1.0 = 4.0.1 development, test
|
117
|
+
# # sidekiq 4.2.10 6.5.1 ~> 4.2 default
|
118
|
+
# # sidekiq-pool 1.9.3 2.0.1 ~> 1.8 default
|
119
|
+
# # sidekiq-unique-jobs 6.0.25 7.1.27 ~> 6.0 default
|
120
|
+
# # spring 2.1.1 4.0.0 ~> 2.0 development, test
|
121
|
+
# # sprockets 3.7.2 4.1.1 ~> 3.7 default
|
122
|
+
# # sprockets-rails 3.2.2 3.4.2
|
123
|
+
# # timecop 0.8.1 0.9.5 = 0.8.1 development, test
|
124
|
+
# # tzinfo 1.2.10 2.0.5
|
125
|
+
# # uglifier 3.2.0 4.2.0 ~> 3.2 default
|
126
|
+
# # unicorn 5.8.0 6.1.0 ~> 5.3 default
|
127
|
+
# # webmock 3.13.0 3.14.0 = 3.13.0 development, test
|
128
|
+
# # websocket-driver 0.6.5 0.7.5
|
129
|
+
|
130
|
+
# config.rag.add_option :skip_namespace , type: :boolean , default: false , description: "Skip namespace (affects only isolated engines)"
|
131
|
+
# config.rag.add_option :skip_collision_check , type: :boolean , default: false , description: "Skip collision check"
|
132
|
+
config.rag.add_option :force , type: :boolean , default: nil , description: 'Overwrite files that already exist'
|
133
|
+
# XXX config.rag.add_option :pretend , type: :boolean , default: nil , description: "Run but do not make any changes"
|
134
|
+
# XXX config.rag.add_option :quiet , type: :boolean , default: nil , description: "Suppress status output"
|
135
|
+
# XXX config.rag.add_option :skip , type: :boolean , default: nil , description: "Skip files that already exist"
|
136
|
+
# config.rag.add_option :ruby , type: :string , default: "/Users/davidcruwys/.asdf/installs/ruby/2.7.6/bin/ruby" , description: "Path to the Ruby binary of your choice"
|
137
|
+
# XXX config.rag.add_option :template , type: :string , default: nil , description: "Path to some application template (can be a filesystem path or URL)"
|
138
|
+
# config.rag.add_option :database , type: :string , default: "sqlite3" , description: "Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)"
|
139
|
+
# config.rag.add_option :skip_git , type: :boolean , default: false , description: "Skip .gitignore file"
|
140
|
+
# config.rag.add_option :skip_keeps , type: :boolean , default: false , description: "Skip source control .keep files"
|
141
|
+
# config.rag.add_option :skip_action_mailer , type: :boolean , default: false , description: "Skip Action Mailer files"
|
142
|
+
# config.rag.add_option :skip_action_mailbox , type: :boolean , default: false , description: "Skip Action Mailbox gem"
|
143
|
+
# config.rag.add_option :skip_action_text , type: :boolean , default: false , description: "Skip Action Text gem"
|
144
|
+
# config.rag.add_option :skip_active_record , type: :boolean , default: false , description: "Skip Active Record files"
|
145
|
+
# config.rag.add_option :skip_active_job , type: :boolean , default: false , description: "Skip Active Job"
|
146
|
+
# config.rag.add_option :skip_active_storage , type: :boolean , default: false , description: "Skip Active Storage files"
|
147
|
+
# config.rag.add_option :skip_action_cable , type: :boolean , default: false , description: "Skip Action Cable files"
|
148
|
+
# config.rag.add_option :skip_asset_pipeline , type: :boolean , default: false , description: "Indicates when to generate skip asset pipeline"
|
149
|
+
# config.rag.add_option :asset_pipeline , type: :string , default: "sprockets" , description: "Choose your asset pipeline [options: sprockets (default), propshaft]"
|
150
|
+
# config.rag.add_option :skip_javascript , type: :boolean , default: false , description: "Skip JavaScript files"
|
151
|
+
# config.rag.add_option :skip_hotwire , type: :boolean , default: false , description: "Skip Hotwire integration"
|
152
|
+
# config.rag.add_option :skip_jbuilder , type: :boolean , default: false , description: "Skip jbuilder gem"
|
153
|
+
# config.rag.add_option :skip_test , type: :boolean , default: false , description: "Skip test files"
|
154
|
+
# config.rag.add_option :skip_system_test , type: :boolean , default: false , description: "Skip system test files"
|
155
|
+
# config.rag.add_option :skip_bootsnap , type: :boolean , default: false , description: "Skip bootsnap gem"
|
156
|
+
# config.rag.add_option :dev , type: :boolean , default: false , description: "Set up the application with Gemfile pointing to your Rails checkout"
|
157
|
+
# config.rag.add_option :edge , type: :boolean , default: false , description: "Set up the application with Gemfile pointing to Rails repository"
|
158
|
+
# config.rag.add_option :main , type: :boolean , default: false , description: "Set up the application with Gemfile pointing to Rails repository main branch"
|
159
|
+
# config.rag.add_option :rc , type: :string , default: nil , description: "Path to file containing extra configuration options for rails command"
|
160
|
+
# config.rag.add_option :no_rc , type: :boolean , default: false , description: "Skip loading of extra configuration options from .railsrc file"
|
161
|
+
# config.rag.add_option :help , type: :boolean , default: nil , description: "Show this help message and quit"
|
162
|
+
# config.rag.add_option :version , type: :boolean , default: nil , description: "Show Rails version number and quit"
|
163
|
+
# config.rag.add_option :api , type: :boolean , default: false , description: "Preconfigure smaller stack for API only apps"
|
164
|
+
# config.rag.add_option :minimal , type: :boolean , default: nil , description: "Preconfigure a minimal rails app"
|
165
|
+
# config.rag.add_option :javascript , type: :string , default: "importmap" , description: "Choose JavaScript approach [options: importmap (default), webpack, esbuild, rollup]"
|
166
|
+
# config.rag.add_option :css , type: :string , default: nil , description: "Choose CSS processor [options: tailwind, bootstrap, bulma, postcss, sass... check https://github.com/rails/cssbundling-rails]"
|
167
|
+
# config.rag.add_option :skip_bundle , type: :boolean , default: false , description: "Don't run bundle install"
|
168
|
+
|
169
|
+
# future_option :database , type: :string , default: 'sqlite3' # , description: "Preconfigure for selected database (options: #{DATABASES.join('/')})"
|
170
|
+
# config.rag.add_option :skip_git , type: :boolean, default: false # , description: "Skip .gitignore file"
|
171
|
+
# future_option :skip_keeps , type: :boolean, default: false # , description: "Skip source control .keep files"
|
172
|
+
# future_option :skip_action_mailer , type: :boolean, default: false # , description: "Skip Action Mailer files"
|
173
|
+
# future_option :skip_action_mailbox , type: :boolean, default: false # , description: "Skip Action Mailbox gem"
|
174
|
+
# future_option :skip_action_text , type: :boolean, default: false # , description: "Skip Action Text gem"
|
175
|
+
# future_option :skip_active_record , type: :boolean, default: false # , description: "Skip Active Record files"
|
176
|
+
# future_option :skip_active_job , type: :boolean, default: false # , description: "Skip Active Job"
|
177
|
+
# future_option :skip_active_storage , type: :boolean, default: false # , description: "Skip Active Storage files"
|
178
|
+
# future_option :skip_action_cable , type: :boolean, default: false # , description: "Skip Action Cable files"
|
179
|
+
# future_option :skip_asset_pipeline , type: :boolean, default: false #
|
180
|
+
# future_option :asset_pipeline , type: :string , default: 'sprockets' # , description: "Choose your asset pipeline [options: sprockets (default), propshaft]"
|
181
|
+
# future_option :skip_javascript , type: :boolean, default: false # name == 'plugin' # , description: "Skip JavaScript files"
|
182
|
+
# future_option :skip_hotwire , type: :boolean, default: false # , description: "Skip Hotwire integration"
|
183
|
+
# future_option :skip_jbuilder , type: :boolean, default: false # , description: "Skip jbuilder gem"
|
184
|
+
# config.rag.add_option :skip_test , type: :boolean, default: false # , description: "Skip test files"
|
185
|
+
config.rag.add_option :test , type: :string , default: 'rspec' # , description: "minitest or rspec (default: rspec)"
|
186
|
+
# future_option :skip_system_test , type: :boolean, default: false # , description: "Skip system test files"
|
187
|
+
# future_option :skip_bootsnap , type: :boolean, default: false # , description: "Skip bootsnap gem"
|
188
|
+
# future_option :dev , type: :boolean, default: false # , description: "Set up the #{name} with Gemfile pointing to your Rails checkout"
|
189
|
+
# future_option :edge , type: :boolean, default: false # , description: "Set up the #{name} with Gemfile pointing to Rails repository"
|
190
|
+
# future_option :main , type: :boolean, default: false # , description: "Set up the #{name} with Gemfile pointing to Rails repository main branch"
|
191
|
+
# future_option :rc , type: :string , default: nil # , description: "Path to file containing extra configuration options for rails command"
|
192
|
+
# future_option :no_rc , type: :boolean, default: false # , description: "Skip loading of extra configuration options from .railsrc file"
|
193
|
+
# future_option :help , type: :boolean # , group: :rails # , description: "Show this help message and quit"
|
194
|
+
# future_option :version , type: :boolean # , group: :rails, description: "Show Rails version number and quit"
|
195
|
+
# future_option :api , type: :boolean # , description: "Preconfigure smaller stack for API only apps"
|
196
|
+
# future_option :minimal , type: :boolean # , description: "Preconfigure a minimal rails app"
|
197
|
+
# future_option :javascript , type: :string , default: 'importmap' # , description: "Choose JavaScript approach [options: importmap (default), webpack, esbuild, rollup]"
|
198
|
+
# config.rag.add_option :css , type: :string , description: "Choose CSS processor [options: tailwind, bootstrap, bulma, postcss, sass... check https://github.com/rails/cssbundling-rails]"
|
199
|
+
# config.rag.add_option :skip_bundle , type: :boolean, default: false , description: "Don't run bundle install"
|
200
|
+
|
201
|
+
# config.rag.add_option :add_irbrc , type: :boolean, default: false
|
202
|
+
# config.rag.add_option :add_foreman , type: :boolean, default: false
|
203
|
+
# config.rag.add_option :add_devise , type: :boolean, default: false
|
204
|
+
# config.rag.add_option :add_dotenv , type: :boolean, default: false
|
205
|
+
# config.rag.add_option :add_docker , type: :boolean, default: false
|
206
|
+
# config.rag.add_option :add_docker_compose , type: :boolean, default: false
|
207
|
+
# config.rag.add_option :add_rubocop , type: :boolean, default: false
|
208
|
+
# config.rag.add_option :add_annotate , type: :boolean, default: false
|
209
|
+
# config.rag.add_option :add_continuous_integration , type: :boolean, default: false
|
210
|
+
# config.rag.add_option :add_high_voltage , type: :boolean, default: false
|
211
|
+
# config.rag.add_option :add_generators , type: :boolean, default: false
|
212
|
+
# config.rag.add_option :add_lograge , type: :boolean, default: false
|
213
|
+
# config.rag.add_option :add_pundit , type: :boolean, default: false
|
214
|
+
# config.rag.add_option :add_services , type: :boolean, default: false
|
215
|
+
# config.rag.add_option :add_sidekiq , type: :boolean, default: false
|
216
|
+
# config.rag.add_option :add_views , type: :boolean, default: false
|
217
|
+
# config.rag.add_option :add_errors , type: :boolean, default: false
|
218
|
+
# config.rag.add_option :add_scaffold , type: :boolean, default: false
|
219
|
+
# config.rag.add_option :add_factory_bot , type: :boolean, default: false
|
220
|
+
# config.rag.add_option :add_shoulda , type: :boolean, default: false
|
221
|
+
|
222
|
+
# NEW GEM ADDONS
|
223
|
+
config.rag.add_option :add_acts_as_list , type: :boolean, default: false
|
224
|
+
config.rag.add_option :add_browser , type: :boolean, default: false
|
225
|
+
config.rag.add_option :add_chartkick , type: :boolean, default: false
|
226
|
+
config.rag.add_option :add_faker , type: :boolean, default: false
|
227
|
+
config.rag.add_option :add_groupdate , type: :boolean, default: false
|
228
|
+
config.rag.add_option :add_hexapdf , type: :boolean, default: false
|
229
|
+
config.rag.add_option :add_httparty , type: :boolean, default: false
|
230
|
+
config.rag.add_option :add_honeybadger , type: :boolean, default: false
|
231
|
+
config.rag.add_option :add_mini_magick , type: :boolean, default: false , description: 'Add Mini Magick gem'
|
232
|
+
config.rag.add_option :add_rails_html_sanitizer , type: :boolean, default: false
|
233
|
+
config.rag.add_option :add_twilio_ruby , type: :boolean, default: false
|
234
|
+
end
|
235
|
+
|
236
|
+
# Make sure that RailsOptions reflect the options available from Railties
|
237
|
+
RailsAppGenerator::AppGenerator.class_options.each do |class_option|
|
238
|
+
thor_option = class_option[1]
|
239
|
+
# puts "Adding railties class_option onto RailsOptions: #{thor_option.name}"
|
240
|
+
RailsAppGenerator::RailsOptions.add_thor_class_option(thor_option)
|
241
|
+
end
|
242
|
+
# Make sure that RailsOptions reflect the options available from custom configuration
|
243
|
+
KConfig.configuration.rag.options.each do |option|
|
244
|
+
RailsAppGenerator::RailsOptions.add_class_option(option)
|
245
|
+
RailsAppGenerator::AppGenerator.add_class_option(option)
|
246
|
+
end
|
247
|
+
|
248
|
+
# Debugging code
|
249
|
+
RailsAppGenerator::Util.write_last_run('rails_options_class.json', RailsAppGenerator::RailsOptions.to_h)
|
250
|
+
RailsAppGenerator::Util.write_last_run('app_generator_class.json', RailsAppGenerator::AppGenerator.to_h)
|
@@ -21,6 +21,32 @@ module RailsAppGenerator
|
|
21
21
|
heading = "- [ #{heading} ]"
|
22
22
|
puts heading.length > len ? heading : heading.ljust(len, '-')
|
23
23
|
end
|
24
|
+
|
25
|
+
def write_last_run(file, data)
|
26
|
+
file = File.join('~/dev/kgems/rails_app_generator/docs/last_run/', file)
|
27
|
+
write_json(file, data)
|
28
|
+
end
|
29
|
+
|
30
|
+
def write_json(file, data)
|
31
|
+
file = File.expand_path(file)
|
32
|
+
puts "Write to #{file}"
|
33
|
+
FileUtils.mkdir_p(File.dirname(file))
|
34
|
+
File.write(file, JSON.pretty_generate(data))
|
35
|
+
end
|
36
|
+
|
37
|
+
# Take array of Thor::Option and extract the data as a hash
|
38
|
+
#
|
39
|
+
# You can find the array on the class_options reader
|
40
|
+
def thor_options_to_hash(thor_options)
|
41
|
+
common_keys = thor_options.flat_map(&:instance_variables).uniq
|
42
|
+
common_keys = common_keys.map { |k| k.to_s.delete_prefix('@').to_sym }
|
43
|
+
|
44
|
+
thor_options.map do |option|
|
45
|
+
common_keys.each_with_object({}) do |key, result|
|
46
|
+
result[key] = option.send(key) if option.respond_to?(key)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
24
50
|
end
|
25
51
|
end
|
26
52
|
end
|
data/lib/rails_app_generator.rb
CHANGED
@@ -6,11 +6,14 @@ require 'rails/generators'
|
|
6
6
|
require 'rails/generators/app_name'
|
7
7
|
require 'rails/generators/rails/app/app_generator'
|
8
8
|
require 'bundler'
|
9
|
+
require 'k_config'
|
9
10
|
|
10
11
|
require 'rails_app_generator/version'
|
12
|
+
require 'rails_app_generator/util'
|
13
|
+
require 'rails_app_generator/configuration/rag_configuration'
|
14
|
+
require 'rails_app_generator/configuration/rag_configuration_extension'
|
11
15
|
require 'rails_app_generator/cli/diff'
|
12
16
|
require 'rails_app_generator/cli/profile'
|
13
|
-
require 'rails_app_generator/util'
|
14
17
|
require 'rails_app_generator/diff/file_pair'
|
15
18
|
require 'rails_app_generator/diff/compare_info'
|
16
19
|
require 'rails_app_generator/diff/processor'
|
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "rails_app_generator",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.2.0",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "rails_app_generator",
|
9
|
-
"version": "0.
|
9
|
+
"version": "0.2.0",
|
10
10
|
"dependencies": {
|
11
11
|
"daisyui": "^2.20.0"
|
12
12
|
},
|
data/package.json
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# class_option :add_<%= data.name_snake %>, type: :boolean, default: false
|
6
|
-
# add_if(:<%= data.name_snake %>)
|
7
|
-
# lib/rails_app_generator/options/rails_options.rb
|
8
|
-
# register_option :add_<%= data.name_snake %>, type: :boolean, default: false
|
3
|
+
# lib/rails_app_generator/rag_initializer.rb
|
4
|
+
# config.rag.add_option :add_<%= data.name_snake %> , type: :boolean, default: false
|
9
5
|
|
10
6
|
module RailsAppGenerator
|
11
7
|
# Custom add-ons for RailsAppGenerator
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_app_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootsnap
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: k_config
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
description: " Create new Rails Application with custom opinions\n"
|
140
154
|
email:
|
141
155
|
- david@ideasmen.com.au
|
@@ -357,6 +371,10 @@ files:
|
|
357
371
|
- docs/images/tailwind_hotwire.png
|
358
372
|
- docs/images/tailwind_hotwire_form.png
|
359
373
|
- docs/images/tailwind_hotwire_form_search.png
|
374
|
+
- docs/last_run/app_generator_class.json
|
375
|
+
- docs/last_run/app_generator_data.json
|
376
|
+
- docs/last_run/rails_options_class.json
|
377
|
+
- docs/last_run/rails_options_data.json
|
360
378
|
- docs/project-plan.md
|
361
379
|
- docs/project-plan/project.drawio
|
362
380
|
- docs/project-plan/project_done.svg
|
@@ -399,11 +417,14 @@ files:
|
|
399
417
|
- lib/rails_app_generator/addons/stimulus.rb
|
400
418
|
- lib/rails_app_generator/addons/stimulus_components.rb
|
401
419
|
- lib/rails_app_generator/addons/tailwind.rb
|
420
|
+
- lib/rails_app_generator/addons/twilio_ruby.rb
|
402
421
|
- lib/rails_app_generator/addons/views.rb
|
403
422
|
- lib/rails_app_generator/app_builder.rb
|
404
423
|
- lib/rails_app_generator/app_generator.rb
|
405
424
|
- lib/rails_app_generator/cli/diff.rb
|
406
425
|
- lib/rails_app_generator/cli/profile.rb
|
426
|
+
- lib/rails_app_generator/configuration/rag_configuration.rb
|
427
|
+
- lib/rails_app_generator/configuration/rag_configuration_extension.rb
|
407
428
|
- lib/rails_app_generator/context.rb
|
408
429
|
- lib/rails_app_generator/dependencies.rb
|
409
430
|
- lib/rails_app_generator/diff/compare_info.rb
|
@@ -426,6 +447,7 @@ files:
|
|
426
447
|
- lib/rails_app_generator/options/map_option_string.rb
|
427
448
|
- lib/rails_app_generator/options/options_builder.rb
|
428
449
|
- lib/rails_app_generator/options/rails_options.rb
|
450
|
+
- lib/rails_app_generator/rag_initializer.rb
|
429
451
|
- lib/rails_app_generator/starter.rb
|
430
452
|
- lib/rails_app_generator/util.rb
|
431
453
|
- lib/rails_app_generator/version.rb
|