convenient_service 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (639) hide show
  1. checksums.yaml +4 -4
  2. data/.dev/.tmuxinator.yml +4 -0
  3. data/.github/workflows/ci.yml +2 -0
  4. data/.gitignore +18 -0
  5. data/.vscode/CacheItsValue.code-snippets +15 -0
  6. data/.vscode/DelegateTo.code-snippets +15 -0
  7. data/.vscode/cache_its_value.code-snippets +17 -0
  8. data/.vscode/comparison.code-snippets +41 -0
  9. data/.vscode/delegate_to.code-snippets +20 -0
  10. data/Appraisals +24 -2
  11. data/CHANGELOG.md +138 -0
  12. data/Gemfile +11 -6
  13. data/README.md +11 -3
  14. data/ROADMAP.md +5 -1
  15. data/Taskfile.yml +260 -55
  16. data/benchmark/commit_config/ips.rb +18 -0
  17. data/benchmark/commit_config/profile.rb +30 -0
  18. data/benchmark/empty_service/ips.rb +123 -0
  19. data/benchmark/has_committed_config/ips.rb +78 -0
  20. data/benchmark/has_committed_config/profile.rb +30 -0
  21. data/convenient_service.gemspec +125 -4
  22. data/gemfiles/.gitkeep +0 -0
  23. data/lib/convenient_service/alias.rb +3 -0
  24. data/lib/convenient_service/aliases.rb +0 -4
  25. data/lib/convenient_service/common/plugins/assigns_attributes_in_constructor/using_active_model_attribute_assignment/middleware.rb +3 -1
  26. data/lib/convenient_service/common/plugins/caches_constructor_arguments/concern.rb +22 -0
  27. data/lib/convenient_service/common/plugins/caches_constructor_arguments/middleware.rb +22 -0
  28. data/lib/convenient_service/common/plugins/caches_constructor_arguments.rb +4 -0
  29. data/lib/convenient_service/common/plugins/caches_return_value/middleware.rb +12 -8
  30. data/lib/convenient_service/common/plugins/can_be_copied/concern.rb +22 -5
  31. data/lib/convenient_service/common/plugins/can_have_user_provided_entity/commands/find_or_create_entity.rb +9 -7
  32. data/lib/convenient_service/common/plugins/can_have_user_provided_entity/{errors.rb → exceptions.rb} +4 -4
  33. data/lib/convenient_service/common/plugins/can_have_user_provided_entity.rb +1 -1
  34. data/lib/convenient_service/common/plugins/can_utilize_finite_loop/concern.rb +40 -0
  35. data/lib/convenient_service/common/plugins/can_utilize_finite_loop/constants.rb +21 -0
  36. data/lib/convenient_service/common/plugins/can_utilize_finite_loop.rb +4 -0
  37. data/lib/convenient_service/common/plugins/has_around_callbacks/{errors.rb → exceptions.rb} +2 -2
  38. data/lib/convenient_service/common/plugins/has_around_callbacks/middleware.rb +9 -3
  39. data/lib/convenient_service/common/plugins/has_around_callbacks.rb +1 -1
  40. data/lib/convenient_service/common/plugins/has_callbacks/entities/callback.rb +1 -1
  41. data/lib/convenient_service/common/plugins/has_callbacks/middleware.rb +7 -1
  42. data/lib/convenient_service/common/plugins/has_constructor/concern.rb +3 -4
  43. data/lib/convenient_service/common/plugins/has_constructor_without_initialize/concern.rb +1 -9
  44. data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/has_cache/concern.rb +1 -1
  45. data/lib/convenient_service/common/plugins/has_j_send_result_duck_short_syntax/concern.rb +68 -0
  46. data/lib/convenient_service/common/plugins/has_j_send_result_duck_short_syntax.rb +3 -0
  47. data/lib/convenient_service/common/plugins/normalizes_env/middleware.rb +3 -1
  48. data/lib/convenient_service/common/plugins.rb +2 -1
  49. data/lib/convenient_service/configs/awesome_print_inspect/aliases.rb +7 -0
  50. data/lib/convenient_service/configs/awesome_print_inspect.rb +59 -0
  51. data/lib/convenient_service/configs/minimal.rb +67 -5
  52. data/lib/convenient_service/configs/standard.rb +92 -30
  53. data/lib/convenient_service/core/aliases.rb +4 -5
  54. data/lib/convenient_service/core/concern/class_methods.rb +129 -0
  55. data/lib/convenient_service/core/concern/instance_methods.rb +76 -0
  56. data/lib/convenient_service/core/concern.rb +25 -0
  57. data/lib/convenient_service/core/entities/config/commands/track_method_missing_commit_trigger.rb +2 -2
  58. data/lib/convenient_service/core/entities/config/entities/concerns/entities/middleware/commands/cast_middleware.rb +2 -2
  59. data/lib/convenient_service/core/entities/config/entities/concerns/entities/middleware.rb +1 -0
  60. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/commands/cast_caller.rb +2 -2
  61. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/concern/instance_methods.rb +9 -2
  62. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/constants.rb +26 -0
  63. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller.rb +1 -3
  64. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/concern/instance_methods.rb +10 -3
  65. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/base.rb +95 -0
  66. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable/entities/event.rb +95 -0
  67. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable/entities.rb +3 -0
  68. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable.rb +42 -0
  69. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/with.rb +50 -0
  70. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators.rb +6 -0
  71. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/commands/create_observable_middleware.rb +104 -0
  72. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/commands.rb +3 -0
  73. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/concern/class_methods.rb +115 -0
  74. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/concern/instance_methods.rb +70 -0
  75. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/concern.rb +32 -0
  76. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/constants.rb +36 -0
  77. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/structs/intended_method.rb +23 -0
  78. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/structs.rb +3 -0
  79. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base.rb +26 -0
  80. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands/create_observable_middleware.rb +90 -0
  81. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands.rb +3 -0
  82. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/class_methods.rb +37 -0
  83. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/instance_methods.rb +115 -0
  84. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern.rb +32 -0
  85. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/entities/method_chain.rb +86 -0
  86. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/entities.rb +3 -0
  87. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain.rb +34 -0
  88. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/classic.rb +42 -0
  89. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares.rb +6 -0
  90. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/stack.rb +46 -11
  91. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities.rb +2 -3
  92. data/lib/convenient_service/core/entities/config/entities/method_middlewares.rb +1 -1
  93. data/lib/convenient_service/core/entities/config/{errors.rb → exceptions.rb} +3 -3
  94. data/lib/convenient_service/core/entities/config.rb +19 -6
  95. data/lib/convenient_service/core/entities.rb +0 -1
  96. data/lib/convenient_service/core.rb +7 -5
  97. data/lib/convenient_service/dependencies/built_in.rb +11 -4
  98. data/lib/convenient_service/dependencies/extractions/active_support_backtrace_cleaner/backtrace_cleaner.rb +149 -0
  99. data/lib/convenient_service/dependencies/extractions/active_support_backtrace_cleaner.rb +15 -0
  100. data/lib/convenient_service/dependencies/extractions/active_support_concern/concern.rb +4 -3
  101. data/lib/convenient_service/dependencies/extractions/active_support_concern.rb +4 -3
  102. data/lib/convenient_service/dependencies.rb +256 -18
  103. data/lib/convenient_service/examples/dry/gemfile/dry_service/config.rb +19 -21
  104. data/lib/convenient_service/examples/dry/gemfile/services/assert_file_exists.rb +1 -1
  105. data/lib/convenient_service/examples/dry/gemfile/services/assert_file_not_empty.rb +1 -1
  106. data/lib/convenient_service/examples/dry/gemfile/services/assert_node_available.rb +2 -2
  107. data/lib/convenient_service/examples/dry/gemfile/services/assert_npm_package_available.rb +2 -2
  108. data/lib/convenient_service/examples/dry/gemfile/services/assert_valid_ruby_syntax.rb +2 -2
  109. data/lib/convenient_service/examples/dry/gemfile/services/format.rb +1 -1
  110. data/lib/convenient_service/examples/dry/gemfile/services/format_body.rb +1 -1
  111. data/lib/convenient_service/examples/dry/gemfile/services/format_gems_with_envs.rb +1 -1
  112. data/lib/convenient_service/examples/dry/gemfile/services/format_gems_without_envs.rb +1 -1
  113. data/lib/convenient_service/examples/dry/gemfile/services/format_header.rb +1 -1
  114. data/lib/convenient_service/examples/dry/gemfile/services/parse_content.rb +1 -1
  115. data/lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb +11 -4
  116. data/lib/convenient_service/examples/dry/gemfile/services/read_file_content.rb +1 -1
  117. data/lib/convenient_service/examples/dry/gemfile/services/{run_shell.rb → run_shell_command.rb} +10 -5
  118. data/lib/convenient_service/examples/dry/gemfile/services/strip_comments.rb +2 -2
  119. data/lib/convenient_service/examples/dry/gemfile/services.rb +3 -2
  120. data/lib/convenient_service/examples/dry/gemfile.rb +1 -1
  121. data/lib/convenient_service/examples/rails/gemfile/rails_service/config.rb +28 -30
  122. data/lib/convenient_service/examples/rails/gemfile/services/assert_file_exists.rb +2 -2
  123. data/lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb +2 -2
  124. data/lib/convenient_service/examples/rails/gemfile/services/assert_node_available.rb +2 -2
  125. data/lib/convenient_service/examples/rails/gemfile/services/assert_npm_package_available.rb +3 -3
  126. data/lib/convenient_service/examples/rails/gemfile/services/assert_valid_ruby_syntax.rb +2 -2
  127. data/lib/convenient_service/examples/rails/gemfile/services/format.rb +2 -2
  128. data/lib/convenient_service/examples/rails/gemfile/services/format_body.rb +1 -1
  129. data/lib/convenient_service/examples/rails/gemfile/services/format_gems_with_envs.rb +1 -1
  130. data/lib/convenient_service/examples/rails/gemfile/services/format_gems_without_envs.rb +1 -1
  131. data/lib/convenient_service/examples/rails/gemfile/services/format_header.rb +1 -1
  132. data/lib/convenient_service/examples/rails/gemfile/services/merge_sections.rb +3 -3
  133. data/lib/convenient_service/examples/rails/gemfile/services/parse_content.rb +2 -2
  134. data/lib/convenient_service/examples/rails/gemfile/services/print_shell_command.rb +11 -4
  135. data/lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb +2 -2
  136. data/lib/convenient_service/examples/rails/gemfile/services/replace_file_content.rb +3 -3
  137. data/lib/convenient_service/examples/rails/gemfile/services/{run_shell.rb → run_shell_command.rb} +11 -6
  138. data/lib/convenient_service/examples/rails/gemfile/services/strip_comments.rb +3 -3
  139. data/lib/convenient_service/examples/rails/gemfile/services.rb +2 -2
  140. data/lib/convenient_service/examples/rails/gemfile.rb +1 -1
  141. data/lib/convenient_service/examples/standard/cowsay/services/build_cloud.rb +1 -1
  142. data/lib/convenient_service/examples/standard/cowsay/services/build_cow.rb +1 -1
  143. data/lib/convenient_service/examples/standard/cowsay/services/print.rb +1 -1
  144. data/lib/convenient_service/examples/standard/cowsay.rb +1 -1
  145. data/lib/convenient_service/examples/standard/date_time/services/safe_parse.rb +31 -0
  146. data/lib/convenient_service/examples/standard/date_time/services.rb +3 -0
  147. data/lib/convenient_service/examples/standard/date_time.rb +23 -0
  148. data/lib/convenient_service/examples/standard/factorial/services/calculate.rb +49 -0
  149. data/lib/convenient_service/examples/standard/factorial/services.rb +3 -0
  150. data/lib/convenient_service/examples/standard/factorial/utils/timeout/with_timeout.rb +50 -0
  151. data/lib/convenient_service/examples/standard/factorial/utils/timeout.rb +21 -0
  152. data/lib/convenient_service/examples/standard/factorial/utils.rb +3 -0
  153. data/lib/convenient_service/examples/standard/factorial.rb +24 -0
  154. data/lib/convenient_service/examples/standard/gemfile/services/assert_file_exists.rb +1 -1
  155. data/lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb +1 -1
  156. data/lib/convenient_service/examples/standard/gemfile/services/assert_node_available.rb +2 -2
  157. data/lib/convenient_service/examples/standard/gemfile/services/assert_npm_package_available.rb +2 -2
  158. data/lib/convenient_service/examples/standard/gemfile/services/assert_valid_ruby_syntax.rb +2 -2
  159. data/lib/convenient_service/examples/standard/gemfile/services/format.rb +1 -1
  160. data/lib/convenient_service/examples/standard/gemfile/services/format_body.rb +1 -1
  161. data/lib/convenient_service/examples/standard/gemfile/services/format_gems_with_envs.rb +1 -1
  162. data/lib/convenient_service/examples/standard/gemfile/services/format_gems_without_envs.rb +1 -1
  163. data/lib/convenient_service/examples/standard/gemfile/services/format_header.rb +1 -1
  164. data/lib/convenient_service/examples/standard/gemfile/services/merge_sections.rb +1 -1
  165. data/lib/convenient_service/examples/standard/gemfile/services/parse_content.rb +1 -1
  166. data/lib/convenient_service/examples/standard/gemfile/services/print_shell_command.rb +15 -8
  167. data/lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb +2 -2
  168. data/lib/convenient_service/examples/standard/gemfile/services/replace_file_content.rb +1 -1
  169. data/lib/convenient_service/examples/standard/gemfile/services/{run_shell.rb → run_shell_command.rb} +22 -5
  170. data/lib/convenient_service/examples/standard/gemfile/services/strip_comments.rb +2 -2
  171. data/lib/convenient_service/examples/standard/gemfile/services.rb +2 -2
  172. data/lib/convenient_service/examples/standard/gemfile.rb +1 -1
  173. data/lib/convenient_service/examples/standard/request_params/constants.rb +1 -1
  174. data/lib/convenient_service/examples/standard/request_params/entities/description.rb +1 -1
  175. data/lib/convenient_service/examples/standard/request_params/entities/format.rb +1 -1
  176. data/lib/convenient_service/examples/standard/request_params/entities/id.rb +1 -1
  177. data/lib/convenient_service/examples/standard/request_params/entities/logger.rb +1 -1
  178. data/lib/convenient_service/examples/standard/request_params/entities/request.rb +1 -1
  179. data/lib/convenient_service/examples/standard/request_params/entities/source.rb +1 -1
  180. data/lib/convenient_service/examples/standard/request_params/entities/tag.rb +1 -1
  181. data/lib/convenient_service/examples/standard/request_params/entities/title.rb +1 -1
  182. data/lib/convenient_service/examples/standard/request_params/services/apply_default_param_values.rb +1 -1
  183. data/lib/convenient_service/examples/standard/request_params/services/cast_params.rb +1 -1
  184. data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_body.rb +1 -1
  185. data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_path.rb +1 -1
  186. data/lib/convenient_service/examples/standard/request_params/services/filter_out_unpermitted_params.rb +1 -1
  187. data/lib/convenient_service/examples/standard/request_params/services/log_request_params.rb +1 -1
  188. data/lib/convenient_service/examples/standard/request_params/services/merge_params.rb +1 -1
  189. data/lib/convenient_service/examples/standard/request_params/services/prepare.rb +1 -1
  190. data/lib/convenient_service/examples/standard/request_params/services/validate_casted_params.rb +1 -1
  191. data/lib/convenient_service/examples/standard/request_params/services/validate_uncasted_params.rb +1 -1
  192. data/lib/convenient_service/examples/standard/request_params/utils/array/wrap.rb +2 -2
  193. data/lib/convenient_service/examples/standard/request_params/utils/array.rb +1 -1
  194. data/lib/convenient_service/examples/standard/request_params/utils/http/request/parse_body.rb +2 -2
  195. data/lib/convenient_service/examples/standard/request_params/utils/http/request/parse_path.rb +2 -2
  196. data/lib/convenient_service/examples/standard/request_params/utils/http/request.rb +1 -1
  197. data/lib/convenient_service/examples/standard/request_params/utils/integer/safe_parse.rb +2 -2
  198. data/lib/convenient_service/examples/standard/request_params/utils/integer.rb +1 -1
  199. data/lib/convenient_service/examples/standard/request_params/utils/json/safe_parse.rb +2 -2
  200. data/lib/convenient_service/examples/standard/request_params/utils/json.rb +1 -1
  201. data/lib/convenient_service/examples/standard/request_params/utils/object/blank.rb +2 -2
  202. data/lib/convenient_service/examples/standard/request_params/utils/object/present.rb +2 -2
  203. data/lib/convenient_service/examples/standard/request_params/utils/object.rb +1 -1
  204. data/lib/convenient_service/examples/standard/request_params/utils/url/valid.rb +47 -0
  205. data/lib/convenient_service/examples/standard/request_params/utils/url.rb +21 -0
  206. data/lib/convenient_service/examples/standard/request_params/utils.rb +1 -0
  207. data/lib/convenient_service/examples/standard/request_params.rb +1 -1
  208. data/lib/convenient_service/exception.rb +16 -0
  209. data/lib/convenient_service/feature.rb +0 -1
  210. data/lib/convenient_service/logger.rb +69 -24
  211. data/lib/convenient_service/rspec/helpers/custom/ignoring_exception/exceptions.rb +27 -0
  212. data/lib/convenient_service/rspec/helpers/custom/ignoring_exception.rb +51 -0
  213. data/lib/convenient_service/rspec/helpers/custom/stub_service/entities/result_spec.rb +2 -2
  214. data/lib/convenient_service/rspec/helpers/custom/stub_service/entities/stubbed_service.rb +20 -16
  215. data/lib/convenient_service/rspec/helpers/custom/wrap_method/entities/wrapped_method.rb +110 -53
  216. data/lib/convenient_service/rspec/helpers/custom/wrap_method/{errors.rb → exceptions.rb} +2 -2
  217. data/lib/convenient_service/rspec/helpers/custom/wrap_method.rb +31 -7
  218. data/lib/convenient_service/rspec/helpers/custom.rb +1 -1
  219. data/lib/convenient_service/rspec/helpers/{ignoring_error.rb → ignoring_exception.rb} +3 -3
  220. data/lib/convenient_service/rspec/helpers.rb +2 -2
  221. data/lib/convenient_service/rspec/matchers/custom/be_descendant_of.rb +1 -1
  222. data/lib/convenient_service/rspec/matchers/custom/cache_its_value.rb +20 -0
  223. data/lib/convenient_service/rspec/matchers/custom/call_chain_next.rb +103 -2
  224. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings/sub_matchers/return_its_value.rb +3 -0
  225. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_concrete_arguments.rb +1 -1
  226. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings_collection/{errors.rb → exceptions.rb} +4 -4
  227. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings_collection.rb +11 -11
  228. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher.rb +5 -5
  229. data/lib/convenient_service/rspec/matchers/custom/delegate_to.rb +13 -3
  230. data/lib/convenient_service/rspec/matchers/custom/export.rb +9 -9
  231. data/lib/convenient_service/rspec/matchers/custom/have_abstract_method.rb +1 -1
  232. data/lib/convenient_service/rspec/matchers/custom/have_alias_method.rb +3 -0
  233. data/lib/convenient_service/rspec/matchers/custom/results/base/constants.rb +9 -0
  234. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/chain.rb +226 -0
  235. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_code_part.rb +61 -0
  236. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_data_part.rb +61 -0
  237. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_message_part.rb +61 -0
  238. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_parts.rb +121 -0
  239. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_service_part.rb +61 -0
  240. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_status_part.rb +68 -0
  241. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_step_part.rb +61 -0
  242. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_got_parts.rb +98 -0
  243. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_got_service_part.rb +68 -0
  244. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_got_step_part.rb +68 -0
  245. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands.rb +13 -0
  246. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base.rb +207 -0
  247. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/error/commands/generate_got_jsend_attributes_part.rb +120 -0
  248. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/error/commands.rb +3 -0
  249. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/error.rb +34 -0
  250. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/failure/commands/generate_got_jsend_attributes_part.rb +121 -0
  251. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/failure/commands.rb +3 -0
  252. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/failure.rb +34 -0
  253. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/null.rb +147 -0
  254. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb +96 -0
  255. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/success/commands.rb +3 -0
  256. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/success.rb +34 -0
  257. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers.rb +46 -0
  258. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result.rb +121 -0
  259. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_code.rb +97 -0
  260. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_data.rb +97 -0
  261. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_message.rb +97 -0
  262. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_service.rb +81 -0
  263. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_status.rb +92 -0
  264. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_step.rb +127 -0
  265. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_type.rb +89 -0
  266. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands.rb +10 -0
  267. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator.rb +123 -0
  268. data/lib/convenient_service/rspec/matchers/custom/results/base/entities.rb +5 -0
  269. data/lib/convenient_service/rspec/matchers/custom/results/base/{errors.rb → exceptions.rb} +8 -2
  270. data/lib/convenient_service/rspec/matchers/custom/results/base.rb +112 -149
  271. data/lib/convenient_service/rspec/matchers/custom/results/be_error.rb +6 -1
  272. data/lib/convenient_service/rspec/matchers/custom/results/be_failure.rb +6 -1
  273. data/lib/convenient_service/rspec/matchers/custom/results/be_not_error.rb +7 -2
  274. data/lib/convenient_service/rspec/matchers/custom/results/be_not_failure.rb +7 -2
  275. data/lib/convenient_service/rspec/matchers/custom/results/be_not_success.rb +7 -2
  276. data/lib/convenient_service/rspec/matchers/custom/results/be_success.rb +6 -1
  277. data/lib/convenient_service/rspec/matchers/results/be_error.rb +3 -0
  278. data/lib/convenient_service/rspec/matchers/results/be_failure.rb +3 -0
  279. data/lib/convenient_service/rspec/matchers/results/be_not_error.rb +3 -0
  280. data/lib/convenient_service/rspec/matchers/results/be_not_failure.rb +3 -0
  281. data/lib/convenient_service/rspec/matchers/results/be_not_success.rb +3 -0
  282. data/lib/convenient_service/rspec/matchers/results/be_success.rb +3 -0
  283. data/lib/convenient_service/service/plugins/can_have_fallback/concern.rb +93 -0
  284. data/lib/convenient_service/service/plugins/can_have_fallback/exceptions.rb +36 -0
  285. data/lib/convenient_service/service/plugins/can_have_fallback/middleware.rb +30 -0
  286. data/lib/convenient_service/service/plugins/can_have_fallback.rb +5 -0
  287. data/lib/convenient_service/service/plugins/can_have_method_steps/middleware.rb +5 -24
  288. data/lib/convenient_service/service/plugins/can_have_steps/concern.rb +3 -0
  289. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method.rb +5 -5
  290. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method_factory.rb +1 -1
  291. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb +2 -2
  292. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb +96 -26
  293. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/alias.rb +2 -2
  294. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/base.rb +49 -7
  295. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/proc.rb +1 -1
  296. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/raw.rb +1 -1
  297. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/reassignment.rb +2 -2
  298. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/usual.rb +2 -2
  299. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/base.rb +27 -4
  300. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/input.rb +2 -2
  301. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/output.rb +1 -1
  302. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/base.rb +1 -1
  303. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb +31 -1
  304. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/name.rb +31 -1
  305. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/{errors.rb → exceptions.rb} +81 -15
  306. data/lib/convenient_service/service/plugins/can_have_steps/entities/method.rb +1 -1
  307. data/lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/class_methods.rb +46 -0
  308. data/lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb +64 -0
  309. data/lib/convenient_service/service/plugins/can_have_steps/entities/service/concern.rb +28 -0
  310. data/lib/convenient_service/service/plugins/can_have_steps/entities/service.rb +7 -30
  311. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb +39 -2
  312. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/extract_params.rb +2 -4
  313. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb +229 -64
  314. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/{errors.rb → exceptions.rb} +3 -3
  315. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_completed/concern.rb +44 -0
  316. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_completed.rb +3 -0
  317. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed/middleware.rb +36 -0
  318. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed.rb +3 -0
  319. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_printed/middleware.rb +32 -0
  320. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_printed.rb +3 -0
  321. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/concern.rb +37 -0
  322. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step.rb +6 -0
  323. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed/exceptions.rb +38 -0
  324. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed/middleware.rb +72 -0
  325. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed.rb +4 -0
  326. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/concern.rb +30 -0
  327. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step.rb +5 -0
  328. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback/concern.rb +53 -0
  329. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback/middleware.rb +34 -0
  330. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback/result.rb +3 -0
  331. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback.rb +4 -0
  332. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_parent_result/middleware.rb +4 -2
  333. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect/concern.rb +45 -0
  334. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect.rb +3 -0
  335. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_inspect/concern.rb +5 -1
  336. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins.rb +4 -0
  337. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/structs/params.rb +1 -1
  338. data/lib/convenient_service/service/plugins/can_have_steps/entities/step.rb +1 -1
  339. data/lib/convenient_service/service/plugins/can_have_steps/middleware.rb +38 -9
  340. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/fetch_all_services_stubbed_results_cache.rb +30 -0
  341. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/fetch_service_stubbed_results_cache.rb +43 -0
  342. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/get_service_stubbed_result.rb +58 -0
  343. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/set_service_stubbed_result.rb +66 -0
  344. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands.rb +6 -0
  345. data/lib/convenient_service/service/plugins/can_have_stubbed_results/concern.rb +46 -0
  346. data/lib/convenient_service/service/plugins/can_have_stubbed_results/container.rb +17 -0
  347. data/lib/convenient_service/service/plugins/can_have_stubbed_results/middleware.rb +65 -0
  348. data/lib/convenient_service/service/plugins/can_have_stubbed_results.rb +6 -0
  349. data/lib/convenient_service/service/plugins/can_recalculate_result/concern.rb +1 -1
  350. data/lib/convenient_service/service/plugins/collects_services_in_exception/commands/extract_service_details.rb +64 -0
  351. data/lib/convenient_service/service/plugins/collects_services_in_exception/commands.rb +3 -0
  352. data/lib/convenient_service/service/plugins/collects_services_in_exception/constants.rb +16 -0
  353. data/lib/convenient_service/service/plugins/collects_services_in_exception/middleware.rb +50 -0
  354. data/lib/convenient_service/service/plugins/collects_services_in_exception.rb +5 -0
  355. data/lib/convenient_service/service/plugins/counts_stubbed_results_invocations/middleware.rb +24 -0
  356. data/lib/convenient_service/service/plugins/counts_stubbed_results_invocations.rb +3 -0
  357. data/lib/convenient_service/service/plugins/has_awesome_print_inspect/concern.rb +39 -0
  358. data/lib/convenient_service/service/plugins/has_awesome_print_inspect.rb +3 -0
  359. data/lib/convenient_service/service/plugins/has_inspect/concern.rb +8 -1
  360. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/commands/create_result_class.rb +1 -1
  361. data/lib/convenient_service/service/plugins/has_j_send_result/commands/is_result.rb +34 -0
  362. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/commands.rb +2 -0
  363. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/concern/class_methods.rb +21 -18
  364. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/concern/instance_methods.rb +13 -12
  365. data/lib/convenient_service/service/plugins/has_j_send_result/concern.rb +22 -0
  366. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/constants.rb +1 -1
  367. data/lib/convenient_service/service/plugins/has_j_send_result/container.rb +21 -0
  368. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/concern.rb +1 -1
  369. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/aliases.rb +7 -0
  370. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_own_result/concern.rb +142 -0
  371. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_own_result.rb +3 -0
  372. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_stubbed_result/concern.rb +30 -0
  373. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_stubbed_result.rb +3 -0
  374. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status/concern.rb +30 -0
  375. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status/middleware.rb +43 -0
  376. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status.rb +4 -0
  377. data/lib/convenient_service/service/plugins/{has_result/entities/result/plugins/has_step → has_j_send_result/entities/result/plugins/can_have_fallback}/concern.rb +7 -4
  378. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_fallback.rb +3 -0
  379. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_have_parent_result/concern.rb +8 -5
  380. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_have_parent_result/constants.rb +1 -1
  381. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_have_parent_result.rb +0 -2
  382. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_step/concern.rb +30 -0
  383. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_step.rb +3 -0
  384. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_recalculate_result/concern.rb +1 -1
  385. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect/concern.rb +38 -0
  386. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect.rb +3 -0
  387. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_inspect/concern.rb +2 -3
  388. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/commands/cast_j_send_attributes.rb +99 -0
  389. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/commands/create_code_class.rb +1 -1
  390. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/commands/create_data_class.rb +1 -1
  391. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/commands/create_message_class.rb +1 -1
  392. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/commands/create_status_class.rb +1 -1
  393. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/concern/class_methods.rb +125 -0
  394. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/concern/instance_methods.rb +58 -14
  395. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/concern.rb +1 -1
  396. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/commands/is_code.rb +49 -0
  397. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/commands.rb +3 -0
  398. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/class_methods.rb +14 -2
  399. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb +123 -0
  400. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern.rb +1 -1
  401. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/aliases.rb +7 -0
  402. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_awesome_print_inspect/concern.rb +46 -0
  403. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_awesome_print_inspect.rb +3 -0
  404. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_inspect/concern.rb +38 -0
  405. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_inspect.rb +3 -0
  406. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins.rb +5 -0
  407. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/code.rb +3 -1
  408. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/commands/is_data.rb +49 -0
  409. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/commands.rb +3 -0
  410. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/class_methods.rb +14 -2
  411. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/instance_methods.rb +183 -0
  412. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern.rb +1 -1
  413. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/aliases.rb +7 -0
  414. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_awesome_print_inspect/concern.rb +46 -0
  415. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_awesome_print_inspect.rb +3 -0
  416. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_inspect/commands/generate_inspect_output.rb +77 -0
  417. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_inspect/commands.rb +3 -0
  418. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_inspect/concern.rb +41 -0
  419. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_inspect.rb +4 -0
  420. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins.rb +5 -0
  421. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/data.rb +3 -1
  422. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/commands/is_message.rb +49 -0
  423. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/commands.rb +3 -0
  424. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/class_methods.rb +14 -2
  425. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb +116 -0
  426. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern.rb +1 -1
  427. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/aliases.rb +7 -0
  428. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_awesome_print_inspect/concern.rb +46 -0
  429. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_awesome_print_inspect.rb +3 -0
  430. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_inspect/concern.rb +38 -0
  431. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_inspect.rb +3 -0
  432. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins.rb +5 -0
  433. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/message.rb +3 -1
  434. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/commands/is_status.rb +49 -0
  435. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/commands.rb +3 -0
  436. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/class_methods.rb +14 -2
  437. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb +31 -6
  438. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern.rb +1 -1
  439. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/aliases.rb +7 -0
  440. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_awesome_print_inspect/concern.rb +46 -0
  441. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_awesome_print_inspect.rb +3 -0
  442. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_inspect/concern.rb +38 -0
  443. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_inspect.rb +3 -0
  444. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins.rb +5 -0
  445. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/status.rb +3 -1
  446. data/lib/convenient_service/service/plugins/{has_result/entities/result/plugins/has_j_send_status_and_attributes/errors.rb → has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/exceptions.rb} +3 -3
  447. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/middleware.rb +5 -3
  448. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/structs/j_send_attributes.rb +2 -2
  449. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes.rb +1 -1
  450. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter/concern.rb +30 -0
  451. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter/middleware.rb +38 -0
  452. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter.rb +4 -0
  453. data/lib/convenient_service/service/plugins/{has_result/entities/result/plugins/raises_on_not_checked_result_status/errors.rb → has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/exceptions.rb} +3 -3
  454. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +47 -0
  455. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/raises_on_not_checked_result_status.rb +1 -1
  456. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins.rb +6 -3
  457. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result.rb +1 -1
  458. data/lib/convenient_service/service/plugins/has_j_send_result/exceptions.rb +21 -0
  459. data/lib/convenient_service/service/plugins/has_j_send_result.rb +8 -0
  460. data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_active_model_validations/concern.rb +1 -1
  461. data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_active_model_validations/middleware.rb +4 -2
  462. data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_dry_validation/concern.rb +1 -1
  463. data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_dry_validation/middleware.rb +5 -3
  464. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/concern.rb +1 -1
  465. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error/commands/assert_args_count_lower_than_three.rb +2 -2
  466. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error/commands/assert_either_args_or_kwargs_are_passed.rb +2 -2
  467. data/lib/convenient_service/service/plugins/{has_result_short_syntax/error/errors.rb → has_j_send_result_short_syntax/error/exceptions.rb} +4 -4
  468. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error/middleware.rb +5 -3
  469. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error.rb +1 -1
  470. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/commands/assert_kwargs_contain_only_j_send_keys.rb +53 -0
  471. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/commands.rb +3 -0
  472. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/exceptions.rb +29 -0
  473. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/middleware.rb +23 -0
  474. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/failure.rb +1 -1
  475. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/success/commands/refute_kwargs_contain_data_and_extra_keys.rb +2 -2
  476. data/lib/convenient_service/service/plugins/{has_result_short_syntax/success/errors.rb → has_j_send_result_short_syntax/success/exceptions.rb} +3 -3
  477. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/success/middleware.rb +5 -3
  478. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/success.rb +1 -1
  479. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax.rb +6 -0
  480. data/lib/convenient_service/service/plugins/{has_result_status_check_short_syntax → has_j_send_result_status_check_short_syntax}/concern.rb +1 -1
  481. data/lib/convenient_service/service/plugins/has_j_send_result_status_check_short_syntax.rb +3 -0
  482. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/concern.rb +24 -0
  483. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_lines.rb +94 -0
  484. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_method_step_lines.rb +115 -0
  485. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_result_lines.rb +105 -0
  486. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_service_lines.rb +88 -0
  487. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_service_step_lines.rb +127 -0
  488. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands.rb +7 -0
  489. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb +90 -0
  490. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb +144 -0
  491. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/template.rb +85 -0
  492. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities.rb +5 -0
  493. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/templates/flowchart.html.erb +95 -0
  494. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart.rb +108 -0
  495. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities.rb +3 -0
  496. data/lib/convenient_service/service/plugins/has_mermaid_flowchart.rb +4 -0
  497. data/lib/convenient_service/service/plugins/has_result/concern.rb +17 -6
  498. data/lib/convenient_service/service/plugins/has_result/exceptions.rb +21 -0
  499. data/lib/convenient_service/service/plugins/has_result.rb +1 -5
  500. data/lib/convenient_service/service/plugins/raises_on_double_result/{errors.rb → exceptions.rb} +2 -2
  501. data/lib/convenient_service/service/plugins/raises_on_double_result/middleware.rb +11 -9
  502. data/lib/convenient_service/service/plugins/raises_on_double_result.rb +1 -1
  503. data/lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb +24 -0
  504. data/lib/convenient_service/service/plugins/raises_on_not_result_return_value/middleware.rb +25 -0
  505. data/lib/convenient_service/service/plugins/raises_on_not_result_return_value.rb +4 -0
  506. data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/middleware.rb +38 -4
  507. data/lib/convenient_service/service/plugins/sets_parent_to_foreign_result/middleware.rb +56 -0
  508. data/lib/convenient_service/service/plugins/sets_parent_to_foreign_result.rb +3 -0
  509. data/lib/convenient_service/service/plugins/wraps_result_in_db_transaction/middleware.rb +3 -1
  510. data/lib/convenient_service/service/plugins.rb +14 -6
  511. data/lib/convenient_service/support/abstract_method/{errors.rb → exceptions.rb} +2 -2
  512. data/lib/convenient_service/support/abstract_method.rb +2 -2
  513. data/lib/convenient_service/support/cache/constants.rb +36 -0
  514. data/lib/convenient_service/support/cache/entities/caches/array/entities/pair.rb +52 -0
  515. data/lib/convenient_service/support/cache/entities/caches/array/entities.rb +3 -0
  516. data/lib/convenient_service/support/cache/entities/caches/array.rb +135 -0
  517. data/lib/convenient_service/support/cache/entities/caches/base.rb +112 -0
  518. data/lib/convenient_service/support/cache/entities/caches/hash.rb +113 -0
  519. data/lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb +89 -0
  520. data/lib/convenient_service/support/cache/entities/caches.rb +8 -0
  521. data/lib/convenient_service/support/cache/entities/key.rb +102 -0
  522. data/lib/convenient_service/support/cache/entities.rb +4 -0
  523. data/lib/convenient_service/support/cache/exceptions.rb +34 -0
  524. data/lib/convenient_service/support/cache.rb +16 -143
  525. data/lib/convenient_service/support/castable/{errors.rb → exceptions.rb} +3 -3
  526. data/lib/convenient_service/support/castable.rb +2 -2
  527. data/lib/convenient_service/support/command.rb +42 -3
  528. data/lib/convenient_service/support/copyable.rb +7 -23
  529. data/lib/convenient_service/support/counter.rb +7 -8
  530. data/lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb +2 -2
  531. data/lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb +8 -8
  532. data/lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb +2 -2
  533. data/lib/convenient_service/support/dependency_container/entities/method.rb +49 -12
  534. data/lib/convenient_service/support/dependency_container/entities/method_collection.rb +3 -3
  535. data/lib/convenient_service/support/dependency_container/{errors.rb → exceptions.rb} +5 -5
  536. data/lib/convenient_service/support/dependency_container/export.rb +4 -4
  537. data/lib/convenient_service/support/dependency_container/import.rb +7 -4
  538. data/lib/convenient_service/support/dependency_container.rb +1 -1
  539. data/lib/convenient_service/support/finite_loop.rb +8 -8
  540. data/lib/convenient_service/support/gems/logger.rb +37 -0
  541. data/lib/convenient_service/support/gems/paint.rb +37 -0
  542. data/lib/convenient_service/support/gems.rb +2 -0
  543. data/lib/convenient_service/support/safe_method.rb +1 -1
  544. data/lib/convenient_service/support/thread_safe_counter.rb +9 -0
  545. data/lib/convenient_service/support.rb +1 -0
  546. data/lib/convenient_service/utils/array/contain_exactly.rb +1 -5
  547. data/lib/convenient_service/utils/array/{errors.rb → exceptions.rb} +2 -2
  548. data/lib/convenient_service/utils/array/limited_push.rb +54 -0
  549. data/lib/convenient_service/utils/array/merge.rb +3 -3
  550. data/lib/convenient_service/utils/array.rb +6 -1
  551. data/lib/convenient_service/utils/class/display_name.rb +49 -0
  552. data/lib/convenient_service/utils/class.rb +20 -0
  553. data/lib/convenient_service/utils/hash/assert_valid_keys.rb +50 -0
  554. data/lib/convenient_service/utils/hash/except.rb +1 -1
  555. data/lib/convenient_service/utils/hash/triple_equality_compare.rb +51 -0
  556. data/lib/convenient_service/utils/hash.rb +10 -0
  557. data/lib/convenient_service/utils/method/defined.rb +50 -6
  558. data/lib/convenient_service/utils/module/class_method_defined.rb +22 -2
  559. data/lib/convenient_service/utils/module/get_own_instance_method.rb +3 -0
  560. data/lib/convenient_service/utils/module/instance_method_defined.rb +22 -2
  561. data/lib/convenient_service/utils/object/clamp_class.rb +77 -0
  562. data/lib/convenient_service/utils/object/duck_class.rb +112 -0
  563. data/lib/convenient_service/utils/object/memoize_including_falsy_values.rb +1 -1
  564. data/lib/convenient_service/utils/object.rb +19 -10
  565. data/lib/convenient_service/utils/string/truncate.rb +69 -0
  566. data/lib/convenient_service/utils/string.rb +5 -0
  567. data/lib/convenient_service/utils.rb +21 -0
  568. data/lib/convenient_service/version.rb +1 -1
  569. data/lib/convenient_service.rb +14 -7
  570. data/minitest.rb +30 -0
  571. metadata +575 -153
  572. data/lib/convenient_service/common/plugins/caches_constructor_params/concern.rb +0 -22
  573. data/lib/convenient_service/common/plugins/caches_constructor_params/entities/constructor_params.rb +0 -34
  574. data/lib/convenient_service/common/plugins/caches_constructor_params/entities.rb +0 -3
  575. data/lib/convenient_service/common/plugins/caches_constructor_params/middleware.rb +0 -17
  576. data/lib/convenient_service/common/plugins/caches_constructor_params.rb +0 -5
  577. data/lib/convenient_service/core/class_methods.rb +0 -96
  578. data/lib/convenient_service/core/entities/classic_middleware.rb +0 -32
  579. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/chain.rb +0 -71
  580. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware.rb +0 -131
  581. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creator.rb +0 -62
  582. data/lib/convenient_service/core/instance_methods.rb +0 -56
  583. data/lib/convenient_service/error.rb +0 -16
  584. data/lib/convenient_service/rspec/helpers/custom/ignoring_error.rb +0 -32
  585. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_method_step.rb +0 -74
  586. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_result_method_step.rb +0 -66
  587. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb +0 -48
  588. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/generate_expected_step_part.rb +0 -42
  589. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/generate_got_step_part.rb +0 -42
  590. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/match_result_step.rb +0 -89
  591. data/lib/convenient_service/rspec/matchers/custom/results/base/commands.rb +0 -10
  592. data/lib/convenient_service/service/plugins/can_have_result_step/middleware.rb +0 -43
  593. data/lib/convenient_service/service/plugins/can_have_result_step.rb +0 -3
  594. data/lib/convenient_service/service/plugins/can_have_steps/entities/service/class_methods.rb +0 -32
  595. data/lib/convenient_service/service/plugins/can_have_stubbed_result/concern.rb +0 -59
  596. data/lib/convenient_service/service/plugins/can_have_stubbed_result/middleware.rb +0 -36
  597. data/lib/convenient_service/service/plugins/can_have_stubbed_result.rb +0 -4
  598. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/aliases.rb +0 -7
  599. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/initialize/middleware.rb +0 -27
  600. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/initialize.rb +0 -3
  601. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/to_kwargs/middleware.rb +0 -25
  602. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/to_kwargs.rb +0 -3
  603. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands/cast_j_send_attributes.rb +0 -37
  604. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/concern/class_methods.rb +0 -69
  605. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb +0 -65
  606. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/instance_methods.rb +0 -94
  607. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb +0 -58
  608. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax/concern.rb +0 -62
  609. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax.rb +0 -3
  610. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/initialize/middleware.rb +0 -27
  611. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/initialize.rb +0 -3
  612. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/to_kwargs/middleware.rb +0 -25
  613. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/to_kwargs.rb +0 -3
  614. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step.rb +0 -5
  615. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/marks_result_status_as_checked/middleware.rb +0 -25
  616. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/marks_result_status_as_checked.rb +0 -3
  617. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +0 -33
  618. data/lib/convenient_service/service/plugins/has_result/errors.rb +0 -34
  619. data/lib/convenient_service/service/plugins/has_result/middleware.rb +0 -19
  620. data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/commands/refute_kwargs_contain_data_and_extra_keys.rb +0 -29
  621. data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/errors.rb +0 -28
  622. data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/middleware.rb +0 -19
  623. data/lib/convenient_service/service/plugins/has_result_short_syntax/success/commands.rb +0 -3
  624. data/lib/convenient_service/service/plugins/has_result_short_syntax.rb +0 -6
  625. data/lib/convenient_service/service/plugins/has_result_status_check_short_syntax.rb +0 -3
  626. data/lib/convenient_service/services/run_method_in_organizer.rb +0 -28
  627. data/lib/convenient_service/services/run_own_method_in_organizer.rb +0 -64
  628. data/lib/convenient_service/support/cache/key.rb +0 -100
  629. data/lib/convenient_service/utils/object/resolve_class.rb +0 -56
  630. /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_recalculate_result.rb +0 -0
  631. /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_inspect.rb +0 -0
  632. /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/commands.rb +0 -0
  633. /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities.rb +0 -0
  634. /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/structs.rb +0 -0
  635. /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities.rb +0 -0
  636. /data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_active_model_validations.rb +0 -0
  637. /data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_dry_validation.rb +0 -0
  638. /data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error/commands.rb +0 -0
  639. /data/lib/convenient_service/service/plugins/{has_result_short_syntax/failure → has_j_send_result_short_syntax/success}/commands.rb +0 -0
