my_api_client 1.3.1 → 2.0.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.
Files changed (248) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +8 -0
  3. data/.envrc.skeleton +0 -1
  4. data/.github/dependabot.yml +82 -7
  5. data/.github/workflows/ci.yml +334 -0
  6. data/.github/workflows/dependabot-auto-merge.yml +96 -0
  7. data/.github/workflows/release.yml +33 -0
  8. data/.github/workflows/rubocop_challenge.yml +33 -0
  9. data/.gitignore +1 -0
  10. data/.rubocop.yml +1 -1
  11. data/.ruby-version +1 -1
  12. data/AGENTS.md +128 -0
  13. data/CHANGELOG.md +54 -2
  14. data/CLAUDE.md +6 -0
  15. data/Dockerfile +22 -0
  16. data/Gemfile +1 -1
  17. data/Gemfile.lock +67 -59
  18. data/README.md +398 -62
  19. data/docker-compose.yml +29 -0
  20. data/docs/runbooks/dependabot_pr_auto_merge.md +113 -0
  21. data/gemfiles/rails_7.2.gemfile +1 -1
  22. data/gemfiles/{rails_7.1.gemfile → rails_8.0.gemfile} +2 -2
  23. data/gemfiles/{rails_6.1.gemfile → rails_8.1.gemfile} +2 -2
  24. data/lib/my_api_client/default_error_handlers.rb +1 -1
  25. data/lib/my_api_client/errors/client_error.rb +5 -1
  26. data/lib/my_api_client/integrations/bugsnag.rb +1 -1
  27. data/lib/my_api_client/version.rb +1 -1
  28. data/lib/my_api_client.rb +1 -1
  29. data/my_api/.ruby-version +1 -1
  30. data/my_api/AGENTS.md +35 -0
  31. data/my_api/Dockerfile +25 -0
  32. data/my_api/Gemfile +5 -16
  33. data/my_api/Gemfile.lock +263 -228
  34. data/my_api/README.md +36 -25
  35. data/my_api/Rakefile +3 -2
  36. data/my_api/app/controllers/application_controller.rb +1 -2
  37. data/my_api/app/controllers/error_controller.rb +2 -2
  38. data/my_api/app/controllers/header_controller.rb +6 -3
  39. data/my_api/app/controllers/pagination_controller.rb +5 -15
  40. data/my_api/app/controllers/rest_controller.rb +12 -16
  41. data/my_api/app/controllers/status_controller.rb +3 -4
  42. data/my_api/config/application.rb +12 -67
  43. data/{rails_app/rails_6.1 → my_api}/config/boot.rb +1 -1
  44. data/{rails_app/rails_7.1 → my_api}/config/environment.rb +0 -2
  45. data/my_api/config/environments/development.rb +6 -6
  46. data/my_api/config/environments/production.rb +5 -8
  47. data/my_api/config/environments/test.rb +5 -6
  48. data/my_api/config/routes.rb +2 -10
  49. data/my_api/config.ru +2 -4
  50. data/my_api/public/index.html +10 -90
  51. data/{rails_app/rails_7.0 → my_api}/spec/rails_helper.rb +3 -4
  52. data/my_api/spec/requests/error_controller_spec.rb +18 -0
  53. data/my_api/spec/requests/pagination_controller_spec.rb +22 -0
  54. data/my_api/spec/requests/rest_controller_spec.rb +22 -0
  55. data/my_api/spec/requests/status_controller_spec.rb +20 -0
  56. data/my_api/spec/spec_helper.rb +15 -23
  57. data/my_api_client.gemspec +2 -2
  58. data/rails_app/AGENTS.md +13 -0
  59. data/rails_app/rails_7.2/Dockerfile +1 -1
  60. data/rails_app/rails_7.2/Gemfile +2 -0
  61. data/rails_app/rails_7.2/Gemfile.lock +143 -122
  62. data/rails_app/{rails_7.1 → rails_8.0}/.dockerignore +16 -2
  63. data/rails_app/{rails_6.1 → rails_8.0}/.gitattributes +2 -1
  64. data/rails_app/rails_8.0/.github/workflows/ci.yml +39 -0
  65. data/rails_app/{rails_6.1 → rails_8.0}/.gitignore +11 -7
  66. data/rails_app/rails_8.0/.rubocop.yml +8 -0
  67. data/rails_app/rails_8.0/.ruby-version +1 -0
  68. data/rails_app/{rails_7.1 → rails_8.0}/Dockerfile +28 -18
  69. data/rails_app/rails_8.0/Gemfile +15 -0
  70. data/rails_app/rails_8.0/Gemfile.lock +286 -0
  71. data/rails_app/{rails_6.1 → rails_8.0}/Rakefile +1 -3
  72. data/rails_app/{rails_7.1 → rails_8.0}/app/controllers/application_controller.rb +0 -2
  73. data/rails_app/rails_8.0/app/jobs/application_job.rb +7 -0
  74. data/rails_app/rails_8.0/app/mailers/application_mailer.rb +4 -0
  75. data/rails_app/{rails_7.0 → rails_8.0}/app/models/application_record.rb +0 -2
  76. data/rails_app/rails_8.0/app/views/layouts/mailer.html.erb +13 -0
  77. data/rails_app/rails_8.0/app/views/layouts/mailer.text.erb +1 -0
  78. data/rails_app/rails_8.0/bin/brakeman +7 -0
  79. data/rails_app/rails_8.0/bin/dev +2 -0
  80. data/rails_app/rails_8.0/bin/docker-entrypoint +14 -0
  81. data/rails_app/rails_8.0/bin/rails +4 -0
  82. data/rails_app/rails_8.0/bin/rake +4 -0
  83. data/rails_app/rails_8.0/bin/rubocop +8 -0
  84. data/rails_app/{rails_7.1 → rails_8.0}/bin/setup +11 -12
  85. data/rails_app/rails_8.0/bin/thrust +5 -0
  86. data/rails_app/{rails_7.1 → rails_8.0}/config/application.rb +14 -16
  87. data/rails_app/rails_8.0/config/boot.rb +3 -0
  88. data/rails_app/rails_8.0/config/cable.yml +10 -0
  89. data/rails_app/rails_8.0/config/credentials.yml.enc +1 -0
  90. data/rails_app/{rails_7.1 → rails_8.0}/config/database.yml +18 -2
  91. data/rails_app/{rails_6.1 → rails_8.0}/config/environment.rb +1 -3
  92. data/rails_app/rails_8.0/config/environments/development.rb +70 -0
  93. data/rails_app/rails_8.0/config/environments/production.rb +86 -0
  94. data/rails_app/{rails_7.1 → rails_8.0}/config/environments/test.rb +16 -19
  95. data/rails_app/{rails_7.1 → rails_8.0}/config/initializers/cors.rb +0 -1
  96. data/rails_app/{rails_7.1 → rails_8.0}/config/initializers/filter_parameter_logging.rb +2 -4
  97. data/rails_app/{rails_7.0 → rails_8.0}/config/initializers/inflections.rb +0 -1
  98. data/rails_app/rails_8.0/config/puma.rb +41 -0
  99. data/rails_app/{rails_7.1 → rails_8.0}/config/routes.rb +1 -3
  100. data/rails_app/rails_8.0/config/storage.yml +34 -0
  101. data/rails_app/{rails_7.1 → rails_8.0}/config.ru +1 -3
  102. data/rails_app/{rails_7.1 → rails_8.0}/db/seeds.rb +0 -1
  103. data/rails_app/{rails_7.1 → rails_8.0}/spec/rails_helper.rb +1 -1
  104. data/rails_app/rails_8.1/.dockerignore +45 -0
  105. data/rails_app/rails_8.1/.gitattributes +9 -0
  106. data/rails_app/rails_8.1/.github/workflows/ci.yml +52 -0
  107. data/rails_app/rails_8.1/.gitignore +33 -0
  108. data/rails_app/rails_8.1/.rspec +1 -0
  109. data/rails_app/rails_8.1/.rubocop.yml +8 -0
  110. data/rails_app/rails_8.1/.ruby-version +1 -0
  111. data/rails_app/rails_8.1/Dockerfile +68 -0
  112. data/rails_app/rails_8.1/Gemfile +15 -0
  113. data/rails_app/rails_8.1/Gemfile.lock +289 -0
  114. data/rails_app/{rails_7.0 → rails_8.1}/Rakefile +1 -3
  115. data/rails_app/{rails_6.1 → rails_8.1}/app/controllers/application_controller.rb +0 -2
  116. data/rails_app/rails_8.1/app/jobs/application_job.rb +7 -0
  117. data/rails_app/rails_8.1/app/mailers/application_mailer.rb +4 -0
  118. data/rails_app/{rails_7.1 → rails_8.1}/app/models/application_record.rb +0 -2
  119. data/rails_app/rails_8.1/app/views/layouts/mailer.html.erb +13 -0
  120. data/rails_app/rails_8.1/app/views/layouts/mailer.text.erb +1 -0
  121. data/rails_app/rails_8.1/bin/brakeman +7 -0
  122. data/rails_app/rails_8.1/bin/bundler-audit +6 -0
  123. data/rails_app/rails_8.1/bin/ci +6 -0
  124. data/rails_app/rails_8.1/bin/dev +2 -0
  125. data/rails_app/{rails_7.1 → rails_8.1}/bin/docker-entrypoint +1 -1
  126. data/rails_app/rails_8.1/bin/rails +4 -0
  127. data/rails_app/rails_8.1/bin/rake +4 -0
  128. data/rails_app/rails_8.1/bin/rubocop +8 -0
  129. data/rails_app/{rails_7.0 → rails_8.1}/bin/setup +13 -13
  130. data/rails_app/rails_8.1/bin/thrust +5 -0
  131. data/rails_app/{rails_6.1 → rails_8.1}/config/application.rb +19 -17
  132. data/rails_app/rails_8.1/config/boot.rb +3 -0
  133. data/rails_app/rails_8.1/config/bundler-audit.yml +5 -0
  134. data/rails_app/rails_8.1/config/cable.yml +10 -0
  135. data/rails_app/rails_8.1/config/ci.rb +19 -0
  136. data/rails_app/rails_8.1/config/credentials.yml.enc +1 -0
  137. data/rails_app/rails_8.1/config/database.yml +40 -0
  138. data/rails_app/{rails_7.0 → rails_8.1}/config/environment.rb +1 -3
  139. data/rails_app/rails_8.1/config/environments/development.rb +73 -0
  140. data/rails_app/rails_8.1/config/environments/production.rb +86 -0
  141. data/rails_app/rails_8.1/config/environments/test.rb +53 -0
  142. data/rails_app/{rails_7.0 → rails_8.1}/config/initializers/cors.rb +1 -2
  143. data/rails_app/rails_8.1/config/initializers/filter_parameter_logging.rb +8 -0
  144. data/rails_app/{rails_7.1 → rails_8.1}/config/initializers/inflections.rb +0 -1
  145. data/rails_app/rails_8.1/config/locales/en.yml +31 -0
  146. data/rails_app/rails_8.1/config/puma.rb +42 -0
  147. data/rails_app/rails_8.1/config/routes.rb +10 -0
  148. data/rails_app/rails_8.1/config/storage.yml +27 -0
  149. data/rails_app/{rails_7.0 → rails_8.1}/config.ru +1 -3
  150. data/rails_app/rails_8.1/db/seeds.rb +9 -0
  151. data/rails_app/{rails_6.1 → rails_8.1}/spec/rails_helper.rb +1 -2
  152. metadata +139 -136
  153. data/.circleci/config.yml +0 -344
  154. data/README.jp.md +0 -785
  155. data/gemfiles/rails_7.0.gemfile +0 -15
  156. data/my_api/.envrc.skeleton +0 -3
  157. data/my_api/.jetskeep +0 -1
  158. data/my_api/Procfile +0 -7
  159. data/my_api/app/helpers/application_helper.rb +0 -5
  160. data/my_api/app/jobs/application_job.rb +0 -7
  161. data/my_api/app/models/application_item.rb +0 -5
  162. data/my_api/config/dynamodb.yml +0 -22
  163. data/my_api/spec/controllers/error_controller_spec.rb +0 -43
  164. data/my_api/spec/controllers/header_controller_spec.rb +0 -33
  165. data/my_api/spec/controllers/pagination_controller_spec.rb +0 -73
  166. data/my_api/spec/controllers/rest_controller_spec.rb +0 -99
  167. data/my_api/spec/controllers/status_controller_spec.rb +0 -47
  168. data/my_api/spec/fixtures/payloads/posts-index.json +0 -51
  169. data/my_api/spec/fixtures/payloads/posts-show.json +0 -53
  170. data/rails_app/rails_6.1/.rspec +0 -3
  171. data/rails_app/rails_6.1/Gemfile +0 -17
  172. data/rails_app/rails_6.1/Gemfile.lock +0 -195
  173. data/rails_app/rails_6.1/app/models/application_record.rb +0 -5
  174. data/rails_app/rails_6.1/bin/bundle +0 -122
  175. data/rails_app/rails_6.1/bin/rails +0 -6
  176. data/rails_app/rails_6.1/bin/rake +0 -6
  177. data/rails_app/rails_6.1/bin/setup +0 -35
  178. data/rails_app/rails_6.1/config/credentials.yml.enc +0 -1
  179. data/rails_app/rails_6.1/config/database.yml +0 -25
  180. data/rails_app/rails_6.1/config/environments/development.rb +0 -59
  181. data/rails_app/rails_6.1/config/environments/production.rb +0 -97
  182. data/rails_app/rails_6.1/config/environments/test.rb +0 -51
  183. data/rails_app/rails_6.1/config/initializers/application_controller_renderer.rb +0 -9
  184. data/rails_app/rails_6.1/config/initializers/backtrace_silencers.rb +0 -10
  185. data/rails_app/rails_6.1/config/initializers/cors.rb +0 -17
  186. data/rails_app/rails_6.1/config/initializers/filter_parameter_logging.rb +0 -8
  187. data/rails_app/rails_6.1/config/initializers/inflections.rb +0 -17
  188. data/rails_app/rails_6.1/config/initializers/mime_types.rb +0 -5
  189. data/rails_app/rails_6.1/config/initializers/wrap_parameters.rb +0 -16
  190. data/rails_app/rails_6.1/config/locales/en.yml +0 -33
  191. data/rails_app/rails_6.1/config/routes.rb +0 -5
  192. data/rails_app/rails_6.1/config.ru +0 -8
  193. data/rails_app/rails_6.1/db/seeds.rb +0 -8
  194. data/rails_app/rails_7.0/Gemfile +0 -13
  195. data/rails_app/rails_7.0/Gemfile.lock +0 -212
  196. data/rails_app/rails_7.0/app/controllers/application_controller.rb +0 -4
  197. data/rails_app/rails_7.0/bin/bundle +0 -122
  198. data/rails_app/rails_7.0/bin/rails +0 -6
  199. data/rails_app/rails_7.0/bin/rake +0 -6
  200. data/rails_app/rails_7.0/config/application.rb +0 -41
  201. data/rails_app/rails_7.0/config/boot.rb +0 -5
  202. data/rails_app/rails_7.0/config/credentials.yml.enc +0 -1
  203. data/rails_app/rails_7.0/config/database.yml +0 -25
  204. data/rails_app/rails_7.0/config/environments/development.rb +0 -58
  205. data/rails_app/rails_7.0/config/environments/production.rb +0 -70
  206. data/rails_app/rails_7.0/config/environments/test.rb +0 -52
  207. data/rails_app/rails_7.0/config/initializers/filter_parameter_logging.rb +0 -8
  208. data/rails_app/rails_7.0/config/locales/en.yml +0 -33
  209. data/rails_app/rails_7.0/config/routes.rb +0 -8
  210. data/rails_app/rails_7.0/db/seeds.rb +0 -8
  211. data/rails_app/rails_7.1/Gemfile +0 -16
  212. data/rails_app/rails_7.1/Gemfile.lock +0 -241
  213. data/rails_app/rails_7.1/README.md +0 -24
  214. data/rails_app/rails_7.1/Rakefile +0 -8
  215. data/rails_app/rails_7.1/bin/bundle +0 -122
  216. data/rails_app/rails_7.1/bin/rails +0 -6
  217. data/rails_app/rails_7.1/bin/rake +0 -6
  218. data/rails_app/rails_7.1/config/boot.rb +0 -5
  219. data/rails_app/rails_7.1/config/credentials.yml.enc +0 -1
  220. data/rails_app/rails_7.1/config/environments/development.rb +0 -58
  221. data/rails_app/rails_7.1/config/environments/production.rb +0 -74
  222. data/rails_app/rails_7.1/config/puma.rb +0 -46
  223. data/rails_app/rails_7.1/public/robots.txt +0 -2
  224. data/rails_app/rails_7.1/spec/spec_helper.rb +0 -13
  225. data/rails_app/rails_7.1/vendor/.keep +0 -0
  226. data/rails_app/rails_7.2/.github/dependabot.yml +0 -12
  227. /data/rails_app/{rails_7.1 → rails_8.0}/.rspec +0 -0
  228. /data/rails_app/{rails_6.1 → rails_8.0}/README.md +0 -0
  229. /data/rails_app/{rails_6.1 → rails_8.0}/app/controllers/concerns/.keep +0 -0
  230. /data/rails_app/{rails_6.1/app/javascript → rails_8.0/app/models/concerns}/.keep +0 -0
  231. /data/rails_app/{rails_7.1 → rails_8.0}/config/locales/en.yml +0 -0
  232. /data/rails_app/{rails_6.1/app/models/concerns → rails_8.0/lib/tasks}/.keep +0 -0
  233. /data/rails_app/{rails_6.1/lib/tasks → rails_8.0/log}/.keep +0 -0
  234. /data/rails_app/{rails_6.1 → rails_8.0}/public/robots.txt +0 -0
  235. /data/rails_app/{rails_6.1/tmp → rails_8.0/script}/.keep +0 -0
  236. /data/rails_app/{rails_6.1 → rails_8.0}/spec/spec_helper.rb +0 -0
  237. /data/rails_app/{rails_6.1/tmp/pids → rails_8.0/storage}/.keep +0 -0
  238. /data/rails_app/{rails_6.1 → rails_8.0}/vendor/.keep +0 -0
  239. /data/rails_app/{rails_7.0 → rails_8.1}/README.md +0 -0
  240. /data/rails_app/{rails_7.1 → rails_8.1}/app/controllers/concerns/.keep +0 -0
  241. /data/rails_app/{rails_7.1 → rails_8.1}/app/models/concerns/.keep +0 -0
  242. /data/rails_app/{rails_7.1 → rails_8.1}/lib/tasks/.keep +0 -0
  243. /data/rails_app/{rails_7.1/storage → rails_8.1/log}/.keep +0 -0
  244. /data/rails_app/{rails_7.0 → rails_8.1}/public/robots.txt +0 -0
  245. /data/rails_app/{rails_7.1/tmp → rails_8.1/script}/.keep +0 -0
  246. /data/rails_app/{rails_7.0 → rails_8.1}/spec/spec_helper.rb +0 -0
  247. /data/rails_app/{rails_7.1/tmp/pids → rails_8.1/storage}/.keep +0 -0
  248. /data/rails_app/{rails_7.1/tmp/storage → rails_8.1/vendor}/.keep +0 -0
