convenient_service 0.17.0 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (492) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -7
  3. data/lib/convenient_service/commands/is_service.rb +28 -0
  4. data/lib/convenient_service/commands/is_service_class.rb +30 -0
  5. data/lib/convenient_service/commands.rb +4 -0
  6. data/lib/convenient_service/common/plugins/ensures_negated_j_send_result/middleware.rb +22 -0
  7. data/lib/convenient_service/common/plugins/ensures_negated_j_send_result.rb +3 -0
  8. data/lib/convenient_service/common/plugins/has_around_callbacks/concern.rb +8 -1
  9. data/lib/convenient_service/common/plugins/has_around_callbacks/middleware.rb +28 -7
  10. data/lib/convenient_service/common/plugins/has_callbacks/concern.rb +19 -9
  11. data/lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb +49 -1
  12. data/lib/convenient_service/common/plugins/has_callbacks/middleware.rb +21 -3
  13. data/lib/convenient_service/common/plugins/has_callbacks.rb +0 -1
  14. data/lib/convenient_service/common/plugins/has_instance_proxy/entities/instance_proxy.rb +1 -1
  15. data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/has_cache/concern.rb +12 -0
  16. data/lib/convenient_service/common/plugins.rb +3 -3
  17. data/lib/convenient_service/core/concern/class_methods.rb +3 -0
  18. data/lib/convenient_service/core/entities/config/entities/concerns/entities/stack.rb +22 -0
  19. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/concern/instance_methods.rb +1 -1
  20. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable/entities/event.rb +13 -15
  21. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands/normalize_env.rb +55 -0
  22. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands.rb +1 -0
  23. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/instance_methods.rb +3 -3
  24. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/classic.rb +14 -0
  25. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/stack.rb +22 -0
  26. data/lib/convenient_service/core/entities/config/exceptions.rb +2 -0
  27. data/lib/convenient_service/core/entities/config.rb +3 -0
  28. data/lib/convenient_service/dependencies/built_in.rb +0 -7
  29. data/lib/convenient_service/dependencies/extractions/ds.rb +45 -0
  30. data/lib/convenient_service/dependencies/only_queries.rb +29 -0
  31. data/lib/convenient_service/dependencies/queries/gems/active_model.rb +38 -0
  32. data/lib/convenient_service/dependencies/queries/gems/logger.rb +39 -0
  33. data/lib/convenient_service/dependencies/queries/gems/paint.rb +39 -0
  34. data/lib/convenient_service/dependencies/queries/gems/rspec.rb +60 -0
  35. data/lib/convenient_service/dependencies/queries/ruby.rb +103 -0
  36. data/lib/convenient_service/dependencies/queries/version/null_version.rb +87 -0
  37. data/lib/convenient_service/dependencies/queries/version.rb +87 -0
  38. data/lib/convenient_service/dependencies/queries.rb +536 -0
  39. data/lib/convenient_service/dependencies.rb +2 -430
  40. data/lib/convenient_service/feature/configs/standard.rb +0 -2
  41. data/lib/convenient_service/logger.rb +9 -1
  42. data/lib/convenient_service/rspec/matchers/classes/call_chain_next.rb +41 -0
  43. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb +46 -0
  44. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/delegation.rb +89 -0
  45. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/inputs.rb +223 -0
  46. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/outputs.rb +38 -0
  47. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matcher_collection.rb +157 -0
  48. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/arguments/commands/apply_stub_to_track_delegations.rb +77 -0
  49. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/arguments/commands/generate_printable_arguments.rb +94 -0
  50. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/arguments.rb +89 -0
  51. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/base.rb +99 -0
  52. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/return_custom_value.rb +91 -0
  53. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/return_delegation_value.rb +129 -0
  54. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/with_any_arguments.rb +31 -0
  55. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/with_concrete_arguments.rb +31 -0
  56. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/without_arguments.rb +31 -0
  57. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers.rb +11 -0
  58. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities.rb +5 -1
  59. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/exceptions.rb +65 -0
  60. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb +163 -41
  61. data/lib/convenient_service/service/configs/amazing_print_inspect/aliases.rb +7 -0
  62. data/lib/convenient_service/service/configs/amazing_print_inspect.rb +61 -0
  63. data/lib/convenient_service/service/configs/awesome_print_inspect.rb +1 -1
  64. data/lib/convenient_service/service/configs/{minimal.rb → essential.rb} +40 -93
  65. data/lib/convenient_service/service/configs/standard/v1.rb +47 -34
  66. data/lib/convenient_service/service/configs/standard.rb +70 -68
  67. data/lib/convenient_service/service/configs.rb +1 -1
  68. data/lib/convenient_service/service/plugins/can_have_connected_steps/concern.rb +503 -0
  69. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb +136 -0
  70. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/base.rb +126 -0
  71. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/empty.rb +104 -0
  72. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/group.rb +118 -0
  73. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb +118 -0
  74. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/or.rb +145 -0
  75. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb +133 -0
  76. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions.rb +10 -0
  77. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/step_collection.rb +224 -0
  78. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities.rb +4 -0
  79. data/lib/convenient_service/service/plugins/can_have_connected_steps/exceptions.rb +95 -0
  80. data/lib/convenient_service/service/plugins/can_have_connected_steps/middleware.rb +30 -0
  81. data/lib/convenient_service/service/plugins/can_have_connected_steps.rb +6 -0
  82. data/lib/convenient_service/service/plugins/can_have_fallbacks/concern.rb +18 -0
  83. data/lib/convenient_service/service/plugins/can_have_fallbacks/exceptions.rb +22 -4
  84. data/lib/convenient_service/service/plugins/can_have_fallbacks/middleware.rb +3 -3
  85. data/lib/convenient_service/service/plugins/can_have_rollbacks/middleware.rb +66 -0
  86. data/lib/convenient_service/service/plugins/can_have_rollbacks.rb +3 -0
  87. data/lib/convenient_service/service/plugins/can_have_sequential_steps/concern.rb +76 -0
  88. data/lib/convenient_service/service/plugins/{can_have_steps → can_have_sequential_steps}/entities/step_collection.rb +61 -10
  89. data/lib/convenient_service/service/plugins/can_have_sequential_steps/entities.rb +3 -0
  90. data/lib/convenient_service/service/plugins/{can_have_steps → can_have_sequential_steps}/middleware.rb +7 -3
  91. data/lib/convenient_service/service/plugins/can_have_sequential_steps.rb +5 -0
  92. data/lib/convenient_service/service/plugins/can_have_steps/commands/is_step.rb +34 -0
  93. data/lib/convenient_service/service/plugins/can_have_steps/commands.rb +1 -0
  94. data/lib/convenient_service/service/plugins/can_have_steps/concern.rb +4 -57
  95. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb +45 -26
  96. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/reassignment.rb +0 -2
  97. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/exceptions.rb +4 -24
  98. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb +166 -83
  99. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/exceptions.rb +19 -0
  100. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/{can_be_result_step → can_be_method_step}/can_be_executed/exceptions.rb +1 -1
  101. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed/middleware.rb +52 -6
  102. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed.rb +1 -0
  103. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/concern.rb +7 -0
  104. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_alternative_steps.rb +3 -0
  105. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/concern.rb +0 -46
  106. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/exceptions.rb +53 -0
  107. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/middleware.rb +75 -6
  108. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks.rb +1 -0
  109. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_parent_result/middleware.rb +13 -1
  110. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_amazing_print_inspect/concern.rb +46 -0
  111. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_amazing_print_inspect.rb +3 -0
  112. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect/concern.rb +3 -2
  113. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_result/concern.rb +34 -0
  114. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_result/middleware.rb +58 -0
  115. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_result.rb +4 -0
  116. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins.rb +2 -1
  117. data/lib/convenient_service/service/plugins/can_have_steps/entities.rb +0 -1
  118. data/lib/convenient_service/service/plugins/can_have_steps.rb +41 -1
  119. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/fetch_all_services_stubbed_results_cache.rb +2 -2
  120. data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/exceptions.rb +53 -0
  121. data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/middleware.rb +108 -0
  122. data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments.rb +4 -0
  123. data/lib/convenient_service/service/plugins/has_amazing_print_inspect/concern.rb +39 -0
  124. data/lib/convenient_service/service/plugins/has_amazing_print_inspect.rb +3 -0
  125. data/lib/convenient_service/service/plugins/{can_have_steps/entities/step/plugins/can_be_result_step → has_j_send_result/entities/result/plugins/can_be_from_exception}/concern.rb +7 -5
  126. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_from_exception.rb +3 -0
  127. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status/concern.rb +2 -2
  128. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status.rb +0 -1
  129. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_step/concern.rb +7 -0
  130. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_amazing_print_inspect/concern.rb +41 -0
  131. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_amazing_print_inspect.rb +3 -0
  132. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect/concern.rb +2 -2
  133. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/concern/instance_methods.rb +0 -7
  134. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_amazing_print_inspect/concern.rb +46 -0
  135. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_amazing_print_inspect.rb +3 -0
  136. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_amazing_print_inspect/concern.rb +46 -0
  137. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_amazing_print_inspect.rb +3 -0
  138. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_amazing_print_inspect/concern.rb +46 -0
  139. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_amazing_print_inspect.rb +3 -0
  140. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb +45 -17
  141. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/can_be_checked/concern.rb +38 -0
  142. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/can_be_checked/middleware.rb +51 -0
  143. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/can_be_checked.rb +4 -0
  144. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_amazing_print_inspect/concern.rb +46 -0
  145. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_amazing_print_inspect.rb +3 -0
  146. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins.rb +1 -0
  147. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/exceptions.rb +15 -0
  148. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_negated_result/concern.rb +72 -0
  149. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_negated_result.rb +3 -0
  150. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/concern/instance_methods.rb +161 -0
  151. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/concern.rb +27 -0
  152. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/exceptions.rb +34 -0
  153. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects.rb +4 -0
  154. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +1 -1
  155. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins.rb +3 -0
  156. data/lib/convenient_service/service/plugins/has_j_send_result.rb +0 -1
  157. data/lib/convenient_service/service/plugins/has_j_send_result_params_validations/using_dry_validation/middleware.rb +4 -0
  158. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/concern.rb +6 -1
  159. data/lib/convenient_service/service/plugins/has_negated_j_send_result/concern.rb +23 -0
  160. data/lib/convenient_service/service/plugins/has_negated_j_send_result.rb +3 -0
  161. data/lib/convenient_service/service/plugins/has_negated_result/concern.rb +33 -0
  162. data/lib/convenient_service/service/plugins/{has_j_send_result → has_negated_result}/exceptions.rb +3 -3
  163. data/lib/convenient_service/service/plugins/has_negated_result.rb +4 -0
  164. data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/middleware.rb +1 -0
  165. data/lib/convenient_service/service/plugins/{wraps_result_in_db_transaction → wraps_result_in_d_b_transaction}/middleware.rb +1 -1
  166. data/lib/convenient_service/service/plugins.rb +10 -3
  167. data/lib/convenient_service/specification.rb +28 -0
  168. data/lib/convenient_service/support/backtrace_cleaner.rb +6 -1
  169. data/lib/convenient_service/support/cache/entities/caches/base.rb +3 -0
  170. data/lib/convenient_service/support/counter.rb +2 -0
  171. data/lib/convenient_service/support/method_parameters.rb +121 -0
  172. data/lib/convenient_service/support/middleware/stack_builder.rb +37 -0
  173. data/lib/convenient_service/support/never_reach_here.rb +21 -0
  174. data/lib/convenient_service/support/thread_safe_counter.rb +1 -0
  175. data/lib/convenient_service/support/unique_value.rb +3 -0
  176. data/lib/convenient_service/support/value.rb +78 -0
  177. data/lib/convenient_service/support.rb +3 -3
  178. data/lib/convenient_service/utils/array/find_last.rb +8 -3
  179. data/lib/convenient_service/utils/object/get_own_method.rb +54 -0
  180. data/lib/convenient_service/utils/object/instance_variable_delete.rb +1 -1
  181. data/lib/convenient_service/utils/object/safe_send.rb +84 -0
  182. data/lib/convenient_service/utils/object.rb +24 -0
  183. data/lib/convenient_service/utils/string/enclose.rb +52 -0
  184. data/lib/convenient_service/utils/string.rb +5 -0
  185. data/lib/convenient_service/version.rb +1 -1
  186. data/lib/convenient_service.rb +85 -0
  187. metadata +256 -322
  188. data/.dev/.tmuxinator.yml +0 -22
  189. data/.dockerignore +0 -1
  190. data/.gem_release.yml +0 -11
  191. data/.github/contributing.md +0 -15
  192. data/.github/issue_template.md +0 -35
  193. data/.github/pull_request_template.md +0 -31
  194. data/.github/workflows/cd.yml +0 -68
  195. data/.github/workflows/ci.yml +0 -212
  196. data/.gitignore +0 -66
  197. data/.inch.yml +0 -7
  198. data/.rspec +0 -3
  199. data/.rubocop.yml +0 -45
  200. data/.rubocop_rspec.yml +0 -58
  201. data/.ruby-version +0 -1
  202. data/.tool-versions +0 -1
  203. data/.vscode/CacheItsValue.code-snippets +0 -15
  204. data/.vscode/DelegateTo.code-snippets +0 -15
  205. data/.vscode/cache_its_value.code-snippets +0 -17
  206. data/.vscode/comparison.code-snippets +0 -41
  207. data/.vscode/delegate_to.code-snippets +0 -20
  208. data/.yardopts +0 -16
  209. data/Appraisals +0 -146
  210. data/CHANGELOG.md +0 -504
  211. data/Gemfile +0 -17
  212. data/ROADMAP.md +0 -92
  213. data/Rakefile +0 -54
  214. data/Taskfile.yml +0 -679
  215. data/benchmark/commit_config/ips.rb +0 -18
  216. data/benchmark/commit_config/profile.rb +0 -30
  217. data/benchmark/empty_service/ips.rb +0 -123
  218. data/benchmark/has_committed_config/ips.rb +0 -78
  219. data/benchmark/has_committed_config/profile.rb +0 -30
  220. data/convenient_service.gemspec +0 -233
  221. data/coverage/.gitkeep +0 -0
  222. data/docker/2.7/Dockerfile +0 -73
  223. data/docker/3.0/Dockerfile +0 -73
  224. data/docker/3.1/Dockerfile +0 -73
  225. data/docker/3.2/Dockerfile +0 -73
  226. data/docker/jruby-9.4/Dockerfile +0 -88
  227. data/docker/truffleruby-22.3/Dockerfile +0 -91
  228. data/docs/.gitkeep +0 -0
  229. data/docs/api/.gitkeep +0 -0
  230. data/env.rb +0 -23
  231. data/gemfiles/.gitkeep +0 -0
  232. data/lib/convenient_service/common/plugins/has_callbacks/container.rb +0 -17
  233. data/lib/convenient_service/common/plugins/normalizes_env/middleware.rb +0 -31
  234. data/lib/convenient_service/common/plugins/normalizes_env.rb +0 -3
  235. data/lib/convenient_service/examples/dry/gemfile/dry_service/config.rb +0 -45
  236. data/lib/convenient_service/examples/dry/gemfile/dry_service.rb +0 -3
  237. data/lib/convenient_service/examples/dry/gemfile/services/assert_file_exists.rb +0 -29
  238. data/lib/convenient_service/examples/dry/gemfile/services/assert_file_not_empty.rb +0 -29
  239. data/lib/convenient_service/examples/dry/gemfile/services/assert_node_available.rb +0 -26
  240. data/lib/convenient_service/examples/dry/gemfile/services/assert_npm_package_available.rb +0 -39
  241. data/lib/convenient_service/examples/dry/gemfile/services/assert_valid_ruby_syntax.rb +0 -41
  242. data/lib/convenient_service/examples/dry/gemfile/services/format.rb +0 -37
  243. data/lib/convenient_service/examples/dry/gemfile/services/format_body.rb +0 -93
  244. data/lib/convenient_service/examples/dry/gemfile/services/format_gems_with_envs.rb +0 -96
  245. data/lib/convenient_service/examples/dry/gemfile/services/format_gems_without_envs.rb +0 -84
  246. data/lib/convenient_service/examples/dry/gemfile/services/format_header.rb +0 -74
  247. data/lib/convenient_service/examples/dry/gemfile/services/parse_content.rb +0 -93
  248. data/lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb +0 -44
  249. data/lib/convenient_service/examples/dry/gemfile/services/read_file_content.rb +0 -31
  250. data/lib/convenient_service/examples/dry/gemfile/services/run_shell_command.rb +0 -45
  251. data/lib/convenient_service/examples/dry/gemfile/services/strip_comments.rb +0 -109
  252. data/lib/convenient_service/examples/dry/gemfile/services.rb +0 -18
  253. data/lib/convenient_service/examples/dry/gemfile.rb +0 -27
  254. data/lib/convenient_service/examples/dry/v1/gemfile/dry_service/config.rb +0 -47
  255. data/lib/convenient_service/examples/dry/v1/gemfile/dry_service.rb +0 -3
  256. data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_exists.rb +0 -31
  257. data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_not_empty.rb +0 -31
  258. data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_node_available.rb +0 -28
  259. data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_npm_package_available.rb +0 -41
  260. data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_valid_ruby_syntax.rb +0 -43
  261. data/lib/convenient_service/examples/dry/v1/gemfile/services/format.rb +0 -39
  262. data/lib/convenient_service/examples/dry/v1/gemfile/services/format_body.rb +0 -95
  263. data/lib/convenient_service/examples/dry/v1/gemfile/services/format_gems_with_envs.rb +0 -98
  264. data/lib/convenient_service/examples/dry/v1/gemfile/services/format_gems_without_envs.rb +0 -86
  265. data/lib/convenient_service/examples/dry/v1/gemfile/services/format_header.rb +0 -76
  266. data/lib/convenient_service/examples/dry/v1/gemfile/services/parse_content.rb +0 -95
  267. data/lib/convenient_service/examples/dry/v1/gemfile/services/read_file_content.rb +0 -33
  268. data/lib/convenient_service/examples/dry/v1/gemfile/services/run_shell_command.rb +0 -43
  269. data/lib/convenient_service/examples/dry/v1/gemfile/services/strip_comments.rb +0 -111
  270. data/lib/convenient_service/examples/dry/v1/gemfile/services.rb +0 -17
  271. data/lib/convenient_service/examples/dry/v1/gemfile.rb +0 -29
  272. data/lib/convenient_service/examples/rails/gemfile/rails_service/config.rb +0 -56
  273. data/lib/convenient_service/examples/rails/gemfile/rails_service.rb +0 -3
  274. data/lib/convenient_service/examples/rails/gemfile/services/assert_file_exists.rb +0 -25
  275. data/lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb +0 -25
  276. data/lib/convenient_service/examples/rails/gemfile/services/assert_node_available.rb +0 -26
  277. data/lib/convenient_service/examples/rails/gemfile/services/assert_npm_package_available.rb +0 -35
  278. data/lib/convenient_service/examples/rails/gemfile/services/assert_valid_ruby_syntax.rb +0 -35
  279. data/lib/convenient_service/examples/rails/gemfile/services/format.rb +0 -66
  280. data/lib/convenient_service/examples/rails/gemfile/services/format_body.rb +0 -79
  281. data/lib/convenient_service/examples/rails/gemfile/services/format_gems_with_envs.rb +0 -82
  282. data/lib/convenient_service/examples/rails/gemfile/services/format_gems_without_envs.rb +0 -70
  283. data/lib/convenient_service/examples/rails/gemfile/services/format_header.rb +0 -68
  284. data/lib/convenient_service/examples/rails/gemfile/services/merge_sections.rb +0 -25
  285. data/lib/convenient_service/examples/rails/gemfile/services/parse_content.rb +0 -89
  286. data/lib/convenient_service/examples/rails/gemfile/services/print_shell_command.rb +0 -40
  287. data/lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb +0 -27
  288. data/lib/convenient_service/examples/rails/gemfile/services/replace_file_content.rb +0 -37
  289. data/lib/convenient_service/examples/rails/gemfile/services/run_shell_command.rb +0 -40
  290. data/lib/convenient_service/examples/rails/gemfile/services/strip_comments.rb +0 -107
  291. data/lib/convenient_service/examples/rails/gemfile/services.rb +0 -21
  292. data/lib/convenient_service/examples/rails/gemfile.rb +0 -27
  293. data/lib/convenient_service/examples/rails/v1/gemfile/rails_service/config.rb +0 -58
  294. data/lib/convenient_service/examples/rails/v1/gemfile/rails_service.rb +0 -3
  295. data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_file_exists.rb +0 -27
  296. data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_file_not_empty.rb +0 -27
  297. data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_node_available.rb +0 -28
  298. data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_npm_package_available.rb +0 -37
  299. data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_valid_ruby_syntax.rb +0 -37
  300. data/lib/convenient_service/examples/rails/v1/gemfile/services/format.rb +0 -68
  301. data/lib/convenient_service/examples/rails/v1/gemfile/services/format_body.rb +0 -81
  302. data/lib/convenient_service/examples/rails/v1/gemfile/services/format_gems_with_envs.rb +0 -84
  303. data/lib/convenient_service/examples/rails/v1/gemfile/services/format_gems_without_envs.rb +0 -72
  304. data/lib/convenient_service/examples/rails/v1/gemfile/services/format_header.rb +0 -70
  305. data/lib/convenient_service/examples/rails/v1/gemfile/services/merge_sections.rb +0 -27
  306. data/lib/convenient_service/examples/rails/v1/gemfile/services/parse_content.rb +0 -91
  307. data/lib/convenient_service/examples/rails/v1/gemfile/services/read_file_content.rb +0 -29
  308. data/lib/convenient_service/examples/rails/v1/gemfile/services/replace_file_content.rb +0 -39
  309. data/lib/convenient_service/examples/rails/v1/gemfile/services/run_shell_command.rb +0 -38
  310. data/lib/convenient_service/examples/rails/v1/gemfile/services/strip_comments.rb +0 -109
  311. data/lib/convenient_service/examples/rails/v1/gemfile/services.rb +0 -20
  312. data/lib/convenient_service/examples/rails/v1/gemfile.rb +0 -29
  313. data/lib/convenient_service/examples/standard/cowsay/services/build_cloud.rb +0 -42
  314. data/lib/convenient_service/examples/standard/cowsay/services/build_cow.rb +0 -38
  315. data/lib/convenient_service/examples/standard/cowsay/services/print.rb +0 -32
  316. data/lib/convenient_service/examples/standard/cowsay/services.rb +0 -5
  317. data/lib/convenient_service/examples/standard/cowsay.rb +0 -26
  318. data/lib/convenient_service/examples/standard/date_time/services/safe_parse.rb +0 -31
  319. data/lib/convenient_service/examples/standard/date_time/services.rb +0 -3
  320. data/lib/convenient_service/examples/standard/date_time.rb +0 -25
  321. data/lib/convenient_service/examples/standard/factorial/services/calculate.rb +0 -55
  322. data/lib/convenient_service/examples/standard/factorial/services.rb +0 -3
  323. data/lib/convenient_service/examples/standard/factorial/utils/timeout/with_timeout.rb +0 -50
  324. data/lib/convenient_service/examples/standard/factorial/utils/timeout.rb +0 -21
  325. data/lib/convenient_service/examples/standard/factorial/utils.rb +0 -3
  326. data/lib/convenient_service/examples/standard/factorial.rb +0 -26
  327. data/lib/convenient_service/examples/standard/gemfile/services/assert_file_exists.rb +0 -30
  328. data/lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb +0 -30
  329. data/lib/convenient_service/examples/standard/gemfile/services/assert_node_available.rb +0 -26
  330. data/lib/convenient_service/examples/standard/gemfile/services/assert_npm_package_available.rb +0 -48
  331. data/lib/convenient_service/examples/standard/gemfile/services/assert_valid_ruby_syntax.rb +0 -39
  332. data/lib/convenient_service/examples/standard/gemfile/services/format.rb +0 -80
  333. data/lib/convenient_service/examples/standard/gemfile/services/format_body.rb +0 -83
  334. data/lib/convenient_service/examples/standard/gemfile/services/format_gems_with_envs.rb +0 -86
  335. data/lib/convenient_service/examples/standard/gemfile/services/format_gems_without_envs.rb +0 -74
  336. data/lib/convenient_service/examples/standard/gemfile/services/format_header.rb +0 -66
  337. data/lib/convenient_service/examples/standard/gemfile/services/merge_sections.rb +0 -52
  338. data/lib/convenient_service/examples/standard/gemfile/services/parse_content.rb +0 -101
  339. data/lib/convenient_service/examples/standard/gemfile/services/print_shell_command.rb +0 -45
  340. data/lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb +0 -39
  341. data/lib/convenient_service/examples/standard/gemfile/services/replace_file_content.rb +0 -48
  342. data/lib/convenient_service/examples/standard/gemfile/services/run_shell_command.rb +0 -54
  343. data/lib/convenient_service/examples/standard/gemfile/services/strip_comments.rb +0 -111
  344. data/lib/convenient_service/examples/standard/gemfile/services.rb +0 -21
  345. data/lib/convenient_service/examples/standard/gemfile.rb +0 -26
  346. data/lib/convenient_service/examples/standard/request_params/constants.rb +0 -15
  347. data/lib/convenient_service/examples/standard/request_params/entities/description.rb +0 -40
  348. data/lib/convenient_service/examples/standard/request_params/entities/format.rb +0 -40
  349. data/lib/convenient_service/examples/standard/request_params/entities/id.rb +0 -47
  350. data/lib/convenient_service/examples/standard/request_params/entities/logger.rb +0 -21
  351. data/lib/convenient_service/examples/standard/request_params/entities/request.rb +0 -23
  352. data/lib/convenient_service/examples/standard/request_params/entities/source.rb +0 -40
  353. data/lib/convenient_service/examples/standard/request_params/entities/tag.rb +0 -40
  354. data/lib/convenient_service/examples/standard/request_params/entities/title.rb +0 -40
  355. data/lib/convenient_service/examples/standard/request_params/entities.rb +0 -11
  356. data/lib/convenient_service/examples/standard/request_params/services/apply_default_param_values.rb +0 -26
  357. data/lib/convenient_service/examples/standard/request_params/services/cast_params.rb +0 -38
  358. data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_body.rb +0 -70
  359. data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_path.rb +0 -62
  360. data/lib/convenient_service/examples/standard/request_params/services/filter_out_unpermitted_params.rb +0 -26
  361. data/lib/convenient_service/examples/standard/request_params/services/log_request_params.rb +0 -54
  362. data/lib/convenient_service/examples/standard/request_params/services/merge_params.rb +0 -26
  363. data/lib/convenient_service/examples/standard/request_params/services/prepare.rb +0 -65
  364. data/lib/convenient_service/examples/standard/request_params/services/validate_casted_params.rb +0 -94
  365. data/lib/convenient_service/examples/standard/request_params/services/validate_uncasted_params.rb +0 -72
  366. data/lib/convenient_service/examples/standard/request_params/services.rb +0 -13
  367. data/lib/convenient_service/examples/standard/request_params/utils/array/wrap.rb +0 -46
  368. data/lib/convenient_service/examples/standard/request_params/utils/array.rb +0 -21
  369. data/lib/convenient_service/examples/standard/request_params/utils/http/request/parse_body.rb +0 -42
  370. data/lib/convenient_service/examples/standard/request_params/utils/http/request/parse_path.rb +0 -40
  371. data/lib/convenient_service/examples/standard/request_params/utils/http/request.rb +0 -28
  372. data/lib/convenient_service/examples/standard/request_params/utils/http.rb +0 -3
  373. data/lib/convenient_service/examples/standard/request_params/utils/integer/safe_parse.rb +0 -31
  374. data/lib/convenient_service/examples/standard/request_params/utils/integer.rb +0 -25
  375. data/lib/convenient_service/examples/standard/request_params/utils/json/safe_parse.rb +0 -40
  376. data/lib/convenient_service/examples/standard/request_params/utils/json.rb +0 -21
  377. data/lib/convenient_service/examples/standard/request_params/utils/object/blank.rb +0 -34
  378. data/lib/convenient_service/examples/standard/request_params/utils/object/present.rb +0 -31
  379. data/lib/convenient_service/examples/standard/request_params/utils/object.rb +0 -26
  380. data/lib/convenient_service/examples/standard/request_params/utils/url/valid.rb +0 -47
  381. data/lib/convenient_service/examples/standard/request_params/utils/url.rb +0 -21
  382. data/lib/convenient_service/examples/standard/request_params/utils.rb +0 -8
  383. data/lib/convenient_service/examples/standard/request_params.rb +0 -49
  384. data/lib/convenient_service/examples/standard/v1/cowsay/services/build_cloud.rb +0 -44
  385. data/lib/convenient_service/examples/standard/v1/cowsay/services/build_cow.rb +0 -40
  386. data/lib/convenient_service/examples/standard/v1/cowsay/services/print.rb +0 -34
  387. data/lib/convenient_service/examples/standard/v1/cowsay/services.rb +0 -5
  388. data/lib/convenient_service/examples/standard/v1/cowsay.rb +0 -26
  389. data/lib/convenient_service/examples/standard/v1/date_time/services/safe_parse.rb +0 -33
  390. data/lib/convenient_service/examples/standard/v1/date_time/services.rb +0 -3
  391. data/lib/convenient_service/examples/standard/v1/date_time.rb +0 -25
  392. data/lib/convenient_service/examples/standard/v1/factorial/services/calculate.rb +0 -51
  393. data/lib/convenient_service/examples/standard/v1/factorial/services.rb +0 -3
  394. data/lib/convenient_service/examples/standard/v1/factorial/utils/timeout/with_timeout.rb +0 -52
  395. data/lib/convenient_service/examples/standard/v1/factorial/utils/timeout.rb +0 -23
  396. data/lib/convenient_service/examples/standard/v1/factorial/utils.rb +0 -3
  397. data/lib/convenient_service/examples/standard/v1/factorial.rb +0 -26
  398. data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_file_exists.rb +0 -32
  399. data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_file_not_empty.rb +0 -32
  400. data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_node_available.rb +0 -28
  401. data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_npm_package_available.rb +0 -50
  402. data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_valid_ruby_syntax.rb +0 -41
  403. data/lib/convenient_service/examples/standard/v1/gemfile/services/format.rb +0 -82
  404. data/lib/convenient_service/examples/standard/v1/gemfile/services/format_body.rb +0 -85
  405. data/lib/convenient_service/examples/standard/v1/gemfile/services/format_gems_with_envs.rb +0 -88
  406. data/lib/convenient_service/examples/standard/v1/gemfile/services/format_gems_without_envs.rb +0 -76
  407. data/lib/convenient_service/examples/standard/v1/gemfile/services/format_header.rb +0 -68
  408. data/lib/convenient_service/examples/standard/v1/gemfile/services/merge_sections.rb +0 -54
  409. data/lib/convenient_service/examples/standard/v1/gemfile/services/parse_content.rb +0 -103
  410. data/lib/convenient_service/examples/standard/v1/gemfile/services/read_file_content.rb +0 -41
  411. data/lib/convenient_service/examples/standard/v1/gemfile/services/replace_file_content.rb +0 -50
  412. data/lib/convenient_service/examples/standard/v1/gemfile/services/run_shell_command.rb +0 -52
  413. data/lib/convenient_service/examples/standard/v1/gemfile/services/strip_comments.rb +0 -113
  414. data/lib/convenient_service/examples/standard/v1/gemfile/services.rb +0 -20
  415. data/lib/convenient_service/examples/standard/v1/gemfile.rb +0 -26
  416. data/lib/convenient_service/examples/standard/v1/request_params/constants.rb +0 -17
  417. data/lib/convenient_service/examples/standard/v1/request_params/entities/description.rb +0 -42
  418. data/lib/convenient_service/examples/standard/v1/request_params/entities/format.rb +0 -42
  419. data/lib/convenient_service/examples/standard/v1/request_params/entities/id.rb +0 -49
  420. data/lib/convenient_service/examples/standard/v1/request_params/entities/logger.rb +0 -23
  421. data/lib/convenient_service/examples/standard/v1/request_params/entities/request.rb +0 -25
  422. data/lib/convenient_service/examples/standard/v1/request_params/entities/source.rb +0 -42
  423. data/lib/convenient_service/examples/standard/v1/request_params/entities/tag.rb +0 -42
  424. data/lib/convenient_service/examples/standard/v1/request_params/entities/title.rb +0 -42
  425. data/lib/convenient_service/examples/standard/v1/request_params/entities.rb +0 -11
  426. data/lib/convenient_service/examples/standard/v1/request_params/services/apply_default_param_values.rb +0 -28
  427. data/lib/convenient_service/examples/standard/v1/request_params/services/cast_params.rb +0 -40
  428. data/lib/convenient_service/examples/standard/v1/request_params/services/extract_params_from_body.rb +0 -72
  429. data/lib/convenient_service/examples/standard/v1/request_params/services/extract_params_from_path.rb +0 -64
  430. data/lib/convenient_service/examples/standard/v1/request_params/services/filter_out_unpermitted_params.rb +0 -28
  431. data/lib/convenient_service/examples/standard/v1/request_params/services/log_request_params.rb +0 -56
  432. data/lib/convenient_service/examples/standard/v1/request_params/services/merge_params.rb +0 -28
  433. data/lib/convenient_service/examples/standard/v1/request_params/services/prepare.rb +0 -67
  434. data/lib/convenient_service/examples/standard/v1/request_params/services/validate_casted_params.rb +0 -96
  435. data/lib/convenient_service/examples/standard/v1/request_params/services/validate_uncasted_params.rb +0 -74
  436. data/lib/convenient_service/examples/standard/v1/request_params/services.rb +0 -13
  437. data/lib/convenient_service/examples/standard/v1/request_params/utils/array/wrap.rb +0 -48
  438. data/lib/convenient_service/examples/standard/v1/request_params/utils/array.rb +0 -23
  439. data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_body.rb +0 -44
  440. data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_path.rb +0 -42
  441. data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request.rb +0 -30
  442. data/lib/convenient_service/examples/standard/v1/request_params/utils/http.rb +0 -3
  443. data/lib/convenient_service/examples/standard/v1/request_params/utils/integer/safe_parse.rb +0 -33
  444. data/lib/convenient_service/examples/standard/v1/request_params/utils/integer.rb +0 -27
  445. data/lib/convenient_service/examples/standard/v1/request_params/utils/json/safe_parse.rb +0 -42
  446. data/lib/convenient_service/examples/standard/v1/request_params/utils/json.rb +0 -23
  447. data/lib/convenient_service/examples/standard/v1/request_params/utils/object/blank.rb +0 -36
  448. data/lib/convenient_service/examples/standard/v1/request_params/utils/object/present.rb +0 -33
  449. data/lib/convenient_service/examples/standard/v1/request_params/utils/object.rb +0 -28
  450. data/lib/convenient_service/examples/standard/v1/request_params/utils/url/valid.rb +0 -49
  451. data/lib/convenient_service/examples/standard/v1/request_params/utils/url.rb +0 -23
  452. data/lib/convenient_service/examples/standard/v1/request_params/utils.rb +0 -8
  453. data/lib/convenient_service/examples/standard/v1/request_params.rb +0 -49
  454. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/commands/generate_printable_method.rb +0 -50
  455. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands/apply_stub_to_track_delegations.rb +0 -82
  456. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands/generate_printable_arguments.rb +0 -100
  457. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments.rb +0 -95
  458. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/base.rb +0 -87
  459. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/return_its_value.rb +0 -132
  460. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_any_arguments.rb +0 -37
  461. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_concrete_arguments.rb +0 -37
  462. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/without_arguments.rb +0 -37
  463. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/values/base.rb +0 -41
  464. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/values/with_calling_original.rb +0 -30
  465. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/values/without_calling_original.rb +0 -30
  466. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings.rb +0 -12
  467. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings_collection/exceptions.rb +0 -57
  468. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings_collection.rb +0 -171
  469. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/delegation.rb +0 -79
  470. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities.rb +0 -5
  471. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher.rb +0 -276
  472. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/reassignment/commands/define_method_in_container.rb +0 -74
  473. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/reassignment/commands.rb +0 -3
  474. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed/middleware.rb +0 -72
  475. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed.rb +0 -4
  476. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step.rb +0 -5
  477. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/result.rb +0 -3
  478. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status/middleware.rb +0 -43
  479. data/lib/convenient_service/services.rb +0 -4
  480. data/lib/convenient_service/support/gems/active_model.rb +0 -36
  481. data/lib/convenient_service/support/gems/logger.rb +0 -37
  482. data/lib/convenient_service/support/gems/paint.rb +0 -37
  483. data/lib/convenient_service/support/gems/rspec.rb +0 -58
  484. data/lib/convenient_service/support/ruby.rb +0 -53
  485. data/lib/convenient_service/support/version/null_version.rb +0 -85
  486. data/lib/convenient_service/support/version.rb +0 -75
  487. data/logo.png +0 -0
  488. data/minitest.rb +0 -30
  489. data/yard/yard-convenient_service_concern.rb +0 -45
  490. /data/lib/convenient_service/{support → dependencies/queries}/gems.rb +0 -0
  491. /data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/{entities/matcher/commands.rb → commands.rb} +0 -0
  492. /data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/{matcher/entities/chainings/sub_matchers → sub_matchers}/arguments/commands.rb +0 -0