@@ -4,7 +4,13 @@ module ConvenientService
4
4
  module Common
5
5
  module Plugins
6
6
  module HasCallbacks
7
- class Middleware < Core::MethodChainMiddleware
7
+ class Middleware < MethodChainMiddleware
8
+ intended_for any_method, scope: any_scope, entity: any_entity
9
+
10
+ ##
11
+ # @internal
12
+ # TODO: Move to command.
13
+ #
8
14
  def next(*args, **kwargs, &block)
9
15
  ##
10
16
  # class Service
@@ -17,11 +17,10 @@ module ConvenientService
17
17
 
18
18
  class_methods do
19
19
  ##
20
- # @return [Object]
21
- # @since 0.2.0
20
+ # @return [Object] Can be any type.
22
21
  #
23
- def create(...)
24
- new(...)
22
+ def new(...)
23
+ new_without_commit_config(...)
25
24
  end
26
25
  end
27
26
  end
@@ -10,7 +10,6 @@ module ConvenientService
10
10
  class_methods do
11
11
  ##
12
12
  # @return [Object]
13
- # @since 0.2.0
14
13
  #
15
14
  # @internal
16
15
  # NOTE: `allocate` creates an uninitialized object and allocates memory for it.
@@ -24,18 +23,11 @@ module ConvenientService
24
23
  # instance
