convenient_service 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/.dev/.tmuxinator.yml +2 -1
  3. data/.github/workflows/ci.yml +21 -1
  4. data/CHANGELOG.md +67 -0
  5. data/Gemfile +6 -0
  6. data/README.md +4 -2
  7. data/Taskfile.yml +94 -0
  8. data/convenient_service.gemspec +40 -2
  9. data/docker/2.7/Dockerfile +3 -3
  10. data/docker/3.0/Dockerfile +2 -2
  11. data/docker/3.1/Dockerfile +2 -2
  12. data/docker/3.2/Dockerfile +73 -0
  13. data/docker/jruby-9.4/Dockerfile +88 -0
  14. data/docker/truffleruby-22.3/Dockerfile +91 -0
  15. data/lib/convenient_service/common/plugins/aliases.rb +0 -1
  16. data/lib/convenient_service/common/plugins/assigns_attributes_in_constructor/using_active_model_attribute_assignment/middleware.rb +12 -8
  17. data/lib/convenient_service/common/plugins/caches_return_value/middleware.rb +3 -3
  18. data/lib/convenient_service/common/plugins/can_have_user_provided_entity/errors.rb +2 -2
  19. data/lib/convenient_service/common/plugins/has_around_callbacks/errors.rb +1 -1
  20. data/lib/convenient_service/common/plugins/has_callbacks/entities/callback.rb +7 -7
  21. data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/aliases.rb +7 -0
  22. data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins.rb +2 -0
  23. data/lib/convenient_service/configs/minimal.rb +19 -10
  24. data/lib/convenient_service/core/class_methods.rb +24 -9
  25. data/lib/convenient_service/core/constants.rb +36 -0
  26. data/lib/convenient_service/core/entities/config/commands/track_method_missing_commit_trigger.rb +69 -0
  27. data/lib/convenient_service/core/entities/config/commands.rb +3 -0
  28. data/lib/convenient_service/core/entities/config/entities/concerns/entities/stack.rb +10 -10
  29. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/chain.rb +3 -3
  30. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware.rb +18 -1
  31. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creator.rb +62 -0
  32. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/stack.rb +12 -12
  33. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities.rb +1 -0
  34. data/lib/convenient_service/core/entities/config/entities/method_middlewares.rb +1 -1
  35. data/lib/convenient_service/core/entities/config/errors.rb +38 -1
  36. data/lib/convenient_service/core/entities/config.rb +14 -4
  37. data/lib/convenient_service/core/instance_methods.rb +6 -4
  38. data/lib/convenient_service/core.rb +1 -0
  39. data/lib/convenient_service/dependencies/built_in.rb +7 -0
  40. data/lib/convenient_service/dependencies/extractions/active_support_concern/concern.rb +18 -2
  41. data/lib/convenient_service/dependencies/extractions/active_support_concern.rb +4 -0
  42. data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/builder.rb +7 -1
  43. data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/logger.rb +7 -1
  44. data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/runner.rb +15 -1
  45. data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware.rb +8 -1
  46. data/lib/convenient_service/dependencies/extractions/ruby_middleware.rb +3 -2
  47. data/lib/convenient_service/dependencies.rb +16 -15
  48. data/lib/convenient_service/examples/dry/gemfile.rb +4 -4
  49. data/lib/convenient_service/examples/rails/gemfile.rb +4 -4
  50. data/lib/convenient_service/examples/standard/cowsay.rb +4 -4
  51. data/lib/convenient_service/examples/standard/gemfile/services/assert_file_exists.rb +1 -1
  52. data/lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb +1 -1
  53. data/lib/convenient_service/examples/standard/gemfile/services/assert_node_available.rb +0 -9
  54. data/lib/convenient_service/examples/standard/gemfile/services/assert_npm_package_available.rb +0 -10
  55. data/lib/convenient_service/examples/standard/gemfile/services/format.rb +0 -10
  56. data/lib/convenient_service/examples/standard/gemfile/services/merge_sections.rb +0 -10
  57. data/lib/convenient_service/examples/standard/gemfile/services/parse_content.rb +0 -10
  58. data/lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb +0 -10
  59. data/lib/convenient_service/examples/standard/gemfile/services/replace_file_content.rb +0 -10
  60. data/lib/convenient_service/examples/standard/gemfile.rb +4 -4
  61. data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_body.rb +0 -10
  62. data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_path.rb +0 -10
  63. data/lib/convenient_service/examples/standard/request_params/services/validate_casted_params.rb +0 -10
  64. data/lib/convenient_service/examples/standard/request_params/services/validate_uncasted_params.rb +0 -10
  65. data/lib/convenient_service/examples/standard/request_params.rb +4 -4
  66. data/lib/convenient_service/feature.rb +12 -0
  67. data/lib/convenient_service/logger.rb +6 -5
  68. data/lib/convenient_service/rspec/helpers/custom/in_threads.rb +74 -0
  69. data/lib/convenient_service/rspec/helpers/custom/stub_service/constants.rb +20 -0
  70. data/lib/convenient_service/rspec/helpers/custom/stub_service/entities/stubbed_service.rb +4 -4
  71. data/lib/convenient_service/rspec/helpers/custom/stub_service.rb +1 -0
  72. data/lib/convenient_service/rspec/helpers/custom/wrap_method/entities/wrapped_method.rb +3 -3
  73. data/lib/convenient_service/rspec/helpers/custom/wrap_method/errors.rb +1 -1
  74. data/lib/convenient_service/rspec/helpers/custom.rb +1 -0
  75. data/lib/convenient_service/rspec/helpers/in_threads.rb +13 -0
  76. data/lib/convenient_service/rspec/helpers.rb +2 -0
  77. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings_collection/errors.rb +3 -3
  78. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/delegation.rb +3 -3
  79. data/lib/convenient_service/rspec/matchers/custom/export.rb +82 -0
  80. data/lib/convenient_service/rspec/matchers/custom/results/base/constants.rb +22 -0
  81. data/lib/convenient_service/rspec/matchers/custom/results/base/errors.rb +1 -1
  82. data/lib/convenient_service/rspec/matchers/custom/results/base.rb +2 -1
  83. data/lib/convenient_service/rspec/matchers/custom.rb +1 -0
  84. data/lib/convenient_service/rspec/matchers/export.rb +13 -0
  85. data/lib/convenient_service/rspec/matchers.rb +2 -0
  86. data/lib/convenient_service/service/plugins/aliases.rb +0 -2
  87. data/lib/convenient_service/service/plugins/can_have_method_steps/middleware.rb +2 -2
  88. data/lib/convenient_service/service/plugins/can_have_result_step/middleware.rb +2 -2
  89. data/lib/convenient_service/service/plugins/can_have_steps/concern.rb +2 -2
  90. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method.rb +46 -11
  91. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method_direction.rb +29 -2
  92. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method_factory.rb +113 -0
  93. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands.rb +1 -3
  94. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/base.rb +62 -0
  95. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/base.rb +35 -0
  96. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/proc_value.rb +42 -0
  97. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/raw_value.rb +42 -0
  98. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/reassignment_value.rb +42 -0
  99. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/string_value.rb +42 -0
  100. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/symbol_value.rb +42 -0
  101. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash.rb +8 -0
  102. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/method.rb +40 -0
  103. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/reassignment.rb +40 -0
  104. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/string.rb +40 -0
  105. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/symbol.rb +40 -0
  106. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories.rb +8 -0
  107. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities.rb +1 -0
  108. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/errors.rb +7 -7
  109. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/errors.rb +12 -8
  110. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/aliases.rb +7 -0
  111. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins.rb +2 -0
  112. data/lib/convenient_service/service/plugins/can_have_steps/entities/step_collection.rb +37 -8
  113. data/lib/convenient_service/service/plugins/can_have_stubbed_result/concern.rb +19 -11
  114. data/lib/convenient_service/service/plugins/can_have_stubbed_result/middleware.rb +3 -3
  115. data/lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb +3 -3
  116. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/aliases.rb +7 -0
  117. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/concern.rb +12 -5
  118. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes/concern/class_methods.rb → can_have_parent_result/constants.rb} +3 -4
  119. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result.rb +1 -0
  120. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb → has_j_send_status_and_attributes/commands/cast_j_send_attributes.rb} +1 -1
  121. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands/create_code_class.rb +49 -0
  122. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands/create_data_class.rb +49 -0
  123. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands/create_message_class.rb +49 -0
  124. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands/create_status_class.rb +49 -0
  125. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands.rb +7 -0
  126. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/concern/class_methods.rb +69 -0
  127. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/concern/instance_methods.rb +9 -9
  128. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/concern.rb +1 -1
  129. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/entities/code/concern/class_methods.rb +2 -2
  130. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/entities/code/concern/instance_methods.rb +3 -3
  131. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/entities/code/concern.rb +1 -1
  132. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/entities/code.rb +1 -1
  133. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/class_methods.rb +38 -0
  134. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/instance_methods.rb +94 -0
  135. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern.rb +36 -0
  136. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data.rb +25 -0
  137. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/class_methods.rb +40 -0
  138. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb +58 -0
  139. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern.rb +36 -0
  140. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message.rb +25 -0
  141. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/class_methods.rb +40 -0
  142. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb +115 -0
  143. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern.rb +36 -0
  144. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status.rb +25 -0
  145. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/errors.rb +6 -2
  146. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/middleware.rb +4 -4
  147. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes/structs/jsend_attributes.rb → has_j_send_status_and_attributes/structs/j_send_attributes.rb} +1 -1
  148. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/structs.rb +3 -0
  149. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes.rb +8 -0
  150. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax/concern.rb +3 -3
  151. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/raises_on_not_checked_result_status/errors.rb +1 -1
  152. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins.rb +3 -1
  153. data/lib/convenient_service/service/plugins/has_result/errors.rb +2 -2
  154. data/lib/convenient_service/service/plugins/has_result_status_check_short_syntax/concern.rb +16 -0
  155. data/lib/convenient_service/service/plugins/raises_on_double_result/errors.rb +1 -1
  156. data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_backtrace.rb +1 -1
  157. data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_exception.rb +11 -10
  158. data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/middleware.rb +14 -7
  159. data/lib/convenient_service/services/run_own_method_in_organizer.rb +1 -1
  160. data/lib/convenient_service/support/abstract_method/errors.rb +1 -1
  161. data/lib/convenient_service/support/arguments.rb +3 -3
  162. data/lib/convenient_service/support/cache/key.rb +3 -3
  163. data/lib/convenient_service/support/cache.rb +1 -1
  164. data/lib/convenient_service/support/castable/errors.rb +2 -2
  165. data/lib/convenient_service/support/counter.rb +212 -0
  166. data/lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb +33 -0
  167. data/lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb +58 -0
  168. data/lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb +4 -3
  169. data/lib/convenient_service/support/dependency_container/commands/define_entry.rb +49 -0
  170. data/lib/convenient_service/support/dependency_container/commands.rb +3 -0
  171. data/lib/convenient_service/support/dependency_container/container.rb +23 -0
  172. data/lib/convenient_service/support/dependency_container/entry.rb +22 -0
  173. data/lib/convenient_service/support/dependency_container/errors.rb +5 -5
  174. data/lib/convenient_service/support/dependency_container/import.rb +3 -3
  175. data/lib/convenient_service/support/dependency_container.rb +3 -0
  176. data/lib/convenient_service/support/finite_loop.rb +37 -2
  177. data/lib/convenient_service/support/middleware/stack_builder.rb +1 -1
  178. data/lib/convenient_service/support/not_passed.rb +4 -3
  179. data/lib/convenient_service/support/ruby.rb +31 -0
  180. data/lib/convenient_service/support/safe_method.rb +65 -0
  181. data/lib/convenient_service/support/thread_safe_counter.rb +119 -0
  182. data/lib/convenient_service/support/undefined.rb +4 -3
  183. data/lib/convenient_service/support/unique_value.rb +69 -0
  184. data/lib/convenient_service/support.rb +4 -0
  185. data/lib/convenient_service/utils/array/errors.rb +1 -1
  186. data/lib/convenient_service/utils/array/find_last.rb +1 -1
  187. data/lib/convenient_service/utils/array/find_yield.rb +1 -1
  188. data/lib/convenient_service/utils/object/resolve_class.rb +56 -0
  189. data/lib/convenient_service/utils/object.rb +9 -0
  190. data/lib/convenient_service/version.rb +1 -1
  191. data/lib/convenient_service.rb +6 -0
  192. metadata +75 -34
  193. data/lib/convenient_service/factories/arguments.rb +0 -43
  194. data/lib/convenient_service/factories/results.rb +0 -214
  195. data/lib/convenient_service/factories/services.rb +0 -229
  196. data/lib/convenient_service/factories/step/instance.rb +0 -42
  197. data/lib/convenient_service/factories/step.rb +0 -3
  198. data/lib/convenient_service/factories/steps.rb +0 -126
  199. data/lib/convenient_service/factories.rb +0 -22
  200. data/lib/convenient_service/factory.rb +0 -21
  201. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method_caller.rb +0 -74
  202. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method_key.rb +0 -78
  203. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method_name.rb +0 -78
  204. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands.rb +0 -3
  205. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/data/class_methods.rb +0 -32
  206. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/data.rb +0 -74
  207. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/message/class_methods.rb +0 -34
  208. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/message.rb +0 -45
  209. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/status/class_methods.rb +0 -34
  210. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/status.rb +0 -77
  211. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/structs.rb +0 -3
  212. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes.rb +0 -8
  213. /data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/entities.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1f3cda1e00bba0f7e8c4e86e8831d6bb55385302c2da872cc6a205970938558