@@ -0,0 +1,133 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Service
5
+ module Plugins
6
+ module CanHaveConnectedSteps
7
+ module Entities
8
+ module Expressions
9
+ class Scalar < Entities::Expressions::Base
10
+ ##
11
+ # @!attribute [r] step
12
+ # @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
13
+ #
14
+ attr_reader :step
15
+
16
+ ##
17
+ # @param step [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
18
+ # @return [void]
19
+ #
20
+ def initialize(step)
21
+ @step = step
22
+ end
23
+
24
+ ##
25
+ # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
26
+ #
27
+ def result
28
+ step.result
29
+ end
30
+
31
+ ##
32
+ # @return [Boolean]
33
+ #
34
+ # @internal
35
+ # IMPORTANT: `success?` calls `result` to be able to use the same RSpec spy for both `success?` and `result?`.
36
+ #
37
+ def success?
38
+ result.status.unsafe_success?
39
+ end
40
+
41
+ ##
42
+ # @return [Boolean]
43
+ #
44
+ # @internal
45
+ # IMPORTANT: `failure?` calls `result` to be able to use the same RSpec spy for both `failure?` and `result?`.
46
+ #
47
+ def failure?
48
+ result.status.unsafe_failure?
49
+ end
50
+
51
+ ##
52
+ # @return [Boolean]
53
+ #
54
+ # @internal
55
+ # IMPORTANT: `error?` calls `result` to be able to use the same RSpec spy for both `error?` and `result?`.
56
+ #
57
+ def error?
58
+ result.status.unsafe_error?
59
+ end
60
+
61
+ ##
62
+ # @param block [Proc]
63
+ # @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Scalar]
64
+ #
65
+ def each_step(&block)
66
+ yield(step)
67
+
68
+ self
69
+ end
70
+
71
+ ##
72
+ # @param block [Proc]
73
+ # @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Scalar]
74
+ #
75
+ # @internal
76
+ # NOTE: `result` is called to evaluate step.
77
+ # IMPORTANT: `each_evaluated_step` calls `result` to be able to use the same RSpec spy for both `each_evaluated_step` and `result?`.
78
+ #
79
+ def each_evaluated_step(&block)
80
+ result
81
+
82
+ yield(step)
83
+
84
+ self
85
+ end
86
+
87
+ ##
88
+ # @param organizer [ConvenientService::Service]
89
+ # @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Scalar]
90
+ #
91
+ def with_organizer(organizer)
92
+ copy(overrides: {args: {0 => step.with_organizer(organizer)}})
93
+ end
94
+
95
+ ##
96
+ # @return [String]
97
+ #
98
+ def inspect
99
+ "steps[#{step.index}]"
100
+ end
101
+
102
+ ##
103
+ # @return [Boolean]
104
+ #
105
+ def scalar?
106
+ true
107
+ end
108
+
109
+ ##
110
+ # @param other [Object] Can be any type.
111
+ # @return [Boolean]
112
+ #
113
+ def ==(other)
114
+ return unless other.instance_of?(self.class)
115
+
116
+ return false if step != other.step
117
+
118
+ true
119
+ end
120
+
121
+ ##
122
+ # @return [ConvenientService::Support::Arguments]
123
+ #
124
+ def to_arguments
125
+ Support::Arguments.new(step)
126
+ end
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "expressions/base"
4
+
5
+ require_relative "expressions/empty"
6
+ require_relative "expressions/scalar"
7
+ require_relative "expressions/not"
8
+ require_relative "expressions/and"
9
+ require_relative "expressions/or"
10
+ require_relative "expressions/group"
@@ -0,0 +1,224 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Service
5
+ module Plugins
6
+ module CanHaveConnectedSteps
7
+ module Entities
8
+ ##
9
+ # @internal
10
+ # NOTE:
11
+ # This class is a modernization of `StepCollection` from `HasSequentialSteps`.
12
+ # Compared to the original implementation, this one is based on `expression` objects.
13
+ # `steps` array is not mandatory since each `step` can be retrieved from `expression`, but it is left for better performance.
14
+ # `expression` objects are trees. Search by index in the tree is O(n), while the same lookup in the array is O(1).
15
+ #
16
+ class StepCollection
17
+ include ::Enumerable
18
+
19
+ include Support::Copyable
20
+
21
+ ##
22
+ # @api private
23
+ #
24
+ # @!attribute [r] container
25
+ # @return [Class<ConvenientService::Service>]
26
+ #
27
+ attr_reader :container
28
+
29
+ ##
30
+ # @api private
31
+ #
32
+ # @!attribute [r] expression
33
+ # @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
34
+ #
35
+ attr_accessor :expression
36
+
37
+ ##
38
+ # @api private
39
+ #
40
+ # @!attribute [r] steps
41
+ # @return [Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step>]
42
+ #
43
+ attr_reader :steps
44
+
45
+ ##
46
+ # @api private
47
+ #
48
+ # @param container [Class<ConvenientService::Service>]
49
+ # @param expression [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
50
+ # @param steps [Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step>]
51
+ # @return [void]
52
+ #
53
+ def initialize(container:, expression: Entities::Expressions::Empty.new, steps: [])
54
+ @container = container
55
+ @expression = expression
56
+ @steps = steps
57
+ end
58
+
59
+ ##
60
+ # @return [Integer]
61
+ #
62
+ def size
63
+ steps.size
64
+ end
65
+
66
+ ##
67
+ # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
68
+ # @raise [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Exceptions::EmptyExpressionHasNoResult]
69
+ #
70
+ def result
71
+ expression.result
72
+ end
73
+
74
+ ##
75
+ # @api private
76
+ #
77
+ # @param args [Array<Object>]
78
+ # @param kwargs [Hash{Symbol => Object}]
79
+ # @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
80
+ #
81
+ def create(*args, **kwargs)
82
+ step_class.new(*args, **kwargs.merge(container: container, index: next_available_index))
83
+ .tap { |step| steps << step }
84
+ end
85
+
86
+ ##
87
+ # @param organizer [ConvenientService::Service]
88
+ # @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::StepCollection]
89
+ #
90
+ def with_organizer(organizer)
91
+ expression_with_organizer = expression.with_organizer(organizer)
92
+
93
+ copy(overrides: {kwargs: {expression: expression_with_organizer, steps: expression_with_organizer.steps}})
94
+ end
95
+
96
+ ##
97
+ # @api public
98
+ #
99
+ # @return [Boolean] true if called for the first time, false otherwise (similarly as Kernel#require).
100
+ #
101
+ # @see https://ruby-doc.org/core-3.1.2/Kernel.html#method-i-require
102
+ #
103
+ # @internal
104
+ # IMPORTANT: `step.validate!` is intentionally removed from `steps.each { |step| step.validate! && step.define! }.freeze` since it is NOT idempotent.
105
+ #
106
+ # NOTE: `step.validate!` is still useful as a `doctor` command.
107
+ #
108
+ def commit!
109
+ return false if committed?
110
+
111
+ expression.each_step(&:define!).freeze
112
+
113
+ steps.freeze
114
+
115
+ freeze
116
+
117
+ true
118
+ end
119
+
120
+ ##
121
+ # @api public
122
+ #
123
+ # @return [Boolean]
124
+ #
125
+ def committed?
126
+ expression.frozen?
127
+ end
128
+
129
+ ##
130
+ # @api public
131
+ #
132
+ # @param block [Proc, nil]
133
+ # @return [Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step>, Enumerator]
134
+ #
135
+ def each(&block)
136
+ expression.each_step(&block)
137
+ end
138
+
139
+ ##
140
+ # @api public
141
+ #
142
+ # @param block [Proc, nil]
143
+ # @return [Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step>, Enumerator]
144
+ #
145
+ def each_step(&block)
146
+ expression.each_step(&block)
147
+ end
148
+
149
+ ##
150
+ # @api public
151
+ #
152
+ # @param block [Proc, nil]
153
+ # @return [Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step>, Enumerator]
154
+ #
155
+ def each_evaluated_step(&block)
156
+ expression.each_evaluated_step(&block)
157
+ end
158
+
159
+ ##
160
+ # @api public
161
+ #
162
+ # Returns step by index.
163
+ #
164
+ # @param index [Integer]
165
+ # @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
166
+ #
167
+ # @note Works in a similar way as `Array#[]`.
168
+ # @see https://ruby-doc.org/core-2.7.0/Array.html#method-i-5B-5D
169
+ #
170
+ def [](index)
171
+ steps[index]
172
+ end
173
+
174
+ ##
175
+ # @return [String]
176
+ #
177
+ def inspect
178
+ expression.inspect
179
+ end
180
+
181
+ ##
182
+ # @api public
183
+ #
184
+ # @param other [Object] Can be any type.
185
+ # @return [Boolean, nil]
186
+ #
187
+ def ==(other)
188
+ return unless other.instance_of?(self.class)
189
+
190
+ return false if container != other.container
191
+ return false if expression != other.expression
192
+ return false if steps != other.steps
193
+
194
+ true
195
+ end
196
+
197
+ ##
198
+ # @return [ConvenientService::Support::Arguments]
199
+ #
200
+ def to_arguments
201
+ Support::Arguments.new(container: container, expression: expression, steps: steps)
202
+ end
203
+
204
+ private
205
+
206
+ ##
207
+ # @return [Integer]
208
+ #
209
+ def next_available_index
210
+ steps.size
211
+ end
212
+
213
+ ##
214
+ # @return [Class<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step>]
215
+ #
216
+ def step_class
217
+ container.step_class
218
+ end
219
+ end
220
+ end
221
+ end
222
+ end
223
+ end
224
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "entities/expressions"
4
+ require_relative "entities/step_collection"
@@ -0,0 +1,95 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Service
5
+ module Plugins
6
+ module CanHaveConnectedSteps
7
+ module Exceptions
8
+ class FirstStepIsNotSet < ::ConvenientService::Exception
9
+ ##
10
+ # @param container [Class<ConvenientService::Service>]
11
+ # @return [void]
12
+ #
13
+ # @internal
14
+ # TODO: Use `display_name`.
15
+ #
16
+ def initialize_with_kwargs(container:)
17
+ message = <<~TEXT
18
+ First step of `#{container}` is NOT set.
19
+
20
+ Did you forget to use `step`? For example:
21
+
22
+ class #{container}
23
+ # ...
24
+
25
+ step SomeService
26
+
27
+ # ...
28
+ end
29
+ TEXT
30
+
31
+ initialize(message)
32
+ end
33
+ end
34
+
35
+ class FirstGroupStepIsNotSet < ::ConvenientService::Exception
36
+ ##
37
+ # @param container [Class<ConvenientService::Service>]
38
+ # @return [void]
39
+ #
40
+ # @internal
41
+ # TODO: Use `display_name`.
42
+ #
43
+ def initialize_with_kwargs(container:, method:)
44
+ message = <<~TEXT
45
+ First step of `#{method}` from `#{container}` is NOT set.
46
+
47
+ Did you forget to use `step`? For example:
48
+
49
+ class #{container}
50
+ # ...
51
+
52
+ #{method} do
53
+ step SomeService
54
+
55
+ # ...
56
+ end
57
+
58
+ # ...
59
+ end
60
+ TEXT
61
+
62
+ initialize(message)
63
+ end
64
+ end
65
+
66
+ class EmptyExpressionHasNoResult < ::ConvenientService::Exception
67
+ ##
68
+ # @return [void]
69
+ #
70
+ def initialize_without_arguments
71
+ message = <<~TEXT
72
+ Empty expression has NO result.
73
+ TEXT
74
+
75
+ initialize(message)
76
+ end
77
+ end
78
+
79
+ class EmptyExpressionHasNoStatus < ::ConvenientService::Exception
80
+ ##
81
+ # @return [void]
82
+ #
83
+ def initialize_without_arguments
84
+ message = <<~TEXT
85
+ Empty expression has NO status.
86
+ TEXT
87
+
88
+ initialize(message)
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Service
5
+ module Plugins
6
+ module CanHaveConnectedSteps
7
+ class Middleware < MethodChainMiddleware
8
+ intended_for :result, entity: :service
9
+
10
+ ##
11
+ # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
12
+ #
13
+ def next(...)
14
+ return chain.next(...) if entity.steps.none?
15
+
16
+ entity.steps.each_evaluated_step do |step|
17
+ step.save_outputs_in_organizer!
18
+
19
+ step.trigger_callback
20
+
21
+ step.mark_as_completed!
22
+ end
23
+
24
+ entity.steps.result
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "can_have_connected_steps/concern"
4
+ require_relative "can_have_connected_steps/entities"
5
+ require_relative "can_have_connected_steps/exceptions"
6
+ require_relative "can_have_connected_steps/middleware"
@@ -25,6 +25,15 @@ module ConvenientService
25
25
  def fallback_error_result