25
24
  # end
26
25
  #
27
- # NOTE: Code for `new_without_initialize`.
28
- # def new_without_initialize
29
- # allocate
30
- # end
31
- #
32
- # NOTE: `create` is used instead of `new` in order to avoid the accidental feeling that `new_without_initialize` is Ruby's built-in method.
33
- #
34
26
  # NOTE: Check the following links for more info.
35
27
  # - https://ruby-doc.org/core-2.5.0/Class.html#method-i-allocate
36
28
  # - https://frontdeveloper.pl/2018/11/ruby-allocate-method/
37
29
  #
38
- def create_without_initialize
30
+ def new_without_initialize
39
31
  allocate
40
32
  end
41
33
  end
@@ -20,7 +20,7 @@ module ConvenientService
20
20
  # @return [ConvenientService::Support::Cache]
21
21
  #
22
22
  def cache
23
- @cache ||= Support::Cache.new
23
+ @cache ||= Support::Cache.create(backend: :hash)
24
24
  end
25
25
  end
26
26
  end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Common
5
+ module Plugins
6
+ module HasJSendResultDuckShortSyntax
7
+ module Concern
8
+ include Support::Concern
9
+
10
+ instance_methods do
11
+ ##
12
+ # @param key [String, Symbol]
13
+ # @return [Object] Can be any type.
14
+ #
15
+ # @internal
16
+ # NOTE: Delegates to `data` instead of aliasing in order to have an ability
17
+ # to use the same RSpec stubs for short and usual syntax.
18
+ #
19
+ # For example:
20
+ #
21
+ # allow(result).to receive(:data).with(:foo).and_call_original
22
+ #
23
+ # works for both `result.data[:foo]` and `result[:foo]`.
24
+ #
25
+ def [](key)
26
+ data[key]
27
+ end
28
+
29
+ ##
30
+ # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Data]
31
+ #
32
+ def ud
33
+ unsafe_data
34
+ end
35
+
36
+ ##
37
+ # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Message]
38
+ #
39
+ def um
40
+ unsafe_message
41
+ end
42
+
43
+ ##
44
+ # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Code]
45
+ #
46
+ def uc
47
+ unsafe_code
48
+ end
49
+
50
+ ##
51
+ # @return [Boolean]
52
+ #
53
+ def ok?
54
+ success?
55
+ end
56
+
57
+ ##
58
+ # @return [Boolean]
59
+ #
60
+ def not_ok?
61
+ not_success?
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "has_j_send_result_duck_short_syntax/concern"
@@ -15,7 +15,9 @@ module ConvenientService
15
15
  # Check the following link for more details:
16
16
  # - https://bugs.ruby-lang.org/issues/8507
17
17
  #
18
- class Middleware < Core::ClassicMiddleware
18
+ class Middleware < MethodClassicMiddleware
19
+ intended_for any_method, scope: any_scope, entity: any_entity
20
+
19
21
  def call(env = nil)
20
22
  env = env.to_h
21
23
  env = env.merge(args: env[:args].to_a, kwargs: env[:kwargs].to_h, block: env[:block])
@@ -5,7 +5,7 @@
5
5
  #
6
6
  require_relative "plugins/normalizes_env"
7
7
 
8
- require_relative "plugins/caches_constructor_params"
8
+ require_relative "plugins/caches_constructor_arguments"
9
9
  require_relative "plugins/caches_return_value"
10
10
  require_relative "plugins/can_be_copied"
11
11
  require_relative "plugins/can_have_user_provided_entity"
@@ -14,5 +14,6 @@ require_relative "plugins/has_around_callbacks"
14
14
  require_relative "plugins/has_constructor"
15
15
  require_relative "plugins/has_constructor_without_initialize"
16
16
  require_relative "plugins/has_internals"
17
+ require_relative "plugins/has_j_send_result_duck_short_syntax"
17
18
 
18
19
  require_relative "plugins/aliases"
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module AwesomePrintInspect
5
+ Config = ::ConvenientService::Configs::AwesomePrintInspect
6
+ end
7
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Configs
5
+ module AwesomePrintInspect
6
+ include Support::Concern
7
+
8
+ # rubocop:disable Lint/ConstantDefinitionInBlock
9
+ included do
10
+ include Configs::Minimal
11
+
12
+ ##
13
+ # @internal
14
+ # TODO: Plugin groups for autoreplacement of plugins with same purpose.
15
+ #
16
+ concerns do
17
+ use Plugins::Service::HasAwesomePrintInspect::Concern
18
+ end
19
+
20
+ class self::Result
21
+ concerns do
22
+ use Plugins::Result::HasAwesomePrintInspect::Concern
23
+ end
24
+
25
+ class self::Data
26
+ concerns do
27
+ use Plugins::Data::HasAwesomePrintInspect::Concern
28
+ end
29
+ end
30
+
31
+ class self::Message
32
+ concerns do
33
+ use Plugins::Message::HasAwesomePrintInspect::Concern
34
+ end
35
+ end
36
+
37
+ class self::Code
38
+ concerns do
39
+ use Plugins::Code::HasAwesomePrintInspect::Concern
40
+ end
41
+ end
42
+
43
+ class self::Status
44
+ concerns do
45
+ use Plugins::Status::HasAwesomePrintInspect::Concern
46
+ end
47
+ end
48
+ end
49
+
50
+ class self::Step
51
+ concerns do
52
+ use Plugins::Step::HasAwesomePrintInspect::Concern
53
+ end
54
+ end
55
+ end
56
+ # rubocop:enable Lint/ConstantDefinitionInBlock
57
+ end
58
+ end
59
+ end
@@ -5,10 +5,30 @@ module ConvenientService
5
5
  ##