@@ -0,0 +1,73 @@
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
+ # Make code changes take effect immediately without server restart.
7
+ config.enable_reloading = true
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
14
+
15
+ # Enable server timing.
16
+ config.server_timing = true
17
+
18
+ # Enable/disable Action Controller caching. By default Action Controller caching is disabled.
19
+ # Run rails dev:cache to toggle Action Controller caching.
20
+ if Rails.root.join("tmp/caching-dev.txt").exist?
21
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
22
+ else
23
+ config.action_controller.perform_caching = false
24
+ end
25
+
26
+ # Change to :null_store to avoid any caching.
27
+ config.cache_store = :memory_store
28
+
29
+ # Store uploaded files on the local file system (see config/storage.yml for options).
30
+ config.active_storage.service = :local
31
+
32
+ # Don't care if the mailer can't send.
33
+ config.action_mailer.raise_delivery_errors = false
34
+
35
+ # Make template changes take effect immediately.
36
+ config.action_mailer.perform_caching = false
37
+
38
+ # Set localhost to be used by links generated in mailer templates.
39
+ config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
40
+
41
+ # Print deprecation notices to the Rails logger.
42
+ config.active_support.deprecation = :log
43
+
44
+ # Raise an error on page load if there are pending migrations.
45
+ config.active_record.migration_error = :page_load
46
+
47
+ # Highlight code that triggered database queries in logs.
48
+ config.active_record.verbose_query_logs = true
49
+
50
+ # Append comments with runtime information tags to SQL queries in logs.
51
+ config.active_record.query_log_tags_enabled = true
52
+
53
+ # Highlight code that enqueued background job in logs.
54
+ config.active_job.verbose_enqueue_logs = true
55
+
56
+ # Highlight code that triggered redirect in logs.
57
+ config.action_dispatch.verbose_redirect_logs = true
58
+
59
+ # Raises error for missing translations.
60
+ # config.i18n.raise_on_missing_translations = true
61
+
62
+ # Annotate rendered view with file names.
63
+ config.action_view.annotate_rendered_view_with_filenames = true
64
+
65
+ # Uncomment if you wish to allow Action Cable access from any origin.
66
+ # config.action_cable.disable_request_forgery_protection = true
67
+
68
+ # Raise error when a before_action's only/except options reference missing actions.
69
+ config.action_controller.raise_on_missing_callback_actions = true
70
+
71
+ # Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
72
+ # config.generators.apply_rubocop_autocorrect_after_generate!
73
+ end
@@ -0,0 +1,86 @@
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
+ # Code is not reloaded between requests.
7
+ config.enable_reloading = false
8
+
9
+ # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
10
+ config.eager_load = true
11
+
12
+ # Full error reports are disabled.
13
+ config.consider_all_requests_local = false
14
+
15
+ # Cache assets for far-future expiry since they are all digest stamped.
16
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
17
+
18
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
19
+ # config.asset_host = "http://assets.example.com"
20
+
21
+ # Store uploaded files on the local file system (see config/storage.yml for options).
22
+ config.active_storage.service = :local
23
+
24
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
25
+ # config.assume_ssl = true
26
+
27
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
28
+ # config.force_ssl = true
29
+
30
+ # Skip http-to-https redirect for the default health check endpoint.
31
+ # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
32
+
33
+ # Log to STDOUT with the current request id as a default log tag.
34
+ config.log_tags = [ :request_id ]
35
+ config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
36
+
37
+ # Change to "debug" to log everything (including potentially personally-identifiable information!).
38
+ config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
39
+
40
+ # Prevent health checks from clogging up the logs.
41
+ config.silence_healthcheck_path = "/up"
42
+
43
+ # Don't log any deprecations.
44
+ config.active_support.report_deprecations = false
45
+
46
+ # Replace the default in-process memory cache store with a durable alternative.
47
+ # config.cache_store = :mem_cache_store
48
+
49
+ # Replace the default in-process and non-durable queuing backend for Active Job.
50
+ # config.active_job.queue_adapter = :resque
51
+
52
+ # Ignore bad email addresses and do not raise email delivery errors.
53
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
54
+ # config.action_mailer.raise_delivery_errors = false
55
+
56
+ # Set host to be used by links generated in mailer templates.
57
+ config.action_mailer.default_url_options = { host: "example.com" }
58
+
59
+ # Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit.
60
+ # config.action_mailer.smtp_settings = {
61
+ # user_name: Rails.application.credentials.dig(:smtp, :user_name),
62
+ # password: Rails.application.credentials.dig(:smtp, :password),
63
+ # address: "smtp.example.com",
64
+ # port: 587,
65
+ # authentication: :plain
66
+ # }
67
+
68
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69
+ # the I18n.default_locale when a translation cannot be found).
70
+ config.i18n.fallbacks = true
71
+
72
+ # Do not dump schema after migrations.
73
+ config.active_record.dump_schema_after_migration = false
74
+
75
+ # Only use :id for inspections in production.
76
+ config.active_record.attributes_for_inspect = [ :id ]
77
+
78
+ # Enable DNS rebinding protection and other `Host` header attacks.
79
+ # config.hosts = [
80
+ # "example.com", # Allow requests from example.com
81
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
82
+ # ]
83
+ #
84
+ # Skip DNS rebinding protection for the default health check endpoint.
85
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
86
+ end
@@ -0,0 +1,53 @@
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.
22
+ config.consider_all_requests_local = true
23
+ config.cache_store = :null_store
24
+
25
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
26
+ config.action_dispatch.show_exceptions = :rescuable
27
+
28
+ # Disable request forgery protection in test environment.
29
+ config.action_controller.allow_forgery_protection = false
30
+
31
+ # Store uploaded files on the local file system in a temporary directory.
32
+ config.active_storage.service = :test
33
+
34
+ # Tell Action Mailer not to deliver emails to the real world.
35
+ # The :test delivery method accumulates sent emails in the
36
+ # ActionMailer::Base.deliveries array.
37
+ config.action_mailer.delivery_method = :test
38
+
39
+ # Set host to be used by links generated in mailer templates.
40
+ config.action_mailer.default_url_options = { host: "example.com" }
41
+
42
+ # Print deprecation notices to the stderr.
43
+ config.active_support.deprecation = :stderr
44
+
45
+ # Raises error for missing translations.
46
+ # config.i18n.raise_on_missing_translations = true
47
+
48
+ # Annotate rendered view with file names.
49
+ # config.action_view.annotate_rendered_view_with_filenames = true
50
+
51
+ # Raise error when a before_action's only/except options reference missing actions.
52
+ config.action_controller.raise_on_missing_callback_actions = true
53
+ end
@@ -1,8 +1,7 @@
1
- # frozen_string_literal: true
2
1
  # Be sure to restart your server when you modify this file.
