omg-railties 8.0.0.alpha3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (351) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +171 -0
  3. data/MIT-LICENSE +20 -0
  4. data/RDOC_MAIN.md +99 -0
  5. data/README.rdoc +39 -0
  6. data/exe/rails +10 -0
  7. data/lib/minitest/rails_plugin.rb +140 -0
  8. data/lib/rails/all.rb +21 -0
  9. data/lib/rails/api/generator.rb +38 -0
  10. data/lib/rails/api/task.rb +235 -0
  11. data/lib/rails/app_loader.rb +77 -0
  12. data/lib/rails/application/bootstrap.rb +118 -0
  13. data/lib/rails/application/configuration.rb +659 -0
  14. data/lib/rails/application/default_middleware_stack.rb +140 -0
  15. data/lib/rails/application/dummy_config.rb +19 -0
  16. data/lib/rails/application/finisher.rb +238 -0
  17. data/lib/rails/application/routes_reloader.rb +79 -0
  18. data/lib/rails/application.rb +658 -0
  19. data/lib/rails/application_controller.rb +28 -0
  20. data/lib/rails/autoloaders/inflector.rb +21 -0
  21. data/lib/rails/autoloaders.rb +48 -0
  22. data/lib/rails/backtrace_cleaner.rb +42 -0
  23. data/lib/rails/cli.rb +21 -0
  24. data/lib/rails/code_statistics.rb +159 -0
  25. data/lib/rails/code_statistics_calculator.rb +99 -0
  26. data/lib/rails/command/actions.rb +52 -0
  27. data/lib/rails/command/base.rb +185 -0
  28. data/lib/rails/command/behavior.rb +84 -0
  29. data/lib/rails/command/environment_argument.rb +56 -0
  30. data/lib/rails/command/helpers/editor.rb +40 -0
  31. data/lib/rails/command.rb +172 -0
  32. data/lib/rails/commands/about/about_command.rb +14 -0
  33. data/lib/rails/commands/app/update_command.rb +94 -0
  34. data/lib/rails/commands/application/application_command.rb +33 -0
  35. data/lib/rails/commands/boot/boot_command.rb +14 -0
  36. data/lib/rails/commands/console/console_command.rb +91 -0
  37. data/lib/rails/commands/console/irb_console.rb +136 -0
  38. data/lib/rails/commands/credentials/USAGE +73 -0
  39. data/lib/rails/commands/credentials/credentials_command/diffing.rb +53 -0
  40. data/lib/rails/commands/credentials/credentials_command.rb +139 -0
  41. data/lib/rails/commands/db/system/change/change_command.rb +26 -0
  42. data/lib/rails/commands/dbconsole/dbconsole_command.rb +88 -0
  43. data/lib/rails/commands/destroy/destroy_command.rb +29 -0
  44. data/lib/rails/commands/dev/dev_command.rb +14 -0
  45. data/lib/rails/commands/devcontainer/devcontainer_command.rb +39 -0
  46. data/lib/rails/commands/encrypted/USAGE +23 -0
  47. data/lib/rails/commands/encrypted/encrypted_command.rb +98 -0
  48. data/lib/rails/commands/gem_help/USAGE +16 -0
  49. data/lib/rails/commands/gem_help/gem_help_command.rb +13 -0
  50. data/lib/rails/commands/generate/generate_command.rb +30 -0
  51. data/lib/rails/commands/help/USAGE +17 -0
  52. data/lib/rails/commands/help/help_command.rb +34 -0
  53. data/lib/rails/commands/initializers/initializers_command.rb +20 -0
  54. data/lib/rails/commands/middleware/middleware_command.rb +17 -0
  55. data/lib/rails/commands/new/new_command.rb +21 -0
  56. data/lib/rails/commands/notes/notes_command.rb +30 -0
  57. data/lib/rails/commands/plugin/plugin_command.rb +47 -0
  58. data/lib/rails/commands/rake/rake_command.rb +55 -0
  59. data/lib/rails/commands/restart/restart_command.rb +14 -0
  60. data/lib/rails/commands/routes/routes_command.rb +49 -0
  61. data/lib/rails/commands/runner/USAGE +22 -0
  62. data/lib/rails/commands/runner/runner_command.rb +81 -0
  63. data/lib/rails/commands/secret/secret_command.rb +13 -0
  64. data/lib/rails/commands/server/server_command.rb +290 -0
  65. data/lib/rails/commands/stats/stats_command.rb +19 -0
  66. data/lib/rails/commands/test/USAGE +14 -0
  67. data/lib/rails/commands/test/test_command.rb +81 -0
  68. data/lib/rails/commands/unused_routes/unused_routes_command.rb +75 -0
  69. data/lib/rails/commands/version/version_command.rb +12 -0
  70. data/lib/rails/commands.rb +18 -0
  71. data/lib/rails/configuration.rb +170 -0
  72. data/lib/rails/console/app.rb +8 -0
  73. data/lib/rails/console/helpers.rb +8 -0
  74. data/lib/rails/console/methods.rb +23 -0
  75. data/lib/rails/deprecator.rb +7 -0
  76. data/lib/rails/dev_caching.rb +44 -0
  77. data/lib/rails/engine/commands.rb +9 -0
  78. data/lib/rails/engine/configuration.rb +138 -0
  79. data/lib/rails/engine/lazy_route_set.rb +109 -0
  80. data/lib/rails/engine/railties.rb +23 -0
  81. data/lib/rails/engine/updater.rb +21 -0
  82. data/lib/rails/engine.rb +760 -0
  83. data/lib/rails/gem_version.rb +17 -0
  84. data/lib/rails/generators/actions/create_migration.rb +75 -0
  85. data/lib/rails/generators/actions.rb +528 -0
  86. data/lib/rails/generators/active_model.rb +94 -0
  87. data/lib/rails/generators/app_base.rb +806 -0
  88. data/lib/rails/generators/app_name.rb +39 -0
  89. data/lib/rails/generators/base.rb +432 -0
  90. data/lib/rails/generators/database.rb +287 -0
  91. data/lib/rails/generators/erb/authentication/authentication_generator.rb +15 -0
  92. data/lib/rails/generators/erb/authentication/templates/views/passwords/edit.html.erb +9 -0
  93. data/lib/rails/generators/erb/authentication/templates/views/passwords/new.html.erb +8 -0
  94. data/lib/rails/generators/erb/authentication/templates/views/sessions/new.html.erb +11 -0
  95. data/lib/rails/generators/erb/controller/controller_generator.rb +24 -0
  96. data/lib/rails/generators/erb/controller/templates/view.html.erb.tt +2 -0
  97. data/lib/rails/generators/erb/mailer/mailer_generator.rb +41 -0
  98. data/lib/rails/generators/erb/mailer/templates/layout.html.erb.tt +13 -0
  99. data/lib/rails/generators/erb/mailer/templates/layout.text.erb.tt +1 -0
  100. data/lib/rails/generators/erb/mailer/templates/view.html.erb.tt +5 -0
  101. data/lib/rails/generators/erb/mailer/templates/view.text.erb.tt +3 -0
  102. data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +34 -0
  103. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +37 -0
  104. data/lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt +12 -0
  105. data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +16 -0
  106. data/lib/rails/generators/erb/scaffold/templates/new.html.erb.tt +11 -0
  107. data/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt +17 -0
  108. data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +10 -0
  109. data/lib/rails/generators/erb.rb +26 -0
  110. data/lib/rails/generators/generated_attribute.rb +274 -0
  111. data/lib/rails/generators/migration.rb +71 -0
  112. data/lib/rails/generators/model_helpers.rb +62 -0
  113. data/lib/rails/generators/named_base.rb +227 -0
  114. data/lib/rails/generators/rails/app/USAGE +31 -0
  115. data/lib/rails/generators/rails/app/app_generator.rb +678 -0
  116. data/lib/rails/generators/rails/app/templates/Dockerfile.tt +119 -0
  117. data/lib/rails/generators/rails/app/templates/Gemfile.tt +83 -0
  118. data/lib/rails/generators/rails/app/templates/README.md.tt +24 -0
  119. data/lib/rails/generators/rails/app/templates/Rakefile.tt +6 -0
  120. data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css.tt +15 -0
  121. data/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt +6 -0
  122. data/lib/rails/generators/rails/app/templates/app/helpers/application_helper.rb.tt +2 -0
  123. data/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt +7 -0
  124. data/lib/rails/generators/rails/app/templates/app/mailers/application_mailer.rb.tt +4 -0
  125. data/lib/rails/generators/rails/app/templates/app/models/application_record.rb.tt +3 -0
  126. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +33 -0
  127. data/lib/rails/generators/rails/app/templates/app/views/layouts/mailer.html.erb.tt +13 -0
  128. data/lib/rails/generators/rails/app/templates/app/views/layouts/mailer.text.erb.tt +1 -0
  129. data/lib/rails/generators/rails/app/templates/app/views/pwa/manifest.json.erb.tt +22 -0
  130. data/lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js +26 -0
  131. data/lib/rails/generators/rails/app/templates/bin/brakeman.tt +6 -0
  132. data/lib/rails/generators/rails/app/templates/bin/dev.tt +1 -0
  133. data/lib/rails/generators/rails/app/templates/bin/rails.tt +3 -0
  134. data/lib/rails/generators/rails/app/templates/bin/rake.tt +3 -0
  135. data/lib/rails/generators/rails/app/templates/bin/rubocop.tt +7 -0
  136. data/lib/rails/generators/rails/app/templates/bin/setup.tt +45 -0
  137. data/lib/rails/generators/rails/app/templates/bin/thrust.tt +4 -0
  138. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +42 -0
  139. data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +6 -0
  140. data/lib/rails/generators/rails/app/templates/config/cable.yml.tt +10 -0
  141. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +82 -0
  142. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +114 -0
  143. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +72 -0
  144. data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +82 -0
  145. data/lib/rails/generators/rails/app/templates/config/deploy.yml.tt +107 -0
  146. data/lib/rails/generators/rails/app/templates/config/environment.rb.tt +5 -0
  147. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +89 -0
  148. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +125 -0
  149. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +62 -0
  150. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +7 -0
  151. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +25 -0
  152. data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +16 -0
  153. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +8 -0
  154. data/lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt +16 -0
  155. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_8_0.rb.tt +25 -0
  156. data/lib/rails/generators/rails/app/templates/config/locales/en.yml +31 -0
  157. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +43 -0
  158. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +16 -0
  159. data/lib/rails/generators/rails/app/templates/config/storage.yml.tt +34 -0
  160. data/lib/rails/generators/rails/app/templates/config.ru.tt +6 -0
  161. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +9 -0
  162. data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +16 -0
  163. data/lib/rails/generators/rails/app/templates/dockerignore.tt +56 -0
  164. data/lib/rails/generators/rails/app/templates/env.erb.tt +5 -0
  165. data/lib/rails/generators/rails/app/templates/gitattributes.tt +9 -0
  166. data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +138 -0
  167. data/lib/rails/generators/rails/app/templates/github/dependabot.yml +12 -0
  168. data/lib/rails/generators/rails/app/templates/gitignore.tt +38 -0
  169. data/lib/rails/generators/rails/app/templates/node-version.tt +1 -0
  170. data/lib/rails/generators/rails/app/templates/public/400.html +67 -0
  171. data/lib/rails/generators/rails/app/templates/public/404.html +67 -0
  172. data/lib/rails/generators/rails/app/templates/public/406-unsupported-browser.html +66 -0
  173. data/lib/rails/generators/rails/app/templates/public/422.html +67 -0
  174. data/lib/rails/generators/rails/app/templates/public/500.html +66 -0
  175. data/lib/rails/generators/rails/app/templates/public/icon.png +0 -0
  176. data/lib/rails/generators/rails/app/templates/public/icon.svg +3 -0
  177. data/lib/rails/generators/rails/app/templates/public/robots.txt +1 -0
  178. data/lib/rails/generators/rails/app/templates/rubocop.yml.tt +8 -0
  179. data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -0
  180. data/lib/rails/generators/rails/app/templates/test/application_system_test_case.rb.tt +5 -0
  181. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +21 -0
  182. data/lib/rails/generators/rails/application_record/application_record_generator.rb +13 -0
  183. data/lib/rails/generators/rails/authentication/USAGE +6 -0
  184. data/lib/rails/generators/rails/authentication/authentication_generator.rb +54 -0
  185. data/lib/rails/generators/rails/authentication/templates/controllers/concerns/authentication.rb +55 -0
  186. data/lib/rails/generators/rails/authentication/templates/controllers/passwords_controller.rb +33 -0
  187. data/lib/rails/generators/rails/authentication/templates/controllers/sessions_controller.rb +21 -0
  188. data/lib/rails/generators/rails/authentication/templates/mailers/passwords_mailer.rb +6 -0
  189. data/lib/rails/generators/rails/authentication/templates/models/current.rb +4 -0
  190. data/lib/rails/generators/rails/authentication/templates/models/session.rb +3 -0
  191. data/lib/rails/generators/rails/authentication/templates/models/user.rb +6 -0
  192. data/lib/rails/generators/rails/authentication/templates/test/mailers/previews/passwords_mailer_preview.rb +7 -0
  193. data/lib/rails/generators/rails/authentication/templates/views/passwords_mailer/reset.html.erb +4 -0
  194. data/lib/rails/generators/rails/authentication/templates/views/passwords_mailer/reset.text.erb +2 -0
  195. data/lib/rails/generators/rails/benchmark/USAGE +19 -0
  196. data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +30 -0
  197. data/lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt +15 -0
  198. data/lib/rails/generators/rails/controller/USAGE +26 -0
  199. data/lib/rails/generators/rails/controller/controller_generator.rb +42 -0
  200. data/lib/rails/generators/rails/controller/templates/controller.rb.tt +9 -0
  201. data/lib/rails/generators/rails/credentials/credentials_generator.rb +61 -0
  202. data/lib/rails/generators/rails/credentials/templates/credentials.yml.tt +12 -0
  203. data/lib/rails/generators/rails/db/system/change/change_generator.rb +206 -0
  204. data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +168 -0
  205. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/Dockerfile.tt +3 -0
  206. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/compose.yaml.tt +47 -0
  207. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt +37 -0
  208. data/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb +31 -0
  209. data/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +57 -0
  210. data/lib/rails/generators/rails/generator/USAGE +13 -0
  211. data/lib/rails/generators/rails/generator/generator_generator.rb +27 -0
  212. data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +3 -0
  213. data/lib/rails/generators/rails/generator/templates/USAGE.tt +8 -0
  214. data/lib/rails/generators/rails/generator/templates/templates/.empty_directory +0 -0
  215. data/lib/rails/generators/rails/helper/USAGE +12 -0
  216. data/lib/rails/generators/rails/helper/helper_generator.rb +20 -0
  217. data/lib/rails/generators/rails/helper/templates/helper.rb.tt +4 -0
  218. data/lib/rails/generators/rails/integration_test/USAGE +10 -0
  219. data/lib/rails/generators/rails/integration_test/integration_test_generator.rb +9 -0
  220. data/lib/rails/generators/rails/master_key/master_key_generator.rb +53 -0
  221. data/lib/rails/generators/rails/migration/USAGE +45 -0
  222. data/lib/rails/generators/rails/migration/migration_generator.rb +14 -0
  223. data/lib/rails/generators/rails/model/model_generator.rb +18 -0
  224. data/lib/rails/generators/rails/plugin/USAGE +21 -0
  225. data/lib/rails/generators/rails/plugin/plugin_generator.rb +499 -0
  226. data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +28 -0
  227. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +23 -0
  228. data/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt +20 -0
  229. data/lib/rails/generators/rails/plugin/templates/README.md.tt +28 -0
  230. data/lib/rails/generators/rails/plugin/templates/Rakefile.tt +14 -0
  231. data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +5 -0
  232. data/lib/rails/generators/rails/plugin/templates/app/helpers/%namespaced_name%/application_helper.rb.tt +5 -0
  233. data/lib/rails/generators/rails/plugin/templates/app/jobs/%namespaced_name%/application_job.rb.tt +5 -0
  234. data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +7 -0
  235. data/lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt +6 -0
  236. data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +17 -0
  237. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +15 -0
  238. data/lib/rails/generators/rails/plugin/templates/bin/rubocop.tt +7 -0
  239. data/lib/rails/generators/rails/plugin/templates/bin/test.tt +4 -0
  240. data/lib/rails/generators/rails/plugin/templates/config/routes.rb.tt +6 -0
  241. data/lib/rails/generators/rails/plugin/templates/github/ci.yml.tt +103 -0
  242. data/lib/rails/generators/rails/plugin/templates/github/dependabot.yml +12 -0
  243. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +14 -0
  244. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +7 -0
  245. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/railtie.rb.tt +5 -0
  246. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/version.rb.tt +1 -0
  247. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%.rb.tt +8 -0
  248. data/lib/rails/generators/rails/plugin/templates/lib/tasks/%namespaced_name%_tasks.rake.tt +4 -0
  249. data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +5 -0
  250. data/lib/rails/generators/rails/plugin/templates/rails/routes.rb.tt +3 -0
  251. data/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css +15 -0
  252. data/lib/rails/generators/rails/plugin/templates/rubocop.yml.tt +8 -0
  253. data/lib/rails/generators/rails/plugin/templates/test/%namespaced_name%_test.rb.tt +7 -0
  254. data/lib/rails/generators/rails/plugin/templates/test/application_system_test_case.rb.tt +5 -0
  255. data/lib/rails/generators/rails/plugin/templates/test/integration/navigation_test.rb.tt +7 -0
  256. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +21 -0
  257. data/lib/rails/generators/rails/resource/USAGE +23 -0
  258. data/lib/rails/generators/rails/resource/resource_generator.rb +27 -0
  259. data/lib/rails/generators/rails/resource_route/resource_route_generator.rb +23 -0
  260. data/lib/rails/generators/rails/scaffold/USAGE +41 -0
  261. data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +18 -0
  262. data/lib/rails/generators/rails/scaffold_controller/USAGE +19 -0
  263. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +56 -0
  264. data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +57 -0
  265. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +64 -0
  266. data/lib/rails/generators/rails/script/USAGE +18 -0
  267. data/lib/rails/generators/rails/script/script_generator.rb +18 -0
  268. data/lib/rails/generators/rails/script/templates/script.rb.tt +3 -0
  269. data/lib/rails/generators/rails/system_test/USAGE +10 -0
  270. data/lib/rails/generators/rails/system_test/system_test_generator.rb +9 -0
  271. data/lib/rails/generators/rails/task/USAGE +9 -0
  272. data/lib/rails/generators/rails/task/task_generator.rb +13 -0
  273. data/lib/rails/generators/rails/task/templates/task.rb.tt +8 -0
  274. data/lib/rails/generators/resource_helpers.rb +82 -0
  275. data/lib/rails/generators/test_case.rb +37 -0
  276. data/lib/rails/generators/test_unit/controller/controller_generator.rb +19 -0
  277. data/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt +23 -0
  278. data/lib/rails/generators/test_unit/generator/generator_generator.rb +27 -0
  279. data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +16 -0
  280. data/lib/rails/generators/test_unit/helper/helper_generator.rb +11 -0
  281. data/lib/rails/generators/test_unit/integration/integration_generator.rb +20 -0
  282. data/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt +9 -0
  283. data/lib/rails/generators/test_unit/job/job_generator.rb +20 -0
  284. data/lib/rails/generators/test_unit/job/templates/unit_test.rb.tt +9 -0
  285. data/lib/rails/generators/test_unit/mailer/mailer_generator.rb +28 -0
  286. data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +23 -0
  287. data/lib/rails/generators/test_unit/mailer/templates/preview.rb.tt +14 -0
  288. data/lib/rails/generators/test_unit/model/model_generator.rb +37 -0
  289. data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +29 -0
  290. data/lib/rails/generators/test_unit/model/templates/unit_test.rb.tt +9 -0
  291. data/lib/rails/generators/test_unit/plugin/plugin_generator.rb +15 -0
  292. data/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +7 -0
  293. data/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +2 -0
  294. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +82 -0
  295. data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +44 -0
  296. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +54 -0
  297. data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +57 -0
  298. data/lib/rails/generators/test_unit/system/system_generator.rb +24 -0
  299. data/lib/rails/generators/test_unit/system/templates/application_system_test_case.rb.tt +5 -0
  300. data/lib/rails/generators/test_unit/system/templates/system_test.rb.tt +9 -0
  301. data/lib/rails/generators/test_unit.rb +10 -0
  302. data/lib/rails/generators/testing/assertions.rb +147 -0
  303. data/lib/rails/generators/testing/behavior.rb +116 -0
  304. data/lib/rails/generators/testing/setup_and_teardown.rb +20 -0
  305. data/lib/rails/generators.rb +327 -0
  306. data/lib/rails/health_controller.rb +55 -0
  307. data/lib/rails/info.rb +105 -0
  308. data/lib/rails/info_controller.rb +71 -0
  309. data/lib/rails/initializable.rb +95 -0
  310. data/lib/rails/mailers_controller.rb +122 -0
  311. data/lib/rails/paths.rb +246 -0
  312. data/lib/rails/plugin/test.rb +9 -0
  313. data/lib/rails/pwa_controller.rb +15 -0
  314. data/lib/rails/rack/logger.rb +88 -0
  315. data/lib/rails/rack/silence_request.rb +33 -0
  316. data/lib/rails/rack.rb +8 -0
  317. data/lib/rails/rackup/server.rb +15 -0
  318. data/lib/rails/railtie/configurable.rb +36 -0
  319. data/lib/rails/railtie/configuration.rb +114 -0
  320. data/lib/rails/railtie.rb +302 -0
  321. data/lib/rails/source_annotation_extractor.rb +214 -0
  322. data/lib/rails/tasks/engine.rake +85 -0
  323. data/lib/rails/tasks/framework.rake +34 -0
  324. data/lib/rails/tasks/log.rake +41 -0
  325. data/lib/rails/tasks/misc.rake +68 -0
  326. data/lib/rails/tasks/statistics.rake +23 -0
  327. data/lib/rails/tasks/tmp.rake +51 -0
  328. data/lib/rails/tasks/yarn.rake +29 -0
  329. data/lib/rails/tasks/zeitwerk.rake +41 -0
  330. data/lib/rails/tasks.rb +17 -0
  331. data/lib/rails/templates/layouts/application.html.erb +51 -0
  332. data/lib/rails/templates/rails/info/notes.html.erb +65 -0
  333. data/lib/rails/templates/rails/info/properties.html.erb +1 -0
  334. data/lib/rails/templates/rails/info/routes.html.erb +9 -0
  335. data/lib/rails/templates/rails/mailers/email.html.erb +201 -0
  336. data/lib/rails/templates/rails/mailers/index.html.erb +15 -0
  337. data/lib/rails/templates/rails/mailers/mailer.html.erb +12 -0
  338. data/lib/rails/templates/rails/welcome/index.html.erb +93 -0
  339. data/lib/rails/test_help.rb +47 -0
  340. data/lib/rails/test_unit/line_filtering.rb +13 -0
  341. data/lib/rails/test_unit/railtie.rb +25 -0
  342. data/lib/rails/test_unit/reporter.rb +121 -0
  343. data/lib/rails/test_unit/runner.rb +209 -0
  344. data/lib/rails/test_unit/test_parser.rb +133 -0
  345. data/lib/rails/test_unit/testing.rake +39 -0
  346. data/lib/rails/testing/maintain_test_schema.rb +16 -0
  347. data/lib/rails/version.rb +10 -0
  348. data/lib/rails/welcome_controller.rb +11 -0
  349. data/lib/rails/zeitwerk_checker.rb +15 -0
  350. data/lib/rails.rb +130 -0
  351. metadata +518 -0