6
6
  # Defines minimal configuration that adds a constructor, JSend-inspired result, steps, basic inspects, and internals to services.
7
7
  #
8
- # @note: This config is NOT intented for the end-user usage. Use `Standard` instead.
8
+ # @note This config is NOT intented for the end-user usage. Use `Standard` instead.
9
+ #
10
+ # @note
11
+ # `use Plugins::Common::NormalizesEnv::Middleware` should be used in a config that has the first `concern` that introduces a method.
12
+ # For example, `:result` is added by `use Plugins::Service::HasJSendResult::Concern` in `Minimal`.
13
+ # That is why the following code is written in the `Minimal` config.
14
+ #
15
+ # middlewares :result do
16
+ # use Plugins::Common::NormalizesEnv::Middleware
17
+ #
18
+ # # ...
19
+ # end
20
+ #
21
+ # In turn, `:fallback_result` is added by `use Plugins::Service::CanHaveFallback::Concern` in `Standard`.
22
+ # That is why it is the responsibility of the `Standard` config, to define:
23
+ #
24
+ # middlewares :fallback_result do
25
+ # use Plugins::Common::NormalizesEnv::Middleware
26
+ #
27
+ # # ...
28
+ # end
9
29
  #
10
30
  # @internal
11
- # Heavily used in specs to test concerns and middlewares in isolation.
31
+ # NOTE: Heavily used in specs to test concerns and middlewares in isolation.
12
32
  #