26
26
  ::ConvenientService.raise Exceptions::FallbackResultIsNotOverridden.new(service: self, status: :error)
27
27
  end
28
+
29
+ ##
30
+ # Returns `ConvenientService::Service::Plugins::HasJSendResult::Entities::Result` when overridden.
31
+ #
32
+ # @raise [ConvenientService::Service::Plugins::CanHaveFallbacks::Exceptions::FallbackResultIsNotOverridden]
33
+ #
34
+ def fallback_result
35
+ ::ConvenientService.raise Exceptions::FallbackResultIsNotOverridden.new(service: self, status: nil)
36
+ end
28
37
  end
29
38
 
30
39
  class_methods do
@@ -97,6 +106,15 @@ module ConvenientService
97
106
  def fallback_error_result(...)
98
107
  new(...).fallback_error_result
99
108
  end
109
+
110
+ ##
111
+ # Returns `ConvenientService::Service::Plugins::HasJSendResult::Entities::Result` when `#fallback_result` is overridden.
112
+ #
113
+ # @raise [ConvenientService::Service::Plugins::CanHaveFallbacks::Exceptions::FallbackResultIsNotOverridden]
114
+ #
115
+ def fallback_result(...)
116
+ new(...).fallback_result
117
+ end
100
118
  end
101
119
  end