@@ -0,0 +1,114 @@
1
+ # PostgreSQL. Versions 9.3 and up are supported.
2
+ #
3
+ # Install the pg driver:
4
+ # gem install pg
5
+ # On macOS with Homebrew:
6
+ # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7
+ # On Windows:
8
+ # gem install pg
9
+ # Choose the win32 build.
10
+ # Install PostgreSQL and put its /bin directory on your path.
11
+ #
12
+ # Configure Using Gemfile
13
+ # gem "pg"
14
+ #
15
+ default: &default
16
+ adapter: postgresql
17
+ encoding: unicode
18
+ # For details on connection pooling, see Rails configuration guide
19
+ # https://guides.rubyonrails.org/configuring.html#database-pooling
20
+ pool: <%%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
21
+ <% if devcontainer? -%>
22
+ <%% if ENV["DB_HOST"] %>
23
+ host: <%%= ENV["DB_HOST"] %>
24
+ username: postgres
25
+ password: postgres
26
+ <%% end %>
27
+ <% end %>
28
+
29
+ development:
30
+ <<: *default
31
+ database: <%= app_name %>_development
32
+
33
+ # The specified database role being used to connect to PostgreSQL.
34
+ # To create additional roles in PostgreSQL see `$ createuser --help`.
35
+ # When left blank, PostgreSQL will use the default role. This is
36
+ # the same name as the operating system user running Rails.
37
+ #username: <%= app_name %>
38
+
39
+ # The password associated with the PostgreSQL role (username).
40
+ #password:
41
+
42
+ # Connect on a TCP socket. Omitted by default since the client uses a
43
+ # domain socket that doesn't need configuration. Windows does not have
44
+ # domain sockets, so uncomment these lines.
45
+ #host: localhost
46
+
47
+ # The TCP port the server listens on. Defaults to 5432.
48
+ # If your server runs on a different port number, change accordingly.
49
+ #port: 5432
50
+
51
+ # Schema search path. The server defaults to $user,public
52
+ #schema_search_path: myapp,sharedapp,public
53
+
54
+ # Minimum log levels, in increasing order:
55
+ # debug5, debug4, debug3, debug2, debug1,
56
+ # log, notice, warning, error, fatal, and panic
57
+ # Defaults to warning.
58
+ #min_messages: notice
59
+
60
+ # Warning: The database defined as "test" will be erased and
61
+ # re-generated from your development database when you run "rake".
62
+ # Do not set this db to the same as development or production.
63
+ test:
64
+ <<: *default
65
+ database: <%= app_name %>_test
66
+
67
+ # As with config/credentials.yml, you never want to store sensitive information,
68
+ # like your database password, in your source code. If your source code is
69
+ # ever seen by anyone, they now have access to your database.
70
+ #
71
+ # Instead, provide the password or a full connection URL as an environment
72
+ # variable when you boot the app. For example:
73
+ #
74
+ # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
75
+ #
76
+ # If the connection URL is provided in the special DATABASE_URL environment
77
+ # variable, Rails will automatically merge its configuration values on top of
78
+ # the values provided in this file. Alternatively, you can specify a connection
79
+ # URL environment variable explicitly:
80
+ #
81
+ # production:
82
+ # url: <%%= ENV["MY_APP_DATABASE_URL"] %>
83
+ #
84
+ # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
85
+ # for a full overview on how database connection configuration can be specified.
86
+ #
87
+ <%- if options.skip_solid? -%>
88
+ production:
89
+ <<: *default
90
+ database: <%= app_name %>_production
91
+ username: <%= app_name %>
92
+ password: <%%= ENV["<%= app_name.upcase %>_DATABASE_PASSWORD"] %>
93
+ <%- else -%>
94
+ production:
95
+ primary: &primary_production
96
+ <<: *default
97
+ database: <%= app_name %>_production
98
+ username: <%= app_name %>
99
+ password: <%%= ENV["<%= app_name.upcase %>_DATABASE_PASSWORD"] %>
100
+ cache:
101
+ <<: *primary_production
102
+ database: <%= app_name %>_production_cache
103
+ migrations_paths: db/cache_migrate
104
+ queue:
105
+ <<: *primary_production
106
+ database: <%= app_name %>_production_queue
107
+ migrations_paths: db/queue_migrate
108
+ <%- unless options.skip_action_cable? -%>
109
+ cable:
110
+ <<: *primary_production
111
+ database: <%= app_name %>_production_cable
112
+ migrations_paths: db/cable_migrate
113
+ <%- end -%>
114
+ <%- end -%>
@@ -0,0 +1,72 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem "sqlite3"
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: <%%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: storage/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: storage/test.sqlite3
22
+
23
+
24
+ <%- if options.skip_kamal? -%>
25
+ # SQLite3 write its data on the local filesystem, as such it requires
26
+ # persistent disks. If you are deploying to a managed service, you should
27
+ # make sure it provides disk persistence, as many don't.
28
+ #
29
+ # Similarly, if you deploy your application as a Docker container, you must
30
+ # ensure the database is located in a persisted volume.
31
+ <%- if options.skip_solid? -%>
32
+ production:
33
+ <<: *default
34
+ # database: path/to/persistent/storage/production.sqlite3
35
+ <%- else -%>
36
+ production:
37
+ primary:
38
+ <<: *default
39
+ # database: path/to/persistent/storage/production.sqlite3
40
+ cache:
41
+ <<: *default
42
+ # database: path/to/persistent/storage/production_cache.sqlite3
43
+ migrations_paths: db/cache_migrate
44
+ <%- end -%>
45
+ <%- else -%>
46
+ # Store production database in the storage/ directory, which by default
47
+ # is mounted as a persistent Docker volume in config/deploy.yml.
48
+ <%- if options.skip_solid? -%>
49
+ production:
50
+ <<: *default
51
+ database: storage/production.sqlite3
52
+ <%- else -%>
53
+ production:
54
+ primary:
55
+ <<: *default
56
+ database: storage/production.sqlite3
57
+ cache:
58
+ <<: *default
59
+ database: storage/production_cache.sqlite3
60
+ migrations_paths: db/cache_migrate
61
+ queue:
62
+ <<: *default
63
+ database: storage/production_queue.sqlite3
64
+ migrations_paths: db/queue_migrate
65
+ <%- unless options.skip_action_cable? -%>
66
+ cable:
67
+ <<: *default
68
+ database: storage/production_cable.sqlite3
69
+ migrations_paths: db/cable_migrate
70
+ <%- end -%>
71
+ <%- end -%>
72
+ <%- end -%>
@@ -0,0 +1,82 @@
1
+ # MySQL. Versions 5.5.8 and up are supported.
2
+ #
3
+ # Install the MySQL driver
4
+ # gem install trilogy
5
+ #
6
+ # Ensure the MySQL gem is defined in your Gemfile
7
+ # gem "trilogy"
8
+ #
9
+ # And be sure to use new-style password hashing:
10
+ # https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html
11
+ #
12
+ default: &default
13
+ adapter: trilogy
14
+ encoding: utf8mb4
15
+ pool: <%%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
16
+ username: root
17
+ password:
18
+ <% if database.socket -%>
19
+ socket: <%= database.socket %>
20
+ <% else -%>
21
+ host: <%%= ENV.fetch("DB_HOST") { "<%= database.host %>" } %>
22
+ <% end -%>
23
+
24
+ development:
25
+ <<: *default
26
+ database: <%= app_name %>_development
27
+
28
+ # Warning: The database defined as "test" will be erased and
29
+ # re-generated from your development database when you run "rake".
30
+ # Do not set this db to the same as development or production.
31
+ test:
32
+ <<: *default
33
+ database: <%= app_name %>_test
34
+
35
+ # As with config/credentials.yml, you never want to store sensitive information,
36
+ # like your database password, in your source code. If your source code is
37
+ # ever seen by anyone, they now have access to your database.
38
+ #
39
+ # Instead, provide the password or a full connection URL as an environment
40
+ # variable when you boot the app. For example:
41
+ #
42
+ # DATABASE_URL="trilogy://myuser:mypass@localhost/somedatabase"
43
+ #
44
+ # If the connection URL is provided in the special DATABASE_URL environment
45
+ # variable, Rails will automatically merge its configuration values on top of
46
+ # the values provided in this file. Alternatively, you can specify a connection
47
+ # URL environment variable explicitly:
48
+ #
49
+ # production:
50
+ # url: <%%= ENV["MY_APP_DATABASE_URL"] %>
51
+ #
52
+ # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
53
+ # for a full overview on how database connection configuration can be specified.
54
+ #
55
+ <%- if options.skip_solid? -%>
56
+ production:
57
+ <<: *default
58
+ database: <%= app_name %>_production
59
+ username: <%= app_name %>
60
+ password: <%%= ENV["<%= app_name.upcase %>_DATABASE_PASSWORD"] %>
61
+ <%- else -%>
62
+ production:
63
+ primary: &primary_production
64
+ <<: *default
65
+ database: <%= app_name %>_production
66
+ username: <%= app_name %>
67
+ password: <%%= ENV["<%= app_name.upcase %>_DATABASE_PASSWORD"] %>
68
+ cache:
69
+ <<: *primary_production
70
+ database: <%= app_name %>_production_cache
71
+ migrations_paths: db/cache_migrate
72
+ queue:
73
+ <<: *primary_production
74
+ database: <%= app_name %>_production_queue
75
+ migrations_paths: db/queue_migrate
76
+ <%- unless options.skip_action_cable? -%>
77
+ cable:
78
+ <<: *primary_production
79
+ database: <%= app_name %>_production_cable
80
+ migrations_paths: db/cable_migrate
81
+ <%- end -%>
82
+ <%- end -%>
@@ -0,0 +1,107 @@
1
+ # Name of your application. Used to uniquely configure containers.
2
+ service: <%= app_name %>
3
+
4
+ # Name of the container image.
5
+ image: your-user/<%= app_name %>
6
+
7
+ # Deploy to these servers.
8
+ servers:
9
+ web:
10
+ - 192.168.0.1
11
+ # job:
12
+ # hosts:
13
+ # - 192.168.0.1
14
+ # cmd: bin/jobs
15
+
16
+ # Credentials for your image host.
17
+ registry:
18
+ # Specify the registry server, if you're not using Docker Hub
19
+ # server: registry.digitalocean.com / ghcr.io / ...
20
+ username: your-user
21
+
22
+ # Always use an access token rather than real password when possible.
23
+ password:
24
+ - KAMAL_REGISTRY_PASSWORD
25
+
26
+ # Inject ENV variables into containers (secrets come from .env).
27
+ # Remember to run `kamal env push` after making changes!
28
+ env:
29
+ secret:
30
+ - RAILS_MASTER_KEY
31
+ <% if skip_solid? -%>
32
+ # clear:
33
+ # # Set number of cores available to the application on each server (default: 1).
34
+ # WEB_CONCURRENCY: 2
35
+
36
+ # # Match this to any external database server to configure Active Record correctly
37
+ # DB_HOST: 192.168.0.2
38
+ <% else -%>
39
+ clear:
40
+ # Run the Solid Queue Supervisor inside the web server's Puma process to do jobs.
41
+ # When you start using multiple servers, you should split out job processing to a dedicated machine.
42
+ SOLID_QUEUE_IN_PUMA: true
43
+
44
+ # Set number of processes dedicated to Solid Queue (default: 1)
45
+ # JOB_CONCURRENCY: 3
46
+
47
+ # Set number of cores available to the application on each server (default: 1).
48
+ # WEB_CONCURRENCY: 2
49
+
50
+ # Match this to any external database server to configure Active Record correctly
51
+ # DB_HOST: 192.168.0.2
52
+ <% end -%>
53
+
54
+ <% unless skip_storage? %>
55
+ # Use a persistent storage volume for sqlite database files and local Active Storage files.
56
+ # Recommended to change this to a mounted volume path that is backed up off server.
57
+ volumes:
58
+ - "<%= app_name %>_storage:/rails/storage"
59
+
60
+ <% end %>
61
+ # Bridge fingerprinted assets, like JS and CSS, between versions to avoid
62
+ # hitting 404 on in-flight requests. Combines all files from new and old
63
+ # version inside the asset_path.
64
+ asset_path: /rails/public/assets
65
+
66
+ # Use a different ssh user than root
67
+ # ssh:
68
+ # user: app
69
+
70
+ # Configure builder setup (defaults to multi-arch images).
71
+ # builder:
72
+ # # Build same-arch image locally (use for x86->x86)
73
+ # multiarch: false
74
+ #
75
+ # # Build diff-arch image via remote server
76
+ # remote:
77
+ # arch: amd64
78
+ # host: ssh://app@192.168.0.1
79
+ #
80
+ # args:
81
+ # RUBY_VERSION: <%= ENV["RBENV_VERSION"] || ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" %>
82
+ # secrets:
83
+ # - GITHUB_TOKEN
84
+ # - RAILS_MASTER_KEY
85
+
86
+ # Use accessory services (secrets come from .env).
87
+ # accessories:
88
+ # db:
89
+ # image: mysql:8.0
90
+ # host: 192.168.0.2
91
+ # port: 3306
92
+ # env:
93
+ # clear:
94
+ # MYSQL_ROOT_HOST: '%'
95
+ # secret:
96
+ # - MYSQL_ROOT_PASSWORD
97
+ # files:
98
+ # - config/mysql/production.cnf:/etc/mysql/my.cnf
99
+ # - db/production.sql:/docker-entrypoint-initdb.d/setup.sql
100
+ # directories:
101
+ # - data:/var/lib/mysql
102
+ # redis:
103
+ # image: redis:7.0
104
+ # host: 192.168.0.2
105
+ # port: 6379
106
+ # directories:
107
+ # - data:/data
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require_relative "application"
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,89 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # In the development environment your application's code is reloaded any time
7
+ # it changes. This slows down response time but is perfect for development
8
+ # since you don't have to restart the web server when you make code changes.
9
+ config.enable_reloading = true
10
+
11
+ # Do not eager load code on boot.
12
+ config.eager_load = false
13
+
14
+ # Show full error reports.
15
+ config.consider_all_requests_local = true
16
+
17
+ # Enable server timing.
18
+ config.server_timing = true
19
+
20
+ # Enable/disable Action Controller caching. By default Action Controller caching is disabled.
21
+ # Run rails dev:cache to toggle Action Controller caching.
22
+ if Rails.root.join("tmp/caching-dev.txt").exist?
23
+ <%- unless options.api? -%>
24
+ config.action_controller.perform_caching = true
25
+ config.action_controller.enable_fragment_cache_logging = true
26
+ <%- end -%>
27
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
28
+ else
29
+ config.action_controller.perform_caching = false
30
+ end
31
+
32
+ # Change this to :null_store to avoid any caching.
33
+ config.cache_store = :memory_store
34
+ <%- unless skip_active_storage? -%>
35
+
36
+ # Store uploaded files on the local file system (see config/storage.yml for options).
37
+ config.active_storage.service = :local
38
+ <%- end -%>
39
+ <%- unless options.skip_action_mailer? -%>
40
+
41
+ # Don't care if the mailer can't send.
42
+ config.action_mailer.raise_delivery_errors = false
43
+
44
+ # Disable caching for Action Mailer templates even if Action Controller
45
+ # caching is enabled.
46
+ config.action_mailer.perform_caching = false
47
+
48
+ # Set localhost to be used by links generated in mailer templates.
49
+ config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
50
+ <%- end -%>
51
+
52
+ # Print deprecation notices to the Rails logger.
53
+ config.active_support.deprecation = :log
54
+
55
+ <%- unless options.skip_active_record? -%>
56
+ # Raise an error on page load if there are pending migrations.
57
+ config.active_record.migration_error = :page_load
58
+
59
+ # Highlight code that triggered database queries in logs.
60
+ config.active_record.verbose_query_logs = true
61
+
62
+ # Append comments with runtime information tags to SQL queries in logs.
63
+ config.active_record.query_log_tags_enabled = true
64
+
65
+ <%- end -%>
66
+ <%- unless options[:skip_active_job] -%>
67
+ # Highlight code that enqueued background job in logs.
68
+ config.active_job.verbose_enqueue_logs = true
69
+
70
+ <%- end -%>
71
+ # Raises error for missing translations.
72
+ # config.i18n.raise_on_missing_translations = true
73
+
74
+ # Annotate rendered view with file names.
75
+ config.action_view.annotate_rendered_view_with_filenames = true
76
+
77
+ <%- unless skip_action_cable? -%>
78
+ # Uncomment if you wish to allow Action Cable access from any origin.
79
+ # config.action_cable.disable_request_forgery_protection = true
80
+
81
+ <%- end -%>
82
+ # Raise error when a before_action's only/except options reference missing actions.
83
+ config.action_controller.raise_on_missing_callback_actions = true
84
+ <%- unless skip_rubocop? -%>
85
+
86
+ # Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
87
+ # config.generators.apply_rubocop_autocorrect_after_generate!
88
+ <%- end -%>
89
+ end
@@ -0,0 +1,125 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.enable_reloading = false
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ <%- unless options.api? -%>
16
+ config.action_controller.perform_caching = true
17
+ <%- end -%>
18
+
19
+ # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
20
+ # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
21
+ # config.require_master_key = true
22
+
23
+ # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
24
+ # config.public_file_server.enabled = false
25
+
26
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
27
+ # config.asset_host = "http://assets.example.com"
28
+
29
+ # Specifies the header that your server uses for sending files.
30
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
31
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
32
+
33
+ <%- unless skip_active_storage? -%>
34
+ # Store uploaded files on the local file system (see config/storage.yml for options).
35
+ config.active_storage.service = :local
36
+
37
+ <%- end -%>
38
+ <%- unless skip_action_cable? -%>
39
+ # Mount Action Cable outside main process or domain.
40
+ # config.action_cable.mount_path = nil
41
+ # config.action_cable.url = "wss://example.com/cable"
42
+ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
43
+
44
+ <%- end -%>
45
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
46
+ # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
47
+ # config.assume_ssl = true
48
+
49
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
50
+ config.force_ssl = true
51
+
52
+ # Skip http-to-https redirect for the default health check endpoint.
53
+ # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
54
+
55
+ # Prevent health checks from clogging up the logs.
56
+ config.silence_healthcheck_path = "/up"
57
+
58
+ # Log to STDOUT by default.
59
+ config.logger = ActiveSupport::Logger.new(STDOUT)
60
+ .tap { |logger| logger.formatter = ::Logger::Formatter.new }
61
+ .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
62
+
63
+ # Prepend all log lines with the following tags.
64
+ config.log_tags = [ :request_id ]
65
+
66
+ # "info" includes generic and useful information about system operation, but avoids logging too much
67
+ # information to avoid inadvertent exposure of personally identifiable information (PII). If you
68
+ # want to log everything, set the level to "debug".
69
+ config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
70
+
71
+ # Use a different cache store in production.
72
+ # config.cache_store = :mem_cache_store
73
+
74
+ <%- unless options[:skip_active_job] -%>
75
+ # Use a real queuing backend for Active Job (and separate queues per environment).
76
+ # config.active_job.queue_adapter = :resque
77
+ # config.active_job.queue_name_prefix = "<%= app_name %>_production"
78
+
79
+ <%- end -%>
80
+ <%- unless options.skip_action_mailer? -%>
81
+ # Disable caching for Action Mailer templates even if Action Controller
82
+ # caching is enabled.
83
+ config.action_mailer.perform_caching = false
84
+
85
+ # Ignore bad email addresses and do not raise email delivery errors.
86
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
87
+ # config.action_mailer.raise_delivery_errors = false
88
+
89
+ # Set host to be used by links generated in mailer templates.
90
+ config.action_mailer.default_url_options = { host: "example.com" }
91
+
92
+ # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
93
+ # config.action_mailer.smtp_settings = {
94
+ # user_name: Rails.application.credentials.dig(:smtp, :user_name),
95
+ # password: Rails.application.credentials.dig(:smtp, :password),
96
+ # address: "smtp.example.com",
97
+ # port: 587,
98
+ # authentication: :plain
99
+ # }
100
+
101
+ <%- end -%>
102
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
103
+ # the I18n.default_locale when a translation cannot be found).
104
+ config.i18n.fallbacks = true
105
+
106
+ # Don't log any deprecations.
107
+ config.active_support.report_deprecations = false
108
+ <%- unless options.skip_active_record? -%>
109
+
110
+ # Do not dump schema after migrations.
111
+ config.active_record.dump_schema_after_migration = false
112
+
113
+ # Only use :id for inspections in production.
114
+ config.active_record.attributes_for_inspect = [:id]
115
+ <%- end -%>
116
+
117
+ # Enable DNS rebinding protection and other `Host` header attacks.
118
+ # config.hosts = [
119
+ # "example.com", # Allow requests from example.com
120
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
121
+ # ]
122
+ #
123
+ # Skip DNS rebinding protection for the default health check endpoint.
124
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
125
+ end
@@ -0,0 +1,62 @@
1
+ # The test environment is used exclusively to run your application's
2
+ # test suite. You never need to work with it otherwise. Remember that
3
+ # your test database is "scratch space" for the test suite and is wiped
4
+ # and recreated between test runs. Don't rely on the data there!
5
+
6
+ Rails.application.configure do
7
+ # Settings specified here will take precedence over those in config/application.rb.
8
+
9
+ # While tests run files are not watched, reloading is not necessary.
10
+ config.enable_reloading = false
11
+
12
+ # Eager loading loads your entire application. When running a single test locally,
13
+ # this is usually not necessary, and can slow down your test suite. However, it's
14
+ # recommended that you enable it in continuous integration systems to ensure eager
15
+ # loading is working properly before deploying your code.
16
+ config.eager_load = ENV["CI"].present?
17
+
18
+ # Configure public file server for tests with cache-control for performance.
19
+ config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
20
+
21
+ # Show full error reports and disable caching.
22
+ config.consider_all_requests_local = true
23
+ config.action_controller.perform_caching = false
24
+ config.cache_store = :null_store
25
+
26
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
27
+ config.action_dispatch.show_exceptions = :rescuable
28
+
29
+ # Disable request forgery protection in test environment.
30
+ config.action_controller.allow_forgery_protection = false
31
+
32
+ <%- unless skip_active_storage? -%>
33
+ # Store uploaded files on the local file system in a temporary directory.
34
+ config.active_storage.service = :test
35
+
36
+ <%- end -%>
37
+ <%- unless options.skip_action_mailer? -%>
38
+ # Disable caching for Action Mailer templates even if Action Controller
39
+ # caching is enabled.
40
+ config.action_mailer.perform_caching = false
41
+
42
+ # Tell Action Mailer not to deliver emails to the real world.
43
+ # The :test delivery method accumulates sent emails in the
44
+ # ActionMailer::Base.deliveries array.
45
+ config.action_mailer.delivery_method = :test
46
+
47
+ # Set host to be used by links generated in mailer templates.
48
+ config.action_mailer.default_url_options = { host: "example.com" }
49
+
50
+ <%- end -%>
51
+ # Print deprecation notices to the stderr.
52
+ config.active_support.deprecation = :stderr
53
+
54
+ # Raises error for missing translations.
55
+ # config.i18n.raise_on_missing_translations = true
56
+
57
+ # Annotate rendered view with file names.
58
+ # config.action_view.annotate_rendered_view_with_filenames = true
59
+
60
+ # Raise error when a before_action's only/except options reference missing actions.
61
+ config.action_controller.raise_on_missing_callback_actions = true
62
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = "1.0"
5
+
6
+ # Add additional assets to the asset load path.
7
+ # Rails.application.config.assets.paths << Emoji.images_path