13
33
  module Minimal
14
34
  include Support::Concern
@@ -34,6 +54,7 @@ module ConvenientService
34
54
  use Plugins::Common::HasConstructorWithoutInitialize::Concern
35
55
 
36
56
  use Plugins::Service::HasResult::Concern
57
+ use Plugins::Service::HasJSendResult::Concern
37
58
  use Plugins::Service::CanHaveSteps::Concern
38
59
  end
39
60
 
@@ -43,8 +64,10 @@ module ConvenientService
43
64
 
44
65
  middlewares :result do
45
66
  use Plugins::Common::NormalizesEnv::Middleware
67
+ use Plugins::Common::CachesReturnValue::Middleware
68
+
69
+ use Plugins::Service::RaisesOnNotResultReturnValue::Middleware
46
70
 
47
- use Plugins::Service::HasResult::Middleware
48
71
  use Plugins::Service::CanHaveSteps::Middleware
49
72
  end
50
73
 
@@ -72,7 +95,6 @@ module ConvenientService
72
95
  use Plugins::Common::NormalizesEnv::Middleware
73
96
 
74
97
  use Plugins::Service::CanHaveMethodSteps::Middleware
75
- use Plugins::Service::CanHaveResultStep::Middleware
76
98
  end
77
99
 
78
100
  class self::Internals