102
120
  end
@@ -8,26 +8,44 @@ module ConvenientService
8
8
  class FallbackResultIsNotOverridden < ::ConvenientService::Exception
9
9
  def initialize_with_kwargs(service:, status:)
10
10
  message = <<~TEXT
11
- Fallback #{status} result method (#fallback_#{status}_result) of `#{service.class}` is NOT overridden.
11
+ Fallback#{enclose(status, " ")}result method (#fallback#{enclose(status, "_")}result) of `#{service.class}` is NOT overridden.
12
12
 
13
- NOTE: Make sure overridden `fallback_#{status}_result` returns `success` with reasonable "null" data.
13
+ NOTE: Make sure overridden `fallback#{enclose(status, "_")}result` returns `success` with reasonable "null" data.
14
14
  TEXT
15
15
 
16
16
  initialize(message)
17
17
  end
18
+
19
+ private
20
+
21
+ ##
22
+ # @return [String]
23
+ #
24
+ def enclose(...)
25
+ ConvenientService::Utils::String.enclose(...)
26
+ end
18
27
  end
19
28
 
20
29
  class ServiceFallbackReturnValueNotSuccess < ::ConvenientService::Exception
21
30
  def initialize_with_kwargs(service:, result:, status:)
22
31
  message = <<~TEXT