4
- data.tar.gz: be1745b3ef9fbc5e7c892d2b15b65eda18afa2879a8c5253d67effe3c9f0c506
3
+ metadata.gz: e26ca79641e2ead4052a1cb3132bf2a3a6707eed8c59f0d0258fe366ed0b9b16
4
+ data.tar.gz: 7c82db04e08d196c52dc1f4d7c6b49e01fc7c9db0fb6bd262128a406b92a56dd
5
5
  SHA512:
6
- metadata.gz: 9fe6b8fe017c94dec0516b342d1d1bce0ee968487b94cb0695414a5f5781c4cd95e1b42ec2e31f746df430caec82e2c2d39c6423d638bf838d17ab72ba8816c6
7
- data.tar.gz: 4972e2fe5f288b989d42260eb86f4750614a9a16bc2b08a98eae2f6b94c8fb32f10d05daf33f37c9213ec1e134f4962a7c4d9dfba380351c801811acc7eabb01
6
+ metadata.gz: a30ce3ce1cc65f6fea74870b60d0e5f109c8d7e32873d7250abf4eba43339e3e045c474ca4b0f148e6465b6a22b4494ab8e0db7a880b673b44e3c181d0f771b4
7
+ data.tar.gz: aece2e76d26bad28d3ed9e3faef31eee4db5db4542677b4c4e943cff4b29ae4f741bfdbe2e1091c0716b4960df4d639e18593d19bb3f479c04b55930be55847a
data/.dev/.tmuxinator.yml CHANGED
@@ -13,5 +13,6 @@ windows:
13
13
  panes:
14
14
  - task docker:bash:ruby_2.7
15
15
  - task docker:bash:ruby_3.0
16
- - task docker:bash:ruby_3.1
16
+ - task docker:bash:jruby_9.4
17
+ - task docker:bash:truffleruby_22.3
17
18
  - git status
@@ -60,7 +60,7 @@ jobs:
60
60
  - name: Set up Ruby
61
61
  uses: ruby/setup-ruby@v1
62
62
  with:
63
- ruby-version: 3.1
63
+ ruby-version: 3.2
64
64
  ##
65
65
  # NOTE: Installs the latest compatible Bundler version, runs `bundle install` and caches installed gems.
66
66
  # - https://github.com/ruby/setup-ruby#usage
@@ -88,6 +88,9 @@ jobs:
88
88
  # That is why the well-known Ubuntu is used.
89
89
  # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
90
90
  #
91
+ # NOTE: List of all possible Ruby, JRuby versions.
92
+ # https://github.com/ruby/setup-ruby/blob/master/ruby-builder-versions.json
93
+ #
91
94
  runs-on: ubuntu-20.04
92
95
  strategy:
93
96
  matrix:
@@ -101,6 +104,23 @@ jobs:
101
104
  #
102
105
  - "3.0"
103
106
  - 3.1
107
+ - 3.2
108
+ ##
109
+ # NOTE: JRuby 9.4 aims CRuby 3.1 compatibility.
110
+ # - https://www.jruby.org/download
111
+ #
112
+ - "jruby-9.4"
113
+ ##
114
+ # NOTE: TruffleRuby 22.3 aims CRuby 3.1 compatibility.
115
+ # - https://www.jruby.org/download
116
+ #
117
+ # IMPORTANT: TruffleRuby 22.3 is currently disabled since too many specs are failing due to CRuby uncompatible code.
118
+ #
119
+ # NOTE: Use `task docker:bash:truffleruby_22.3` and then `task rspec` to reproduce them locally.
120
+ #
121
+ # TODO: Make ConvenientService TruffleRuby 22.3 compatible.
122
+ #
123
+ # - "truffleruby-22.3"
104
124
  env:
105
125
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
106
126
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,72 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.12.0](https://github.com/marian13/convenient_service/compare/v0.11.0...v0.12.0) (2023-04-01)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **has_j_send_status_and_attributes:** use Jsend to JSend
9
+ * **can_have_method_steps:** bring back CanHaveMethodSteps since it is thread-safe
10
+
11
+ ### Features
12
+
13
+ * **be_result:** add trigger for BE_RESULT ([d7a416e](https://github.com/marian13/convenient_service/commit/d7a416e39377378655740d9997695c0100b60258))
14
+ * **can_have_method_steps:** bring back CanHaveMethodSteps since it is thread-safe ([cbd4f35](https://github.com/marian13/convenient_service/commit/cbd4f35fa22c85f8005582ac06118d1f63337984))
15
+ * **core:** add config constants ([7438742](https://github.com/marian13/convenient_service/commit/7438742268cb808f082cdb9a1a36e8698d73a662))
16
+ * **core:** add method_missing_commits_counter ([9f143a0](https://github.com/marian13/convenient_service/commit/9f143a02c49b078ddbb3a953dc657b1c4c992494))
17
+ * **core:** add trigger for config commitment in class method missing ([97a4acf](https://github.com/marian13/convenient_service/commit/97a4acf06d30e08411790db917867da53f49653b))
18
+ * **core:** add trigger for config commitment in instance method missing ([e1ebfc0](https://github.com/marian13/convenient_service/commit/e1ebfc028d157cadd8a70ebc7321883986db6633))
19
+ * **core:** add trigger for RESOLVE_METHOD_MIDDLEWARES_SUPER_METHOD ([d419985](https://github.com/marian13/convenient_service/commit/d419985dca3e348b1ee8607aadfd2ea4a0cc84be))
20
+ * **core:** add trigger option commit_config! ([2c7c041](https://github.com/marian13/convenient_service/commit/2c7c041f7602710db53e2caf9ab4061579254983))
21
+ * **core:** default commit trigger to user ([127822a](https://github.com/marian13/convenient_service/commit/127822a7da2e6e4c95272e627d101f68ce0f5479))
22
+ * **core:** introduce config commitment triggers ([b92ee50](https://github.com/marian13/convenient_service/commit/b92ee50d7216b6e49464449f9678071bada0109b))
23
+ * **core:** introduce middleware arguments ([5ca7868](https://github.com/marian13/convenient_service/commit/5ca7868181d44f0f1eb1f2958270e4c6bbb76646))
24
+ * **core:** introduce Middleware.with ([4272262](https://github.com/marian13/convenient_service/commit/427226258cce031679c51a5b4ea900506c995c4a))
25
+ * **core:** introduce MiddlewareCreator ([d1b6ce8](https://github.com/marian13/convenient_service/commit/d1b6ce89fdc008359f9fd0ed080c3cfb28bd39b7))
26
+ * **core:** MiddlewareCreator#new ([e36cee9](https://github.com/marian13/convenient_service/commit/e36cee97a8cceb70fe7564bde516dc31f4b37157))
27
+ * **core:** track method_missing commit triggers ([f3a7264](https://github.com/marian13/convenient_service/commit/f3a7264e3ddb67976fbf2e1c875df15f6f133c0b))
28
+ * **depencency_container:** introduce entry ([a905b6e](https://github.com/marian13/convenient_service/commit/a905b6e90cf656a409246f17be84d39c3b4f79c6))
29
+ * **feature:** introduce initial feature ([7413273](https://github.com/marian13/convenient_service/commit/7413273af1d5abad4aee912cc8bffe8f1d6d1d0b))
30
+ * **finite_loop:** introduce FiniteLoop.finite_loop ([ae363c1](https://github.com/marian13/convenient_service/commit/ae363c1b159692b5ef42f09bb6250ee7615d4ffe))
31
+ * **has_jsend_status_and_attributes:** allow user to provide Code, Data, Message and Status classes ([ff9703e](https://github.com/marian13/convenient_service/commit/ff9703e91c310d6223fbf8c9142c9e41d58498ba))
32
+ * **has_result_status_check_short_syntax:** Add two more short bool result checks ([a8a8a8b](https://github.com/marian13/convenient_service/commit/a8a8a8b2c7d6ff90249488dffff892dff90bf914))
33
+ * **in_threads:** introduce in_threads RSpec helper ([dbd54ac](https://github.com/marian13/convenient_service/commit/dbd54ac86f75f45ad03bedd2622efc3d7055d4a2))
34
+ * **rescues_result_unhandled_exceptions:** read max_backtrace_size from middleware arguments ([6d7de5e](https://github.com/marian13/convenient_service/commit/6d7de5ecd38d2a9bc7bc719aa44e86f3a31694d7))
35
+ * **ruby_middleware:** add support of middleware creators ([06bcc15](https://github.com/marian13/convenient_service/commit/06bcc15f6f600e4fc40ec7e1842495f2b37edfd0))
36
+ * **ruby:** check if jruby ([fba70da](https://github.com/marian13/convenient_service/commit/fba70daf5713fa99384e860e33c7db32de4b9e91))
37
+ * **ruby:** check if truffleruby ([341ced1](https://github.com/marian13/convenient_service/commit/341ced193953cd8c51a97ac3c4cb8822433485f0))
38
+ * **stub_service:** add trigger for STUB_SERVICE ([047c835](https://github.com/marian13/convenient_service/commit/047c8358cafd86d84ced0f300440d4a08ee10994))
39
+ * support ruby 3.2 in CI and Docker ([4dc26b9](https://github.com/marian13/convenient_service/commit/4dc26b93c074870362cafaaa15d9625542d51b92))
40
+ * **support:** introduce thread_safe_counter ([ea25f15](https://github.com/marian13/convenient_service/commit/ea25f159091b7bfd71af593e9dadcdb015606a53))
41
+ * **support:** introduce UniqueValue ([b007123](https://github.com/marian13/convenient_service/commit/b0071230455ad80cd206c1e34eb5f59a6f90af61))
42
+ * **support:** safe_method ([b37d735](https://github.com/marian13/convenient_service/commit/b37d735c03b08e57d930c9d5cb1c7cd089a07e0a))
43
+ * **support:** ThreadSafeCounter#current_value= ([bf703bb](https://github.com/marian13/convenient_service/commit/bf703bb80e4bdac62edff930ea9e524012dbd221))
44
+ * **thread_safe_counter:** introduce bincrement and bdecrement ([a0ef972](https://github.com/marian13/convenient_service/commit/a0ef9729eb3bb1e22536375ce7e9cb57a0f7fa7b))
45
+ * **unique_value:** add == consistency ([26c8686](https://github.com/marian13/convenient_service/commit/26c8686cbf52caa932d677d080dc283943b048cb))
46
+ * **unique_value:** add comparisons ([cf02a50](https://github.com/marian13/convenient_service/commit/cf02a505ca1f34e70d50236f691ebbc89fdcb29f))
47
+ * **utils:** introduce Object.resolve_class ([94f6ca2](https://github.com/marian13/convenient_service/commit/94f6ca2178c8bb048b35b10c74d60385fa003079))
48
+
49
+
50
+ ### Bug Fixes
51
+
52
+ * **can_have_steps:** set correct error namaspace ([1f6d647](https://github.com/marian13/convenient_service/commit/1f6d647e1babdd2c565390691a56442ad0fd315c))
53
+ * **can_have_stubbed_result:** add thread-safety ([ef77058](https://github.com/marian13/convenient_service/commit/ef77058a877c903a6156875d02d436ac4216174a))
54
+ * **core:** remove typo in description ([a34323f](https://github.com/marian13/convenient_service/commit/a34323f1a20a0667aba6fdceb77476345a26d1d3))
55
+ * **dependency_container:** remove typo ([fbcfd28](https://github.com/marian13/convenient_service/commit/fbcfd28ccd6747da5c7e7b48aa620206403264e9))
56
+ * **has_result_status_check_short_syntax:** Correct implementation of two methods ([5cf6004](https://github.com/marian13/convenient_service/commit/5cf6004bdfe49973452846e452dbcd087074b723))
57
+ * **logger:** update ENV variable ([86301ce](https://github.com/marian13/convenient_service/commit/86301ce98bcfa18a4bdb7e4d34c283493865bc76))
58
+ * **support:** group examples ([97549e9](https://github.com/marian13/convenient_service/commit/97549e9d2e342041a7d5b64d2bf68dbcedf73ca2))
59
+
60
+
61
+ ### Miscellaneous Chores
62
+
63
+ * release 0.12.0 ([da182b6](https://github.com/marian13/convenient_service/commit/da182b694865ea5e10163193b3219439a6d3be3e))
64
+
65
+
66
+ ### Code Refactoring
67
+
68
+ * **has_j_send_status_and_attributes:** use Jsend to JSend ([ffb2642](https://github.com/marian13/convenient_service/commit/ffb26424f9ce8f176a148c146c238a2bb1c77ce6))
69
+
3
70
  ## [0.11.0](https://github.com/marian13/convenient_service/compare/v0.10.1...v0.11.0) (2023-03-04)
4
71
 
5
72
 
data/Gemfile CHANGED
@@ -4,3 +4,9 @@ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in convenient_service.gemspec
6
6
  gemspec
7
+
8
+ group :development, :test do
9
+ # NOTE: Temporarily pointing appraisal at the commit in the main branch until the following issue is resolved:
10
+ # https://github.com/thoughtbot/appraisal/issues/199
11
+ gem "appraisal", github: "thoughtbot/appraisal", ref: "b200e636903700098bef25f4f51dbc4c46e4c04c"
12
+ end
data/README.md CHANGED
@@ -14,7 +14,9 @@
14
14
  <!-- header:end -->
15
15
 
16
16
  <!-- badges:start -->
17
- [![Gem Version](https://badge.fury.io/rb/convenient_service.svg)](https://rubygems.org/gems/convenient_service) [![GitHub Actions CI](https://github.com/marian13/convenient_service/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/marian13/convenient_service/actions/workflows/ci.yml) [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard) [![Coverage Status](https://coveralls.io/repos/github/marian13/convenient_service/badge.svg)](https://coveralls.io/github/marian13/convenient_service?branch=main) [![inline docs](http://inch-ci.org/github/marian13/convenient_service.svg?branch=main)](http://inch-ci.org/github/marian13/convenient_service)
17
+ [![Ruby](https://img.shields.io/badge/ruby-%23CC342D.svg?style=for-the-badge&logo=ruby&logoColor=white)](https://www.ruby-lang.org/en/)
18
+
19
+ [![Gem Version](https://badge.fury.io/rb/convenient_service.svg)](https://rubygems.org/gems/convenient_service) [![Gem Downloads](https://img.shields.io/gem/dt/convenient_service.svg)](https://rubygems.org/gems/convenient_service) ![visitors](https://visitor-badge.glitch.me/badge?page_id=marian13/convenient_service) [![GitHub Actions CI](https://github.com/marian13/convenient_service/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/marian13/convenient_service/actions/workflows/ci.yml) [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard) [![Coverage Status](https://coveralls.io/repos/github/marian13/convenient_service/badge.svg)](https://coveralls.io/github/marian13/convenient_service?branch=main) [![inline docs](http://inch-ci.org/github/marian13/convenient_service.svg?branch=main)](http://inch-ci.org/github/marian13/convenient_service) [![yard docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://marian13.github.io/convenient_service/)
18
20
  [![Convenient Service on stackoverflow](https://img.shields.io/badge/stackoverflow-community-orange.svg?logo=stackoverflow)](https://stackoverflow.com/tags/convenient-service)
19
21
  [![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/user?u=31435716&fan_landing=true)
20
22
  [![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -34,7 +36,7 @@ Yet another approach to revisit the service object pattern, but this time focusi
34
36
  <!-- warning:start -->
35
37
  ## WARNING ❗❗❗
36
38
 
37
- This library is under heavy development. Public API may be subject to change. The first major release is still to come. Use the current version at your own risk. Ruby 2.7+. Thanks.
39
+ This library is under heavy development. Public API may be subject to change. The first major release is still to come. Use the current version at your own risk. Ruby 2.7+, JRuby 9.4+ (TruffleRuby support is planned as well). Thanks.
38
40
  <!-- features:end -->
39
41
  <!-- warning:end -->
40
42
 
data/Taskfile.yml CHANGED
@@ -67,11 +67,46 @@ tasks:
67
67
  - sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
68
68
  msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
69
69
 
70
+ docker:bash:ruby_3.2:
71
+ cmds:
72
+ - docker run --rm -it -v $(pwd):/gem convenient_service:3.2 bash
73
+ interactive: true
74
+ preconditions:
75
+ - sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
76
+ msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
77
+
78
+ ##
79
+ # NOTE: JRuby 9.4 aims CRuby 3.1 compatibility.
80
+ # - https://www.jruby.org/download
81
+ #
82
+ docker:bash:jruby_9.4:
83
+ cmds:
84
+ - docker run --rm -it -v $(pwd):/gem convenient_service:jruby-9.4 bash
85
+ interactive: true
86
+ preconditions:
87
+ - sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
88
+ msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
89
+
90
+ ##
91
+ # NOTE: TruffleRuby 22.3 aims CRuby 3.1 compatibility.
92
+ # - https://github.com/oracle/truffleruby/blob/master/doc/user/compatibility.md
93
+ #
94
+ docker:bash:truffleruby_22.3:
95
+ cmds:
96
+ - docker run --rm -it -v $(pwd):/gem convenient_service:truffleruby-22.3 bash
97
+ interactive: true
98
+ preconditions:
99
+ - sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
100
+ msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
101
+
70
102
  docker:build:
71
103
  cmds:
72
104
  - task: docker:build:ruby_2.7
73
105
  - task: docker:build:ruby_3.0
74
106
  - task: docker:build:ruby_3.1
107
+ - task: docker:build:ruby_3.2
108
+ - task: docker:build:jruby_9.4
109
+ - task: docker:build:truffleruby_22.3
75
110
  preconditions:
76
111
  - sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
77
112
  msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
@@ -127,6 +162,65 @@ tasks:
127
162
  - sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
128
163
  msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
129
164
 
165
+ docker:build:ruby_3.2:
166
+ cmds:
167
+ ##
168
+ # NOTE: Meaning of `|| 2> /dev/null`.
169
+ # https://stackoverflow.com/a/10250395/12201472
170
+ #
171
+ # NOTE: Meaning of `|| true`.
172
+ # https://superuser.com/a/887349/1180656
173
+ #
174
+ - rm Gemfile.3.2 2> /dev/null || true
175
+ - rm Gemfile.3.2.lock 2> /dev/null || true
176
+ - cp Gemfile Gemfile.3.2
177
+ - docker build . -f docker/3.2/Dockerfile -t convenient_service:3.2
178
+ preconditions:
179
+ - sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
180
+ msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
181
+
182
+ ##
183
+ # NOTE: JRuby 9.4 aims CRuby 3.1 compatibility.
184
+ # - https://www.jruby.org/download
185
+ #
186
+ docker:build:jruby_9.4:
187
+ cmds:
188
+ ##
189
+ # NOTE: Meaning of `|| 2> /dev/null`.
190
+ # https://stackoverflow.com/a/10250395/12201472
191
+ #
192
+ # NOTE: Meaning of `|| true`.
193
+ # https://superuser.com/a/887349/1180656
194
+ #
195
+ - rm Gemfile.jruby-9.4 2> /dev/null || true
196
+ - rm Gemfile.jruby-9.4.lock 2> /dev/null || true
197
+ - cp Gemfile Gemfile.jruby-9.4
198
+ - docker build . -f docker/jruby-9.4/Dockerfile -t convenient_service:jruby-9.4
199
+ preconditions:
200
+ - sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
201
+ msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
202
+
203
+ ##
204
+ # NOTE: TruffleRuby 22.3 aims CRuby 3.1 compatibility.
205
+ # - https://github.com/oracle/truffleruby/blob/master/doc/user/compatibility.md
206
+ #
207
+ docker:build:truffleruby_22.3:
208
+ cmds:
209
+ ##
210
+ # NOTE: Meaning of `|| 2> /dev/null`.
211
+ # https://stackoverflow.com/a/10250395/12201472
212
+ #
213
+ # NOTE: Meaning of `|| true`.
214
+ # https://superuser.com/a/887349/1180656
215
+ #
216
+ - rm Gemfile.truffleruby-22.3 2> /dev/null || true
217
+ - rm Gemfile.truffleruby-22.3.lock 2> /dev/null || true
218
+ - cp Gemfile Gemfile.truffleruby-22.3
219
+ - docker build . -f docker/truffleruby-22.3/Dockerfile -t convenient_service:truffleruby-22.3
220
+ preconditions:
221
+ - sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
222
+ msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
223
+
130
224
  ##
131
225
  # NOTE: Dev only command.
132
226
  # NOTE: macOS specific command.
@@ -3,6 +3,13 @@
3
3
  require_relative "lib/convenient_service/specification"
4
4
  require_relative "lib/convenient_service/version"
5
5
 
6
+ ##
7
+ # NOTE:
8
+ # - Use `ConvenientService::Support::Ruby.jruby?` directly only in the files that do not require to load all dependencies.
9
+ # - Prefer `ConvenientService::Dependencies.ruby.jruby?` for the rest of the files.
10
+ #
11
+ require_relative "lib/convenient_service/support/ruby"
12
+
6
13
  Gem::Specification.new do |spec|
7
14
  spec.name = ConvenientService::Specification::NAME
8
15
  spec.authors = ConvenientService::Specification::AUTHORS
@@ -30,26 +37,57 @@ Gem::Specification.new do |spec|
30
37
  spec.require_paths = ["lib"]
31
38
 
32
39
  spec.add_development_dependency "appraisal"
40
+
33
41
  spec.add_development_dependency "awesome_print"
34
- spec.add_development_dependency "byebug", "~> 10.0"
35
- spec.add_development_dependency "commonmarker"
42
+
43
+ ##
44
+ # NOTE: `byebug` has C extensions, that is why it is NOT supported in JRuby.
45
+ # - https://github.com/deivid-rodriguez/byebug/tree/master/ext/byebug
46
+ # - https://github.com/deivid-rodriguez/byebug/issues/179#issuecomment-152727003
47
+ #
48
+ spec.add_development_dependency "byebug", "~> 10.0" unless ConvenientService::Support::Ruby.jruby?
49
+
50
+ ##
51
+ # NOTE: `commonmarker` has C extensions, that is why it is NOT supported in JRuby.
52
+ # - https://github.com/gjtorikian/commonmarker/tree/main/ext/commonmarker
53
+ #
54
+ spec.add_development_dependency "commonmarker" unless ConvenientService::Support::Ruby.jruby?
55
+
36
56
  spec.add_development_dependency "faker"
57
+
37
58
  spec.add_development_dependency "gem-release"
59
+
38
60
  spec.add_development_dependency "inch"
61
+
39
62
  spec.add_development_dependency "json"
63
+
40
64
  spec.add_development_dependency "paint"
65
+
41
66
  spec.add_development_dependency "progressbar"
67
+
42
68
  spec.add_development_dependency "rake", "~> 12.0"
69
+
43
70
  spec.add_development_dependency "rerun"
71
+
44
72
  spec.add_development_dependency "rouge"
73
+
45
74
  spec.add_development_dependency "rspec", "~> 3.11.0"
75
+
46
76
  spec.add_development_dependency "rubocop", "~> 1.40.0"
77
+
47
78
  spec.add_development_dependency "rubocop-rspec"
79
+
48
80
  spec.add_development_dependency "tty-prompt"
81
+
49
82
  spec.add_development_dependency "standard"
83
+
50
84
  spec.add_development_dependency "simplecov"
85
+
51
86
  spec.add_development_dependency "simplecov-lcov"
87
+
52
88
  spec.add_development_dependency "webrick"
89
+
53
90
  spec.add_development_dependency "yard", "~> 0.9.28"
91
+
54
92
  spec.add_development_dependency "yard-junk"
55
93
  end
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # NOTE: Linted by hadolint.
5
5
  #
6
- # docker run --rm -i ghcr.io/hadolint/hadolint < docker/3.0/Dockerfile
6
+ # docker run --rm -i ghcr.io/hadolint/hadolint < docker/2.7/Dockerfile
7
7
  #
8
8
  # NOTE: A command to build image.
9
9
  #
@@ -21,12 +21,12 @@
21
21
  # NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
22
22
  # In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
23
23
  # That is why a `slim` version is used instead of `alpine`.
24
- # Also `slim` is more similar to Ubuntu used in CI.
24
+ # Also `slim` is more similar to Ubuntu.
25
25
  # - https://github.com/timbru31/docker-ruby-node/tree/master/2.7/16
26
26
  # - https://medium.com/swlh/alpine-slim-stretch-buster-jessie-bullseye-bookworm-what-are-the-differences-in-docker-62171ed4531d
27
27
  # - https://hub.docker.com/r/timbru31/ruby-node/tags
28
28
  #
29
- # NOTE: Gallium means Node.js 16.x
29
+ # NOTE: Gallium means Node.js 16.x.
30
30
  # https://github.com/nodejs/Release
31
31
  #
32
32
  FROM timbru31/ruby-node:2.7-slim-gallium
@@ -21,12 +21,12 @@
21
21
  # NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
22
22
  # In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
23
23
  # That is why a `slim` version is used instead of `alpine`.
24
- # Also `slim` is more similar to Ubuntu used in CI.
24
+ # Also `slim` is more similar to Ubuntu.
25
25
  # - https://github.com/timbru31/docker-ruby-node/tree/master/3.0/16
26
26
  # - https://medium.com/swlh/alpine-slim-stretch-buster-jessie-bullseye-bookworm-what-are-the-differences-in-docker-62171ed4531d
27
27
  # - https://hub.docker.com/r/timbru31/ruby-node/tags
28
28
  #
29
- # NOTE: Gallium means Node.js 16.x
29
+ # NOTE: Gallium means Node.js 16.x.
30
30
  # https://github.com/nodejs/Release
31
31
  #
32
32
  FROM timbru31/ruby-node:3.0-slim-gallium
@@ -21,12 +21,12 @@
21
21
  # NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
22
22
  # In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
23
23
  # That is why a `slim` version is used instead of `alpine`.
24
- # Also `slim` is more similar to Ubuntu used in CI.
24
+ # Also `slim` is more similar to Ubuntu.
25
25
  # - https://github.com/timbru31/docker-ruby-node/tree/master/3.1/16
26
26
  # - https://medium.com/swlh/alpine-slim-stretch-buster-jessie-bullseye-bookworm-what-are-the-differences-in-docker-62171ed4531d
27
27
  # - https://hub.docker.com/r/timbru31/ruby-node/tags
28
28
  #
29
- # NOTE: Gallium means Node.js 16.x
29
+ # NOTE: Gallium means Node.js 16.x.
30
30
  # https://github.com/nodejs/Release
31
31
  #
32
32
  FROM timbru31/ruby-node:3.1-slim-gallium
@@ -0,0 +1,73 @@
1
+ ##
2
+ # Ruby 3.2 with Node.js 16.x.
3
+ #
4
+ # NOTE: Linted by hadolint.
5
+ #
6
+ # docker run --rm -i ghcr.io/hadolint/hadolint < docker/3.2/Dockerfile
7
+ #
8
+ # NOTE: A command to build image.
9
+ #
10
+ # cd convenient_service
11
+ # cp Gemfile Gemfile.3.2
12
+ # docker build . -f docker/3.2/Dockerfile -t convenient_service:3.2
13
+ # # or `task docker:build:ruby_3.2`
14
+ #
15
+ # NOTE: A command to run bash in container.
16
+ #
17
+ # cd convenient_service
18
+ # docker run --rm -it -v $(pwd):/gem convenient_service:3.2 bash
19
+ # # or `task docker:bash:ruby_3.2`
20
+ #
21
+ # NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
22
+ # In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
23
+ # That is why a `slim` version is used instead of `alpine`.
24
+ # Also `slim` is more similar to Ubuntu.
25
+ # - https://github.com/timbru31/docker-ruby-node/tree/master/3.2/16
26
+ # - https://medium.com/swlh/alpine-slim-stretch-buster-jessie-bullseye-bookworm-what-are-the-differences-in-docker-62171ed4531d
27
+ # - https://hub.docker.com/r/timbru31/ruby-node/tags
28
+ #
29
+ # NOTE: Gallium means Node.js 16.x.
30
+ # https://github.com/nodejs/Release
31
+ #
32
+ FROM timbru31/ruby-node:3.2-slim-gallium
33
+
34
+ ##
35
+ # NOTE: `bundle install` dependencies.
36
+ #
37
+ RUN apt-get update -qq \
38
+ && apt-get install --no-install-recommends -y git \
39
+ && apt-get install --no-install-recommends -y make \
40
+ && apt-get install --no-install-recommends -y gcc \
41
+ && apt-get clean \
42
+ && rm -rf /var/lib/apt/lists/*
43
+
44
+ RUN mkdir -p /gem
45
+
46
+ WORKDIR /gem
47
+
48
+ COPY . /gem
49
+
50
+ ##
51
+ # NOTE: Every container has its own copy of `Gemfile`. This way a developer doesn't need to delete `Gemfile.lock` all the time when changing containers.
52
+ # - https://docs.docker.com/engine/reference/builder/#env
53
+ # - https://stackoverflow.com/questions/48863711/is-it-possible-to-override-gemfile-for-local-development
54
+ #
55
+ ENV BUNDLE_GEMFILE=Gemfile.3.2
56
+
57
+ RUN bundle install
58
+
59
+ RUN bundle exec appraisal install
60
+
61
+ ##
62
+ # NOTE: Installs `task`.
63
+ # https://taskfile.dev/installation/#install-script
64
+ #
65
+ # NOTE: `task` is installed into `~/bin`. That is why `-b /bin` is used. See `echo ${PATH}` to debug.
66
+ #
67
+ RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /bin
68
+
69
+ ##
70
+ # NOTE: Is used to check whether a command is executed inside a Docker container. See Rakefile for examples.
71
+ # https://stackoverflow.com/a/65942222/12201472
72
+ #
73
+ ENV IN_DOCKER_CONTAINER=true
@@ -0,0 +1,88 @@
1
+ ##
2
+ # JRuby 9.4 (CRuby 3.1 compatible) with Node.js 16.x.
3
+ # - https://www.jruby.org/download
4
+ #
5
+ # NOTE: Linted by hadolint.
6
+ #
7
+ # docker run --rm -i ghcr.io/hadolint/hadolint < docker/jruby-9.4/Dockerfile
8
+ #
9
+ # NOTE: A command to build image.
10
+ #
11
+ # cd convenient_service
12
+ # cp Gemfile Gemfile.jruby-9.4
13
+ # docker build . -f docker/jruby-9.4/Dockerfile -t convenient_service:jruby-9.4
14
+ # # or `task docker:build:jruby_9.4`
15
+ #
16
+ # NOTE: A command to run bash in container.
17
+ #
18
+ # cd convenient_service
19
+ # docker run --rm -it -v $(pwd):/gem convenient_service:jruby-9.4 bash
20
+ # # or `task docker:bash:jruby_9.4`
21
+ #
22
+ # NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
23
+ # In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
24
+ # `jruby:9.4` uses Ubuntu under the hood.s
25
+ # - https://hub.docker.com/_/jruby/tags
26
+ # - https://github.com/jruby/docker-jruby/blob/master/9.4/jre8/Dockerfile
27
+ # - https://github.com/adoptium/containers/blob/main/19/jdk/ubuntu/jammy/Dockerfile.releases.full#L20
28
+ #
29
+ # NOTE: Gallium means Node.js 16.x.
30
+ # https://github.com/nodejs/Release
31
+ #
32
+ FROM jruby:9.4
33
+
34
+ ##
35
+ # NOTE: `git` is `bundle install` dependency.
36
+ #
37
+ # NOTE: `curl` and `gnupg2` are Node.js 16.x dependencies.
38
+ # https://github.com/timbru31/docker-ruby-node/blob/master/3.2/16/slim/Dockerfile
39
+ #
40
+ RUN apt-get update -qq \
41
+ && apt-get install --no-install-recommends -y git \
42
+ && apt-get install --no-install-recommends -y curl \
43
+ && apt-get install --no-install-recommends -y gnupg2 \
44
+ && apt-get clean \
45
+ && rm -rf /var/lib/apt/lists/*
46
+
47
+ RUN mkdir -p /gem
48
+
49
+ WORKDIR /gem
50
+
51
+ COPY . /gem
52
+
53
+ ##
54
+ # NOTE: Every container has its own copy of `Gemfile`. This way a developer doesn't need to delete `Gemfile.lock` all the time when changing containers.
55
+ # - https://docs.docker.com/engine/reference/builder/#env
56
+ # - https://stackoverflow.com/questions/48863711/is-it-possible-to-koverride-gemfile-for-local-development
57
+ #
58
+ ENV BUNDLE_GEMFILE=Gemfile.jruby-9.4
59
+
60
+ RUN bundle install
61
+
62
+ RUN bundle exec appraisal install
63
+
64
+ ##
65
+ # NOTE: Installs `task`.
66
+ # https://taskfile.dev/installation/#install-script
67
+ #
68
+ # NOTE: `task` is installed into `~/bin`. That is why `-b /bin` is used. See `echo ${PATH}` to debug.
69
+ #
70
+ RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /bin
71
+
72
+ ##
73
+ # NOTE: Intalls Node.js 16.x and `yarn`.
74
+ # https://github.com/timbru31/docker-ruby-node/blob/master/3.2/16/slim/Dockerfile
75
+ #
76
+ RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -\
77
+ && apt-get update -qq \
78
+ && apt-get install -qq --no-install-recommends nodejs \
79
+ && apt-get upgrade -qq \
80
+ && apt-get clean \
81
+ && rm -rf /var/lib/apt/lists/*\
82
+ && npm install -g yarn@1
83
+
84
+ ##
85
+ # NOTE: Is used to check whether a command is executed inside a Docker container. See Rakefile for examples.
86
+ # https://stackoverflow.com/a/65942222/12201472
87
+ #
88
+ ENV IN_DOCKER_CONTAINER=true