@@ -92,6 +114,7 @@ module ConvenientService
92
114
  use Plugins::Result::HasInspect::Concern
93
115
 
94
116
  use Plugins::Common::HasConstructor::Concern
117
+ use Plugins::Common::HasConstructorWithoutInitialize::Concern
95
118
 
96
119
  use Plugins::Result::HasJSendStatusAndAttributes::Concern
97
120
  end
@@ -144,18 +167,34 @@ module ConvenientService
144
167
 
145
168
  class self::Data
146
169
  include Core
170
+
171
+ concerns do
172
+ use Plugins::Data::HasInspect::Concern
173
+ end
147
174
  end
148
175
 
149
176
  class self::Message
150
177
  include Core
178
+
179
+ concerns do
180
+ use Plugins::Message::HasInspect::Concern
181
+ end
151
182
  end
152
183
 
153
184
  class self::Code
154
185
  include Core
186
+
187
+ concerns do
188
+ use Plugins::Code::HasInspect::Concern
189
+ end
155
190
  end
156
191
 
157
192
  class self::Status
158
193
  include Core
194
+
195
+ concerns do
196
+ use Plugins::Status::HasInspect::Concern
197
+ end
159
198
  end
160
199
 
161
200
  class self::Internals
@@ -173,11 +212,34 @@ module ConvenientService
173
212
  concerns do
174
213
  use Plugins::Common::HasInternals::Concern
175
214
 
215
+ use Plugins::Step::CanBeCompleted::Concern
216
+
217
+ use Plugins::Step::CanBeMethodStep::Concern
218
+ use Plugins::Step::CanBeResultStep::Concern
219
+
176
220
  use Plugins::Step::HasInspect::Concern
177
221
  end
178
222
 
179
- middlewares :calculate_result do
223
+ middlewares :service_result do
224
+ use Plugins::Common::NormalizesEnv::Middleware
225
+ use Plugins::Common::CachesReturnValue::Middleware
226
+
227
+ use Plugins::Step::CanBeResultStep::CanBeExecuted::Middleware
228
+ use Plugins::Step::CanBeMethodStep::CanBeExecuted::Middleware
229
+ end
230
+
231
+ middlewares :result do
180
232
  use Plugins::Common::NormalizesEnv::Middleware
233
+ use Plugins::Common::CachesReturnValue::Middleware
234
+ end
235
+
236
+ ##
237
+ # TODO: Rename.
238
+ #
239
+ middlewares :printable_service do
240
+ use Plugins::Common::NormalizesEnv::Middleware
241
+
242
+ use Plugins::Step::CanBeMethodStep::CanBePrinted::Middleware
181
243
  end
182
244
 
183
245
  class self::Internals
@@ -21,32 +21,58 @@ module ConvenientService
21
21
  include Configs::Minimal
22
22
 
23
23
  concerns do
24
- use Plugins::Common::CachesConstructorParams::Concern
24
+ use Plugins::Common::CachesConstructorArguments::Concern
25
25
  use Plugins::Common::CanBeCopied::Concern
26
26
  use Plugins::Service::CanRecalculateResult::Concern
27
- use Plugins::Service::HasResultShortSyntax::Concern
28
- use Plugins::Service::HasResultStatusCheckShortSyntax::Concern
27
+ use Plugins::Service::HasJSendResultShortSyntax::Concern
28
+ use Plugins::Service::HasJSendResultStatusCheckShortSyntax::Concern
29
29
 
30
30
  use Plugins::Common::HasCallbacks::Concern
31
31
  use Plugins::Common::HasAroundCallbacks::Concern
32
+
33
+ use Plugins::Service::CanHaveFallback::Concern
34
+ use Plugins::Service::HasMermaidFlowchart::Concern
32
35
  end
33
36
 
34
37
  middlewares :initialize do
35
- use Plugins::Common::CachesConstructorParams::Middleware
38
+ use Plugins::Service::CollectsServicesInException::Middleware
39
+ use Plugins::Common::CachesConstructorArguments::Middleware
36
40
  end
37
41
 
38
42
  middlewares :result do
43
+ insert_after \
44
+ Plugins::Common::NormalizesEnv::Middleware,
45
+ Plugins::Service::CollectsServicesInException::Middleware
46
+
39
47
  insert_before \
40
- Plugins::Service::HasResult::Middleware,
48
+ Plugins::Service::RaisesOnNotResultReturnValue::Middleware,
41
49
  Plugins::Common::HasCallbacks::Middleware