23
- Return value of service `#{service.class}` `#{status}` fallback is NOT a `success`.
32
+ Return value of service `#{service.class}`#{enclose(status, " ")}fallback is NOT a `success`.
24
33
  It is `#{result.status}`.
25
34
 
26
- Did you accidentally call `failure` or `error` instead of `success` from the `fallback_#{status}_result` method?
35
+ Did you accidentally call `failure` or `error` instead of `success` from the `fallback#{enclose(status, "_")}result` method?
27
36
  TEXT
28
37
 
29
38
  initialize(message)
30
39
  end
40
+
41
+ private
42
+
43
+ ##
44
+ # @return [String]
45
+ #
46
+ def enclose(...)
47
+ ConvenientService::Utils::String.enclose(...)
48
+ end
31
49
  end
32
50
  end
33
51
  end
@@ -5,12 +5,12 @@ module ConvenientService
5
5
  module Plugins
6
6
  module CanHaveFallbacks
7
7
  class Middleware < MethodChainMiddleware
8
- intended_for [:fallback_failure_result, :fallback_error_result], entity: :service
8
+ intended_for [:fallback_failure_result, :fallback_error_result, :fallback_result], entity: :service
9
9
 
10
10
  ##
11
11
  # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
12
12
  #
13
- # @note Both `fallback_failure_result` and `fallback_error_result` are always successful, that is why their statuses are pre-checked.
13
+ # @note Both `fallback_failure_result`, `fallback_error_result` and `fallback_result` are always successful, that is why their statuses are pre-checked.
14
14
  #