3
2
 
4
3
  # Avoid CORS issues when API is called from the frontend app.
5
- # Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests.
4
+ # Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin Ajax requests.
6
5
 
7
6
  # Read more: https://github.com/cyu/rack-cors
8
7
 
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4
+ # Use this to limit dissemination of sensitive information.
5
+ # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6
+ Rails.application.config.filter_parameters += [
7
+ :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
8
+ ]
@@ -1,4 +1,3 @@
1
- # frozen_string_literal: true
2
1
  # Be sure to restart your server when you modify this file.
3
2
 
4
3
  # Add new inflection rules using the following format. Inflections
@@ -0,0 +1,31 @@
1
+ # Files in the config/locales directory are used for internationalization and
2
+ # are automatically loaded by Rails. If you want to use locales other than
3
+ # English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t "hello"
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t("hello") %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more about the API, please read the Rails Internationalization guide
20
+ # at https://guides.rubyonrails.org/i18n.html.
21
+ #
22
+ # Be aware that YAML interprets the following case-insensitive strings as
23
+ # booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
24
+ # must be quoted to be interpreted as strings. For example:
25
+ #
26
+ # en:
27
+ # "yes": yup
28
+ # enabled: "ON"
29
+
30
+ en:
31
+ hello: "Hello world"
@@ -0,0 +1,42 @@
1
+ # This configuration file will be evaluated by Puma. The top-level methods that
2
+ # are invoked here are part of Puma's configuration DSL. For more information
3
+ # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
4
+ #
5
+ # Puma starts a configurable number of processes (workers) and each process
6
+ # serves each request in a thread from an internal thread pool.
7
+ #
8
+ # You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
9
+ # should only set this value when you want to run 2 or more workers. The
10
+ # default is already 1. You can set it to `auto` to automatically start a worker
11
+ # for each available processor.
12
+ #
13
+ # The ideal number of threads per worker depends both on how much time the
14
+ # application spends waiting for IO operations and on how much you wish to
15
+ # prioritize throughput over latency.
16
+ #
17
+ # As a rule of thumb, increasing the number of threads will increase how much
18
+ # traffic a given process can handle (throughput), but due to CRuby's
19
+ # Global VM Lock (GVL) it has diminishing returns and will degrade the
20
+ # response time (latency) of the application.
21
+ #
22
+ # The default is set to 3 threads as it's deemed a decent compromise between
23
+ # throughput and latency for the average Rails application.
24
+ #
25
+ # Any libraries that use a connection pool or another resource pool should
26
+ # be configured to provide at least as many connections as the number of
27
+ # threads. This includes Active Record's `pool` parameter in `database.yml`.
28
+ threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
29
+ threads threads_count, threads_count
30
+
31
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
32
+ port ENV.fetch("PORT", 3000)
33
+
34
+ # Allow puma to be restarted by `bin/rails restart` command.
35
+ plugin :tmp_restart
36
+
37
+ # Run the Solid Queue supervisor inside of Puma for single-server deployments.
38
+ plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
39
+
40
+ # Specify the PID file. Defaults to tmp/pids/server.pid in development.
41
+ # In other environments, only set the PID file if requested.
42
+ pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
@@ -0,0 +1,10 @@
1
+ Rails.application.routes.draw do
2
+ # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
3
+
4
+ # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
5
+ # Can be used by load balancers and uptime monitors to verify that the app is live.
6
+ get "up" => "rails/health#show", as: :rails_health_check
7
+
8
+ # Defines the root path route ("/")
9
+ # root "posts#index"
10
+ end
@@ -0,0 +1,27 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+ # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+ # amazon:
11
+ # service: S3
12
+ # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+ # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+ # region: us-east-1
15
+ # bucket: your_own_bucket-<%= Rails.env %>
16
+
17
+ # Remember not to checkin your GCS keyfile to a repository
18
+ # google:
19
+ # service: GCS
20
+ # project: your_project
21
+ # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+ # bucket: your_own_bucket-<%= Rails.env %>
23
+
24
+ # mirror:
25
+ # service: Mirror
26
+ # primary: local
27
+ # mirrors: [ amazon, google, microsoft ]
@@ -1,8 +1,6 @@
1
- # frozen_string_literal: true
2
-
3
1
  # This file is used by Rack-based servers to start the application.
4
2
 
5
- require_relative 'config/environment'
3
+ require_relative "config/environment"
6
4
 
7
5
  run Rails.application
8
6
  Rails.application.load_server
@@ -0,0 +1,9 @@
1
+ # This file should ensure the existence of records required to run the application in every environment (production,
2
+ # development, test). The code here should be idempotent so that it can be executed at any point in every environment.
3
+ # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
4
+ #
5
+ # Example:
6
+ #
7
+ # ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
8
+ # MovieGenre.find_or_create_by!(name: genre_name)
9
+ # end
@@ -2,13 +2,12 @@
2
2
 
3
3
  require 'spec_helper'
4
4
  ENV['RAILS_ENV'] ||= 'test'
5
- require File.expand_path('../config/environment', __dir__)
5
+ require_relative '../config/environment'
6
6
  abort('The Rails environment is running in production mode!') if Rails.env.production?
7
7
  require 'rspec/rails'
8
8
  require 'my_api_client/rspec'
9
9
 
10
10
  RSpec.configure do |config|
11
- # config.use_active_record = false # [Workaround] See: https://github.com/rspec/rspec-rails/issues/2417
12
11
  config.infer_spec_type_from_file_location!
13
12
  config.filter_rails_from_backtrace!
14
13
  end