42
50
 
43
51
  insert_after \
44
52
  Plugins::Common::HasCallbacks::Middleware,
45
53
  Plugins::Common::HasAroundCallbacks::Middleware
46
54
 
47
- use Plugins::Service::RaisesOnDoubleResult::Middleware
55
+ ##
56
+ # TODO: Rewrite. This plugin does NOT do what it states. Probably I was NOT with a clear mind while writing it (facepalm).
57
+ #
58
+ # use Plugins::Service::RaisesOnDoubleResult::Middleware
48
59
 
60
+ insert_before \
61
+ Plugins::Service::RaisesOnNotResultReturnValue::Middleware,
62
+ Plugins::Service::SetsParentToForeignResult::Middleware
63
+ end
64
+
65
+ ##
66
+ # @internal
67
+ # NOTE: Check `Minimal` docs to understand why `use Plugins::Common::NormalizesEnv::Middleware` for `:fallback_result` is used in `Standard`, not in `Minimal` config.
68
+ #
69
+ middlewares :fallback_result do
70
+ use Plugins::Common::NormalizesEnv::Middleware
71
+ use Plugins::Service::CollectsServicesInException::Middleware
49
72
  use Plugins::Common::CachesReturnValue::Middleware
73
+
74
+ use Plugins::Service::RaisesOnNotResultReturnValue::Middleware
75
+ use Plugins::Service::CanHaveFallback::Middleware
50
76
  end
51
77
 
52
78
  middlewares :step do
@@ -55,53 +81,51 @@ module ConvenientService
55
81
  end
56
82
 
57
83
  middlewares :success do
58
- use Plugins::Service::HasResultShortSyntax::Success::Middleware
84
+ use Plugins::Service::HasJSendResultShortSyntax::Success::Middleware
59
85
  end
60
86
 
61
87
  middlewares :failure do
62
- use Plugins::Service::HasResultShortSyntax::Failure::Middleware
88
+ use Plugins::Service::HasJSendResultShortSyntax::Failure::Middleware
63
89
  end
64
90
 
65
91
  middlewares :error do
66
- use Plugins::Service::HasResultShortSyntax::Error::Middleware
92
+ use Plugins::Service::HasJSendResultShortSyntax::Error::Middleware
67
93
  end
68
94
 
69
95
  class self::Result
70
96
  concerns do
71
- use Plugins::Result::HasResultShortSyntax::Concern
97
+ use Plugins::Common::HasJSendResultDuckShortSyntax::Concern
72
98
  use Plugins::Result::CanRecalculateResult::Concern
73
99
 
74
- use Plugins::Result::HasStep::Concern
100
+ use Plugins::Result::CanHaveStep::Concern
101
+ use Plugins::Result::CanBeOwnResult::Concern
102
+ use Plugins::Result::CanHaveFallback::Concern
75
103
  use Plugins::Result::CanHaveParentResult::Concern
76
- end
77
-
78
- middlewares :initialize do
79
- use Plugins::Result::HasStep::Initialize::Middleware
80
- use Plugins::Result::CanHaveParentResult::Initialize::Middleware
104
+ use Plugins::Result::CanHaveCheckedStatus::Concern
81
105
  end
82
106
 
83
107
  middlewares :success? do
84
- use Plugins::Result::MarksResultStatusAsChecked::Middleware
108
+ use Plugins::Result::CanHaveCheckedStatus::Middleware
85
109
  end
86
110
 
87
111
  middlewares :failure? do
88
- use Plugins::Result::MarksResultStatusAsChecked::Middleware
112
+ use Plugins::Result::CanHaveCheckedStatus::Middleware
89
113
  end
90
114
 
91
115
  middlewares :error? do
92
- use Plugins::Result::MarksResultStatusAsChecked::Middleware
116
+ use Plugins::Result::CanHaveCheckedStatus::Middleware
93
117
  end
94
118
 
95
119
  middlewares :not_success? do
96
- use Plugins::Result::MarksResultStatusAsChecked::Middleware
120
+ use Plugins::Result::CanHaveCheckedStatus::Middleware
97
121
  end
98
122
 
99
123
  middlewares :not_failure? do
100
- use Plugins::Result::MarksResultStatusAsChecked::Middleware
124
+ use Plugins::Result::CanHaveCheckedStatus::Middleware
101
125
  end
102
126
 
103
127
  middlewares :not_error? do
104
- use Plugins::Result::MarksResultStatusAsChecked::Middleware
128
+ use Plugins::Result::CanHaveCheckedStatus::Middleware
105
129
  end
106
130
 
107
131
  middlewares :data do
@@ -115,28 +139,66 @@ module ConvenientService
115
139
  middlewares :code do
116
140
  use Plugins::Result::RaisesOnNotCheckedResultStatus::Middleware
117
141
  end
118
-
119
- middlewares :to_kwargs do
120
- use Plugins::Result::HasStep::ToKwargs::Middleware
121
- use Plugins::Result::CanHaveParentResult::ToKwargs::Middleware
122
- end
123
142
  end
124
143
 
125
144
  class self::Step
126
- middlewares :calculate_result do
145
+ concerns do
146
+ use Plugins::Common::HasJSendResultDuckShortSyntax::Concern
147
+ use Plugins::Step::CanHaveFallback::Concern
148
+ end
149
+
150
+ middlewares :result do
151
+ use Plugins::Step::CanHaveFallback::Middleware
127
152
  use Plugins::Step::CanHaveParentResult::Middleware
128
153
  end
154
+
155
+ middlewares :service_fallback_result do
156
+ use Plugins::Common::NormalizesEnv::Middleware
157
+ use Plugins::Common::CachesReturnValue::Middleware
158
+ end
159
+
160
+ middlewares :fallback_result do
161
+ use Plugins::Common::NormalizesEnv::Middleware
162
+ use Plugins::Common::CachesReturnValue::Middleware
163
+ end
129
164
  end
130
165
 
131
166
  if Dependencies.rspec.loaded?
132
167
  concerns do
133
- insert_before 0, Plugins::Service::CanHaveStubbedResult::Concern
168
+ insert_before 0, Plugins::Service::CanHaveStubbedResults::Concern
169
+ end
170
+
171
+ middlewares :result do
172
+ insert_after \
173
+ Plugins::Common::NormalizesEnv::Middleware,
174
+ Plugins::Service::CanHaveStubbedResults::Middleware
175
+
176
+ insert_before \
177
+ Plugins::Service::CanHaveStubbedResults::Middleware,
178
+ Plugins::Service::CountsStubbedResultsInvocations::Middleware
134
179
  end
135
180
 
136
181
  middlewares :result, scope: :class do
137
182
  insert_after \
138
183
  Plugins::Common::NormalizesEnv::Middleware,
139
- Plugins::Service::CanHaveStubbedResult::Middleware
184
+ Plugins::Service::CanHaveStubbedResults::Middleware
185
+
186
+ insert_before \
187
+ Plugins::Service::CanHaveStubbedResults::Middleware,
188
+ Plugins::Service::CountsStubbedResultsInvocations::Middleware
189
+ end
190
+
191
+ class self::Result
192
+ concerns do
193
+ use Plugins::Result::CanBeStubbedResult::Concern
194
+ use Plugins::Result::HasStubbedResultInvocationsCounter::Concern
195
+ end
196
+
197
+ middlewares :initialize do
198
+ insert_before \
199
+ Plugins::Result::HasJSendStatusAndAttributes::Middleware,
200
+ Plugins::Result::HasStubbedResultInvocationsCounter::Middleware
201
+ end
140
202
  end
141
203
  end
142
204
  end
@@ -1,9 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConvenientService
4
- module Core
5
- ClassicMiddleware = ::ConvenientService::Core::Entities::ClassicMiddleware
6
- ConcernMiddleware = ::ConvenientService::Core::Entities::Config::Entities::Concerns::Entities::Middleware
7
- MethodChainMiddleware = ::ConvenientService::Core::Entities::Config::Entities::MethodMiddlewares::Entities::Middleware
8
- end
4
+ ConcernMiddleware = ::ConvenientService::Core::Entities::Config::Entities::Concerns::Entities::Middleware
5
+
6
+ MethodClassicMiddleware = ::ConvenientService::Core::Entities::Config::Entities::MethodMiddlewares::Entities::Middlewares::Classic
7
+ MethodChainMiddleware = ::ConvenientService::Core::Entities::Config::Entities::MethodMiddlewares::Entities::Middlewares::Chain
9
8
  end