15
15
  def next(...)
16
16
  fallback_result = chain.next(...)
@@ -24,7 +24,7 @@ module ConvenientService
24
24
  private
25
25
 
26
26
  ##
27
- # @return [Symbol]
27
+ # @return [Symbol, nil]
28
28
  #
29
29
  def status
30
30
  middleware_arguments.kwargs.fetch(:status)
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Service
5
+ module Plugins
6
+ module CanHaveRollbacks
7
+ class Middleware < MethodChainMiddleware
8
+ intended_for :result, entity: :service
9
+
10
+ ##
11
+ # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
12
+ #
13
+ def next(...)
14
+ result = chain.next(...)
15
+
16
+ rollback_result(result) if result.status.unsafe_not_success?
17
+
18
+ result
19
+ end
20
+
21
+ private
22
+
23
+ ##
24
+ # @param result [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
25
+ # @return [void]
26
+ #
27
+ # @internal
28
+ # IMPORTANT: Uses recursion inside `rollback_organizer`. Recursion has two exit conditions. When service has no steps. When service has only method steps.
29
+ #
30
+ def rollback_result(result)
31
+ result.from_step? ? rollback_organizer(result.service) : rollback_service(result.service)
32
+ end
33
+
34
+ ##
35
+ # Calls service own rollback.
36
+ #
37
+ # @param service [ConvenientService::Service]
38
+ # @return [void]
39
+ #
40
+ # @internal
41
+ # TODO: Compare what is faster `respond_to?` or `own_method`.
42
+ #
43
+ def rollback_service(service)
44
+ Utils::Object.safe_send(service, :rollback_result)
45
+ end
46
+
47
+ ##
48
+ # Calls organizer own rollback.
49
+ # Then calls organizer steps rollbacks with nestings in the reverse order.
50
+ #
51
+ # @param organizer [ConvenientService::Service]
52
+ # @return [void]
53
+ #
54
+ def rollback_organizer(organizer)
55
+ rollback_service(organizer)
56
+
57
+ organizer.steps
58
+ .select(&:completed?)
59
+ .reject(&:method_step?)
60
+ .reverse_each { |step| rollback_result(step.service_result) }
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "can_have_rollbacks/middleware"