convenient_service 0.12.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (759) 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 +183 -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/aliases.rb +9 -0
  53. data/lib/convenient_service/configs/standard/v1.rb +183 -0
  54. data/lib/convenient_service/configs/standard.rb +118 -30
  55. data/lib/convenient_service/core/aliases.rb +4 -5
  56. data/lib/convenient_service/core/concern/class_methods.rb +129 -0
  57. data/lib/convenient_service/core/concern/instance_methods.rb +76 -0
  58. data/lib/convenient_service/core/concern.rb +25 -0
  59. data/lib/convenient_service/core/entities/config/commands/track_method_missing_commit_trigger.rb +2 -2
  60. data/lib/convenient_service/core/entities/config/entities/concerns/entities/middleware/commands/cast_middleware.rb +2 -2
  61. data/lib/convenient_service/core/entities/config/entities/concerns/entities/middleware.rb +1 -0
  62. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/commands/cast_caller.rb +2 -2
  63. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/concern/instance_methods.rb +9 -2
  64. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/constants.rb +26 -0
  65. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller.rb +1 -3
  66. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/concern/instance_methods.rb +10 -3
  67. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/base.rb +95 -0
  68. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable/entities/event.rb +95 -0
  69. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable/entities.rb +3 -0
  70. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable.rb +42 -0
  71. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/with.rb +50 -0
  72. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators.rb +6 -0
  73. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/commands/create_observable_middleware.rb +104 -0
  74. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/commands.rb +3 -0
  75. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/concern/class_methods.rb +115 -0
  76. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/concern/instance_methods.rb +70 -0
  77. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/concern.rb +32 -0
  78. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/constants.rb +36 -0
  79. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/structs/intended_method.rb +23 -0
  80. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/structs.rb +3 -0
  81. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base.rb +26 -0
  82. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands/create_observable_middleware.rb +90 -0
  83. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands.rb +3 -0
  84. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/class_methods.rb +37 -0
  85. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/instance_methods.rb +115 -0
  86. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern.rb +32 -0
  87. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/entities/method_chain.rb +86 -0
  88. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/entities.rb +3 -0
  89. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain.rb +34 -0
  90. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/classic.rb +42 -0
  91. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares.rb +6 -0
  92. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/stack.rb +46 -11
  93. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities.rb +2 -3
  94. data/lib/convenient_service/core/entities/config/entities/method_middlewares.rb +1 -1
  95. data/lib/convenient_service/core/entities/config/{errors.rb → exceptions.rb} +3 -3
  96. data/lib/convenient_service/core/entities/config.rb +19 -6
  97. data/lib/convenient_service/core/entities.rb +0 -1
  98. data/lib/convenient_service/core.rb +7 -5
  99. data/lib/convenient_service/dependencies/built_in.rb +11 -4
  100. data/lib/convenient_service/dependencies/extractions/active_support_backtrace_cleaner/backtrace_cleaner.rb +149 -0
  101. data/lib/convenient_service/dependencies/extractions/active_support_backtrace_cleaner.rb +15 -0
  102. data/lib/convenient_service/dependencies/extractions/active_support_concern/concern.rb +4 -3
  103. data/lib/convenient_service/dependencies/extractions/active_support_concern.rb +4 -3
  104. data/lib/convenient_service/dependencies.rb +266 -25
  105. data/lib/convenient_service/examples/dry/gemfile/dry_service/config.rb +19 -21
  106. data/lib/convenient_service/examples/dry/gemfile/services/assert_file_exists.rb +2 -2
  107. data/lib/convenient_service/examples/dry/gemfile/services/assert_file_not_empty.rb +2 -2
  108. data/lib/convenient_service/examples/dry/gemfile/services/assert_node_available.rb +2 -2
  109. data/lib/convenient_service/examples/dry/gemfile/services/assert_npm_package_available.rb +2 -2
  110. data/lib/convenient_service/examples/dry/gemfile/services/assert_valid_ruby_syntax.rb +2 -2
  111. data/lib/convenient_service/examples/dry/gemfile/services/format.rb +1 -1
  112. data/lib/convenient_service/examples/dry/gemfile/services/format_body.rb +1 -1
  113. data/lib/convenient_service/examples/dry/gemfile/services/format_gems_with_envs.rb +1 -1
  114. data/lib/convenient_service/examples/dry/gemfile/services/format_gems_without_envs.rb +1 -1
  115. data/lib/convenient_service/examples/dry/gemfile/services/format_header.rb +1 -1
  116. data/lib/convenient_service/examples/dry/gemfile/services/parse_content.rb +2 -2
  117. data/lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb +12 -5
  118. data/lib/convenient_service/examples/dry/gemfile/services/read_file_content.rb +2 -2
  119. data/lib/convenient_service/examples/dry/gemfile/services/{run_shell.rb → run_shell_command.rb} +11 -6
  120. data/lib/convenient_service/examples/dry/gemfile/services/strip_comments.rb +3 -3
  121. data/lib/convenient_service/examples/dry/gemfile/services.rb +3 -2
  122. data/lib/convenient_service/examples/dry/gemfile.rb +1 -1
  123. data/lib/convenient_service/examples/dry/v1/gemfile/dry_service/config.rb +47 -0
  124. data/lib/convenient_service/examples/dry/v1/gemfile/dry_service.rb +3 -0
  125. data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_exists.rb +31 -0
  126. data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_not_empty.rb +31 -0
  127. data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_node_available.rb +28 -0
  128. data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_npm_package_available.rb +41 -0
  129. data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_valid_ruby_syntax.rb +43 -0
  130. data/lib/convenient_service/examples/dry/v1/gemfile/services/format.rb +39 -0
  131. data/lib/convenient_service/examples/dry/v1/gemfile/services/format_body.rb +95 -0
  132. data/lib/convenient_service/examples/dry/v1/gemfile/services/format_gems_with_envs.rb +98 -0
  133. data/lib/convenient_service/examples/dry/v1/gemfile/services/format_gems_without_envs.rb +86 -0
  134. data/lib/convenient_service/examples/dry/v1/gemfile/services/format_header.rb +76 -0
  135. data/lib/convenient_service/examples/dry/v1/gemfile/services/parse_content.rb +95 -0
  136. data/lib/convenient_service/examples/dry/v1/gemfile/services/read_file_content.rb +33 -0
  137. data/lib/convenient_service/examples/dry/v1/gemfile/services/run_shell_command.rb +43 -0
  138. data/lib/convenient_service/examples/dry/v1/gemfile/services/strip_comments.rb +111 -0
  139. data/lib/convenient_service/examples/dry/v1/gemfile/services.rb +17 -0
  140. data/lib/convenient_service/examples/dry/v1/gemfile.rb +27 -0
  141. data/lib/convenient_service/examples/rails/gemfile/rails_service/config.rb +28 -30
  142. data/lib/convenient_service/examples/rails/gemfile/services/assert_file_exists.rb +3 -3
  143. data/lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb +3 -3
  144. data/lib/convenient_service/examples/rails/gemfile/services/assert_node_available.rb +2 -2
  145. data/lib/convenient_service/examples/rails/gemfile/services/assert_npm_package_available.rb +3 -3
  146. data/lib/convenient_service/examples/rails/gemfile/services/assert_valid_ruby_syntax.rb +2 -2
  147. data/lib/convenient_service/examples/rails/gemfile/services/format.rb +2 -2
  148. data/lib/convenient_service/examples/rails/gemfile/services/format_body.rb +1 -1
  149. data/lib/convenient_service/examples/rails/gemfile/services/format_gems_with_envs.rb +1 -1
  150. data/lib/convenient_service/examples/rails/gemfile/services/format_gems_without_envs.rb +1 -1
  151. data/lib/convenient_service/examples/rails/gemfile/services/format_header.rb +1 -1
  152. data/lib/convenient_service/examples/rails/gemfile/services/merge_sections.rb +3 -3
  153. data/lib/convenient_service/examples/rails/gemfile/services/parse_content.rb +3 -3
  154. data/lib/convenient_service/examples/rails/gemfile/services/print_shell_command.rb +12 -5
  155. data/lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb +3 -3
  156. data/lib/convenient_service/examples/rails/gemfile/services/replace_file_content.rb +3 -3
  157. data/lib/convenient_service/examples/rails/gemfile/services/{run_shell.rb → run_shell_command.rb} +12 -7
  158. data/lib/convenient_service/examples/rails/gemfile/services/strip_comments.rb +4 -4
  159. data/lib/convenient_service/examples/rails/gemfile/services.rb +2 -2
  160. data/lib/convenient_service/examples/rails/gemfile.rb +1 -1
  161. data/lib/convenient_service/examples/rails/v1/gemfile/rails_service/config.rb +58 -0
  162. data/lib/convenient_service/examples/rails/v1/gemfile/rails_service.rb +3 -0
  163. data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_file_exists.rb +27 -0
  164. data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_file_not_empty.rb +27 -0
  165. data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_node_available.rb +28 -0
  166. data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_npm_package_available.rb +37 -0
  167. data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_valid_ruby_syntax.rb +37 -0
  168. data/lib/convenient_service/examples/rails/v1/gemfile/services/format.rb +68 -0
  169. data/lib/convenient_service/examples/rails/v1/gemfile/services/format_body.rb +81 -0
  170. data/lib/convenient_service/examples/rails/v1/gemfile/services/format_gems_with_envs.rb +84 -0
  171. data/lib/convenient_service/examples/rails/v1/gemfile/services/format_gems_without_envs.rb +72 -0
  172. data/lib/convenient_service/examples/rails/v1/gemfile/services/format_header.rb +70 -0
  173. data/lib/convenient_service/examples/rails/v1/gemfile/services/merge_sections.rb +27 -0
  174. data/lib/convenient_service/examples/rails/v1/gemfile/services/parse_content.rb +91 -0
  175. data/lib/convenient_service/examples/rails/v1/gemfile/services/read_file_content.rb +29 -0
  176. data/lib/convenient_service/examples/rails/v1/gemfile/services/replace_file_content.rb +39 -0
  177. data/lib/convenient_service/examples/rails/v1/gemfile/services/run_shell_command.rb +38 -0
  178. data/lib/convenient_service/examples/rails/v1/gemfile/services/strip_comments.rb +109 -0
  179. data/lib/convenient_service/examples/rails/v1/gemfile/services.rb +20 -0
  180. data/lib/convenient_service/examples/rails/v1/gemfile.rb +27 -0
  181. data/lib/convenient_service/examples/standard/cowsay/services/build_cloud.rb +1 -1
  182. data/lib/convenient_service/examples/standard/cowsay/services/build_cow.rb +1 -1
  183. data/lib/convenient_service/examples/standard/cowsay/services/print.rb +1 -1
  184. data/lib/convenient_service/examples/standard/cowsay.rb +1 -1
  185. data/lib/convenient_service/examples/standard/date_time/services/safe_parse.rb +31 -0
  186. data/lib/convenient_service/examples/standard/date_time/services.rb +3 -0
  187. data/lib/convenient_service/examples/standard/date_time.rb +23 -0
  188. data/lib/convenient_service/examples/standard/factorial/services/calculate.rb +55 -0
  189. data/lib/convenient_service/examples/standard/factorial/services.rb +3 -0
  190. data/lib/convenient_service/examples/standard/factorial/utils/timeout/with_timeout.rb +50 -0
  191. data/lib/convenient_service/examples/standard/factorial/utils/timeout.rb +21 -0
  192. data/lib/convenient_service/examples/standard/factorial/utils.rb +3 -0
  193. data/lib/convenient_service/examples/standard/factorial.rb +24 -0
  194. data/lib/convenient_service/examples/standard/gemfile/services/assert_file_exists.rb +4 -4
  195. data/lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb +4 -4
  196. data/lib/convenient_service/examples/standard/gemfile/services/assert_node_available.rb +2 -2
  197. data/lib/convenient_service/examples/standard/gemfile/services/assert_npm_package_available.rb +4 -4
  198. data/lib/convenient_service/examples/standard/gemfile/services/assert_valid_ruby_syntax.rb +2 -2
  199. data/lib/convenient_service/examples/standard/gemfile/services/format.rb +5 -5
  200. data/lib/convenient_service/examples/standard/gemfile/services/format_body.rb +1 -1
  201. data/lib/convenient_service/examples/standard/gemfile/services/format_gems_with_envs.rb +1 -1
  202. data/lib/convenient_service/examples/standard/gemfile/services/format_gems_without_envs.rb +1 -1
  203. data/lib/convenient_service/examples/standard/gemfile/services/format_header.rb +1 -1
  204. data/lib/convenient_service/examples/standard/gemfile/services/merge_sections.rb +5 -5
  205. data/lib/convenient_service/examples/standard/gemfile/services/parse_content.rb +4 -4
  206. data/lib/convenient_service/examples/standard/gemfile/services/print_shell_command.rb +15 -8
  207. data/lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb +5 -5
  208. data/lib/convenient_service/examples/standard/gemfile/services/replace_file_content.rb +4 -4
  209. data/lib/convenient_service/examples/standard/gemfile/services/{run_shell.rb → run_shell_command.rb} +23 -6
  210. data/lib/convenient_service/examples/standard/gemfile/services/strip_comments.rb +3 -3
  211. data/lib/convenient_service/examples/standard/gemfile/services.rb +2 -2
  212. data/lib/convenient_service/examples/standard/gemfile.rb +1 -1
  213. data/lib/convenient_service/examples/standard/request_params/constants.rb +1 -1
  214. data/lib/convenient_service/examples/standard/request_params/entities/description.rb +1 -1
  215. data/lib/convenient_service/examples/standard/request_params/entities/format.rb +1 -1
  216. data/lib/convenient_service/examples/standard/request_params/entities/id.rb +1 -1
  217. data/lib/convenient_service/examples/standard/request_params/entities/logger.rb +1 -1
  218. data/lib/convenient_service/examples/standard/request_params/entities/request.rb +1 -1
  219. data/lib/convenient_service/examples/standard/request_params/entities/source.rb +1 -1
  220. data/lib/convenient_service/examples/standard/request_params/entities/tag.rb +1 -1
  221. data/lib/convenient_service/examples/standard/request_params/entities/title.rb +1 -1
  222. data/lib/convenient_service/examples/standard/request_params/services/apply_default_param_values.rb +1 -1
  223. data/lib/convenient_service/examples/standard/request_params/services/cast_params.rb +1 -1
  224. data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_body.rb +1 -1
  225. data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_path.rb +1 -1
  226. data/lib/convenient_service/examples/standard/request_params/services/filter_out_unpermitted_params.rb +1 -1
  227. data/lib/convenient_service/examples/standard/request_params/services/log_request_params.rb +1 -1
  228. data/lib/convenient_service/examples/standard/request_params/services/merge_params.rb +1 -1
  229. data/lib/convenient_service/examples/standard/request_params/services/prepare.rb +1 -1
  230. data/lib/convenient_service/examples/standard/request_params/services/validate_casted_params.rb +1 -1
  231. data/lib/convenient_service/examples/standard/request_params/services/validate_uncasted_params.rb +1 -1
  232. data/lib/convenient_service/examples/standard/request_params/utils/array/wrap.rb +2 -2
  233. data/lib/convenient_service/examples/standard/request_params/utils/array.rb +1 -1
  234. data/lib/convenient_service/examples/standard/request_params/utils/http/request/parse_body.rb +2 -2
  235. data/lib/convenient_service/examples/standard/request_params/utils/http/request/parse_path.rb +2 -2
  236. data/lib/convenient_service/examples/standard/request_params/utils/http/request.rb +1 -1
  237. data/lib/convenient_service/examples/standard/request_params/utils/integer/safe_parse.rb +2 -2
  238. data/lib/convenient_service/examples/standard/request_params/utils/integer.rb +1 -1
  239. data/lib/convenient_service/examples/standard/request_params/utils/json/safe_parse.rb +2 -2
  240. data/lib/convenient_service/examples/standard/request_params/utils/json.rb +1 -1
  241. data/lib/convenient_service/examples/standard/request_params/utils/object/blank.rb +2 -2
  242. data/lib/convenient_service/examples/standard/request_params/utils/object/present.rb +2 -2
  243. data/lib/convenient_service/examples/standard/request_params/utils/object.rb +1 -1
  244. data/lib/convenient_service/examples/standard/request_params/utils/url/valid.rb +47 -0
  245. data/lib/convenient_service/examples/standard/request_params/utils/url.rb +21 -0
  246. data/lib/convenient_service/examples/standard/request_params/utils.rb +1 -0
  247. data/lib/convenient_service/examples/standard/request_params.rb +1 -1
  248. data/lib/convenient_service/examples/standard/v1/cowsay/services/build_cloud.rb +44 -0
  249. data/lib/convenient_service/examples/standard/v1/cowsay/services/build_cow.rb +40 -0
  250. data/lib/convenient_service/examples/standard/v1/cowsay/services/print.rb +34 -0
  251. data/lib/convenient_service/examples/standard/v1/cowsay/services.rb +5 -0
  252. data/lib/convenient_service/examples/standard/v1/cowsay.rb +26 -0
  253. data/lib/convenient_service/examples/standard/v1/date_time/services/safe_parse.rb +33 -0
  254. data/lib/convenient_service/examples/standard/v1/date_time/services.rb +3 -0
  255. data/lib/convenient_service/examples/standard/v1/date_time.rb +25 -0
  256. data/lib/convenient_service/examples/standard/v1/factorial/services/calculate.rb +51 -0
  257. data/lib/convenient_service/examples/standard/v1/factorial/services.rb +3 -0
  258. data/lib/convenient_service/examples/standard/v1/factorial/utils/timeout/with_timeout.rb +52 -0
  259. data/lib/convenient_service/examples/standard/v1/factorial/utils/timeout.rb +23 -0
  260. data/lib/convenient_service/examples/standard/v1/factorial/utils.rb +3 -0
  261. data/lib/convenient_service/examples/standard/v1/factorial.rb +26 -0
  262. data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_file_exists.rb +32 -0
  263. data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_file_not_empty.rb +32 -0
  264. data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_node_available.rb +28 -0
  265. data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_npm_package_available.rb +50 -0
  266. data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_valid_ruby_syntax.rb +41 -0
  267. data/lib/convenient_service/examples/standard/v1/gemfile/services/format.rb +82 -0
  268. data/lib/convenient_service/examples/standard/v1/gemfile/services/format_body.rb +85 -0
  269. data/lib/convenient_service/examples/standard/v1/gemfile/services/format_gems_with_envs.rb +88 -0
  270. data/lib/convenient_service/examples/standard/v1/gemfile/services/format_gems_without_envs.rb +76 -0
  271. data/lib/convenient_service/examples/standard/v1/gemfile/services/format_header.rb +68 -0
  272. data/lib/convenient_service/examples/standard/v1/gemfile/services/merge_sections.rb +54 -0
  273. data/lib/convenient_service/examples/standard/v1/gemfile/services/parse_content.rb +103 -0
  274. data/lib/convenient_service/examples/standard/v1/gemfile/services/print_shell_command.rb +47 -0
  275. data/lib/convenient_service/examples/standard/v1/gemfile/services/read_file_content.rb +41 -0
  276. data/lib/convenient_service/examples/standard/v1/gemfile/services/replace_file_content.rb +50 -0
  277. data/lib/convenient_service/examples/standard/v1/gemfile/services/run_shell_command.rb +52 -0
  278. data/lib/convenient_service/examples/standard/v1/gemfile/services/strip_comments.rb +113 -0
  279. data/lib/convenient_service/examples/standard/v1/gemfile/services.rb +20 -0
  280. data/lib/convenient_service/examples/standard/v1/gemfile.rb +26 -0
  281. data/lib/convenient_service/examples/standard/v1/request_params/constants.rb +17 -0
  282. data/lib/convenient_service/examples/standard/v1/request_params/entities/description.rb +42 -0
  283. data/lib/convenient_service/examples/standard/v1/request_params/entities/format.rb +42 -0
  284. data/lib/convenient_service/examples/standard/v1/request_params/entities/id.rb +49 -0
  285. data/lib/convenient_service/examples/standard/v1/request_params/entities/logger.rb +23 -0
  286. data/lib/convenient_service/examples/standard/v1/request_params/entities/request.rb +25 -0
  287. data/lib/convenient_service/examples/standard/v1/request_params/entities/source.rb +42 -0
  288. data/lib/convenient_service/examples/standard/v1/request_params/entities/tag.rb +42 -0
  289. data/lib/convenient_service/examples/standard/v1/request_params/entities/title.rb +42 -0
  290. data/lib/convenient_service/examples/standard/v1/request_params/entities.rb +11 -0
  291. data/lib/convenient_service/examples/standard/v1/request_params/services/apply_default_param_values.rb +28 -0
  292. data/lib/convenient_service/examples/standard/v1/request_params/services/cast_params.rb +40 -0
  293. data/lib/convenient_service/examples/standard/v1/request_params/services/extract_params_from_body.rb +72 -0
  294. data/lib/convenient_service/examples/standard/v1/request_params/services/extract_params_from_path.rb +64 -0
  295. data/lib/convenient_service/examples/standard/v1/request_params/services/filter_out_unpermitted_params.rb +28 -0
  296. data/lib/convenient_service/examples/standard/v1/request_params/services/log_request_params.rb +56 -0
  297. data/lib/convenient_service/examples/standard/v1/request_params/services/merge_params.rb +28 -0
  298. data/lib/convenient_service/examples/standard/v1/request_params/services/prepare.rb +67 -0
  299. data/lib/convenient_service/examples/standard/v1/request_params/services/validate_casted_params.rb +96 -0
  300. data/lib/convenient_service/examples/standard/v1/request_params/services/validate_uncasted_params.rb +74 -0
  301. data/lib/convenient_service/examples/standard/v1/request_params/services.rb +13 -0
  302. data/lib/convenient_service/examples/standard/v1/request_params/utils/array/wrap.rb +48 -0
  303. data/lib/convenient_service/examples/standard/v1/request_params/utils/array.rb +23 -0
  304. data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_body.rb +44 -0
  305. data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_path.rb +42 -0
  306. data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request.rb +30 -0
  307. data/lib/convenient_service/examples/standard/v1/request_params/utils/http.rb +3 -0
  308. data/lib/convenient_service/examples/standard/v1/request_params/utils/integer/safe_parse.rb +33 -0
  309. data/lib/convenient_service/examples/standard/v1/request_params/utils/integer.rb +27 -0
  310. data/lib/convenient_service/examples/standard/v1/request_params/utils/json/safe_parse.rb +42 -0
  311. data/lib/convenient_service/examples/standard/v1/request_params/utils/json.rb +23 -0
  312. data/lib/convenient_service/examples/standard/v1/request_params/utils/object/blank.rb +36 -0
  313. data/lib/convenient_service/examples/standard/v1/request_params/utils/object/present.rb +33 -0
  314. data/lib/convenient_service/examples/standard/v1/request_params/utils/object.rb +28 -0
  315. data/lib/convenient_service/examples/standard/v1/request_params/utils/url/valid.rb +49 -0
  316. data/lib/convenient_service/examples/standard/v1/request_params/utils/url.rb +23 -0
  317. data/lib/convenient_service/examples/standard/v1/request_params/utils.rb +8 -0
  318. data/lib/convenient_service/examples/standard/v1/request_params.rb +50 -0
  319. data/lib/convenient_service/exception.rb +16 -0
  320. data/lib/convenient_service/feature.rb +0 -1
  321. data/lib/convenient_service/logger.rb +69 -24
  322. data/lib/convenient_service/rspec/helpers/custom/ignoring_exception/exceptions.rb +27 -0
  323. data/lib/convenient_service/rspec/helpers/custom/ignoring_exception.rb +51 -0
  324. data/lib/convenient_service/rspec/helpers/custom/stub_service/entities/result_spec.rb +2 -2
  325. data/lib/convenient_service/rspec/helpers/custom/stub_service/entities/stubbed_service.rb +20 -16
  326. data/lib/convenient_service/rspec/helpers/custom/wrap_method/entities/wrapped_method.rb +110 -53
  327. data/lib/convenient_service/rspec/helpers/custom/wrap_method/{errors.rb → exceptions.rb} +2 -2
  328. data/lib/convenient_service/rspec/helpers/custom/wrap_method.rb +31 -7
  329. data/lib/convenient_service/rspec/helpers/custom.rb +1 -1
  330. data/lib/convenient_service/rspec/helpers/{ignoring_error.rb → ignoring_exception.rb} +3 -3
  331. data/lib/convenient_service/rspec/helpers.rb +2 -2
  332. data/lib/convenient_service/rspec/matchers/custom/be_descendant_of.rb +1 -1
  333. data/lib/convenient_service/rspec/matchers/custom/cache_its_value.rb +20 -0
  334. data/lib/convenient_service/rspec/matchers/custom/call_chain_next.rb +103 -2
  335. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings/sub_matchers/return_its_value.rb +3 -0
  336. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_concrete_arguments.rb +1 -1
  337. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings_collection/{errors.rb → exceptions.rb} +4 -4
  338. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings_collection.rb +11 -11
  339. data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher.rb +5 -5
  340. data/lib/convenient_service/rspec/matchers/custom/delegate_to.rb +13 -3
  341. data/lib/convenient_service/rspec/matchers/custom/export.rb +9 -9
  342. data/lib/convenient_service/rspec/matchers/custom/have_abstract_method.rb +1 -1
  343. data/lib/convenient_service/rspec/matchers/custom/have_alias_method.rb +3 -0
  344. data/lib/convenient_service/rspec/matchers/custom/results/base/constants.rb +9 -0
  345. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/chain.rb +226 -0
  346. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_code_part.rb +61 -0
  347. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_data_part.rb +61 -0
  348. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_message_part.rb +61 -0
  349. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_parts.rb +121 -0
  350. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_service_part.rb +61 -0
  351. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_status_part.rb +68 -0
  352. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_step_part.rb +61 -0
  353. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_got_parts.rb +98 -0
  354. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_got_service_part.rb +68 -0
  355. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_got_step_part.rb +68 -0
  356. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands.rb +13 -0
  357. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base.rb +207 -0
  358. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/error/commands/generate_got_jsend_attributes_part.rb +129 -0
  359. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/error/commands.rb +3 -0
  360. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/error.rb +34 -0
  361. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/failure/commands/generate_got_jsend_attributes_part.rb +129 -0
  362. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/failure/commands.rb +3 -0
  363. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/failure.rb +34 -0
  364. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/null.rb +147 -0
  365. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb +129 -0
  366. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/success/commands.rb +3 -0
  367. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/success.rb +34 -0
  368. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers.rb +46 -0
  369. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result.rb +121 -0
  370. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_code.rb +97 -0
  371. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_data.rb +97 -0
  372. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_message.rb +97 -0
  373. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_service.rb +81 -0
  374. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_status.rb +92 -0
  375. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_step.rb +127 -0
  376. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_type.rb +89 -0
  377. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands.rb +10 -0
  378. data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator.rb +123 -0
  379. data/lib/convenient_service/rspec/matchers/custom/results/base/entities.rb +5 -0
  380. data/lib/convenient_service/rspec/matchers/custom/results/base/{errors.rb → exceptions.rb} +8 -2
  381. data/lib/convenient_service/rspec/matchers/custom/results/base.rb +112 -149
  382. data/lib/convenient_service/rspec/matchers/custom/results/be_error.rb +6 -1
  383. data/lib/convenient_service/rspec/matchers/custom/results/be_failure.rb +6 -1
  384. data/lib/convenient_service/rspec/matchers/custom/results/be_not_error.rb +7 -2
  385. data/lib/convenient_service/rspec/matchers/custom/results/be_not_failure.rb +7 -2
  386. data/lib/convenient_service/rspec/matchers/custom/results/be_not_success.rb +7 -2
  387. data/lib/convenient_service/rspec/matchers/custom/results/be_success.rb +6 -1
  388. data/lib/convenient_service/rspec/matchers/results/be_error.rb +3 -0
  389. data/lib/convenient_service/rspec/matchers/results/be_failure.rb +3 -0
  390. data/lib/convenient_service/rspec/matchers/results/be_not_error.rb +3 -0
  391. data/lib/convenient_service/rspec/matchers/results/be_not_failure.rb +3 -0
  392. data/lib/convenient_service/rspec/matchers/results/be_not_success.rb +3 -0
  393. data/lib/convenient_service/rspec/matchers/results/be_result.rb +31 -0
  394. data/lib/convenient_service/rspec/matchers/results/be_success.rb +3 -0
  395. data/lib/convenient_service/rspec/matchers/results.rb +4 -0
  396. data/lib/convenient_service/service/plugins/can_have_fallbacks/concern.rb +105 -0
  397. data/lib/convenient_service/service/plugins/can_have_fallbacks/exceptions.rb +36 -0
  398. data/lib/convenient_service/service/plugins/can_have_fallbacks/middleware.rb +36 -0
  399. data/lib/convenient_service/service/plugins/can_have_fallbacks.rb +5 -0
  400. data/lib/convenient_service/service/plugins/can_have_method_steps/middleware.rb +5 -24
  401. data/lib/convenient_service/service/plugins/can_have_steps/concern.rb +3 -0
  402. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method.rb +5 -5
  403. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method_factory.rb +1 -1
  404. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb +2 -2
  405. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb +96 -26
  406. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/alias.rb +2 -2
  407. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/base.rb +49 -7
  408. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/proc.rb +1 -1
  409. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/raw.rb +1 -1
  410. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/reassignment.rb +2 -2
  411. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/usual.rb +2 -2
  412. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/base.rb +27 -4
  413. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/input.rb +2 -2
  414. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/output.rb +1 -1
  415. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/base.rb +1 -1
  416. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb +31 -1
  417. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/name.rb +31 -1
  418. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/{errors.rb → exceptions.rb} +81 -15
  419. data/lib/convenient_service/service/plugins/can_have_steps/entities/method.rb +1 -1
  420. data/lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/class_methods.rb +46 -0
  421. data/lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb +64 -0
  422. data/lib/convenient_service/service/plugins/can_have_steps/entities/service/concern.rb +28 -0
  423. data/lib/convenient_service/service/plugins/can_have_steps/entities/service.rb +7 -30
  424. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb +39 -2
  425. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/extract_params.rb +2 -4
  426. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb +229 -64
  427. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/{errors.rb → exceptions.rb} +3 -3
  428. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_completed/concern.rb +44 -0
  429. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_completed.rb +3 -0
  430. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed/middleware.rb +36 -0
  431. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed.rb +3 -0
  432. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_printed/middleware.rb +32 -0
  433. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_printed.rb +3 -0
  434. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/concern.rb +37 -0
  435. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step.rb +6 -0
  436. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed/exceptions.rb +38 -0
  437. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed/middleware.rb +72 -0
  438. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed.rb +4 -0
  439. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/concern.rb +30 -0
  440. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step.rb +5 -0
  441. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/concern.rb +97 -0
  442. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/middleware.rb +74 -0
  443. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/result.rb +3 -0
  444. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks.rb +4 -0
  445. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_parent_result/middleware.rb +4 -2
  446. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect/concern.rb +45 -0
  447. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect.rb +3 -0
  448. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_inspect/concern.rb +5 -1
  449. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins.rb +4 -0
  450. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/structs/params.rb +1 -1
  451. data/lib/convenient_service/service/plugins/can_have_steps/entities/step.rb +1 -1
  452. data/lib/convenient_service/service/plugins/can_have_steps/middleware.rb +38 -9
  453. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/fetch_all_services_stubbed_results_cache.rb +30 -0
  454. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/fetch_service_stubbed_results_cache.rb +43 -0
  455. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/get_service_stubbed_result.rb +58 -0
  456. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/set_service_stubbed_result.rb +66 -0
  457. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands.rb +6 -0
  458. data/lib/convenient_service/service/plugins/can_have_stubbed_results/concern.rb +46 -0
  459. data/lib/convenient_service/service/plugins/can_have_stubbed_results/container.rb +17 -0
  460. data/lib/convenient_service/service/plugins/can_have_stubbed_results/middleware.rb +65 -0
  461. data/lib/convenient_service/service/plugins/can_have_stubbed_results.rb +6 -0
  462. data/lib/convenient_service/service/plugins/can_recalculate_result/concern.rb +1 -1
  463. data/lib/convenient_service/service/plugins/collects_services_in_exception/commands/extract_service_details.rb +64 -0
  464. data/lib/convenient_service/service/plugins/collects_services_in_exception/commands.rb +3 -0
  465. data/lib/convenient_service/service/plugins/collects_services_in_exception/constants.rb +16 -0
  466. data/lib/convenient_service/service/plugins/collects_services_in_exception/middleware.rb +50 -0
  467. data/lib/convenient_service/service/plugins/collects_services_in_exception.rb +5 -0
  468. data/lib/convenient_service/service/plugins/counts_stubbed_results_invocations/middleware.rb +24 -0
  469. data/lib/convenient_service/service/plugins/counts_stubbed_results_invocations.rb +3 -0
  470. data/lib/convenient_service/service/plugins/has_awesome_print_inspect/concern.rb +39 -0
  471. data/lib/convenient_service/service/plugins/has_awesome_print_inspect.rb +3 -0
  472. data/lib/convenient_service/service/plugins/has_inspect/concern.rb +8 -1
  473. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/commands/create_result_class.rb +1 -1
  474. data/lib/convenient_service/service/plugins/has_j_send_result/commands/is_result.rb +34 -0
  475. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/commands.rb +1 -0
  476. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/concern/class_methods.rb +20 -24
  477. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/concern/instance_methods.rb +4 -12
  478. data/lib/convenient_service/service/plugins/has_j_send_result/concern.rb +22 -0
  479. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/constants.rb +5 -5
  480. data/lib/convenient_service/service/plugins/has_j_send_result/container.rb +29 -0
  481. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/concern.rb +1 -1
  482. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/aliases.rb +7 -0
  483. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_own_result/concern.rb +142 -0
  484. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_own_result.rb +3 -0
  485. data/lib/convenient_service/service/plugins/{has_result/entities/result/plugins/has_inspect → has_j_send_result/entities/result/plugins/can_be_stubbed_result}/concern.rb +5 -6
  486. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_stubbed_result.rb +3 -0
  487. data/lib/convenient_service/service/plugins/{has_result/entities/result/plugins/has_step → has_j_send_result/entities/result/plugins/can_have_checked_status}/concern.rb +7 -4
  488. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status/middleware.rb +43 -0
  489. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status.rb +4 -0
  490. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_fallbacks/concern.rb +44 -0
  491. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_fallbacks.rb +3 -0
  492. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_have_parent_result/concern.rb +8 -5
  493. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_have_parent_result/constants.rb +1 -1
  494. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_have_parent_result.rb +0 -2
  495. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_step/concern.rb +30 -0
  496. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_step.rb +3 -0
  497. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_recalculate_result/concern.rb +1 -1
  498. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect/concern.rb +41 -0
  499. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect.rb +3 -0
  500. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_inspect/concern.rb +38 -0
  501. 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
  502. 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
  503. 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
  504. 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
  505. 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
  506. 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
  507. 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
  508. 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
  509. 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
  510. 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
  511. 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
  512. 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
  513. 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
  514. 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
  515. 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
  516. 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
  517. 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
  518. 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
  519. 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
  520. 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
  521. 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
  522. 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
  523. 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
  524. 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 +190 -0
  525. 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
  526. 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
  527. 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
  528. 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
  529. 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
  530. 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
  531. 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
  532. 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
  533. 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
  534. 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
  535. 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
  536. 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
  537. 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
  538. 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 +123 -0
  539. 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
  540. 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
  541. 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
  542. 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
  543. 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
  544. 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
  545. 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
  546. 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
  547. 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
  548. 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
  549. 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
  550. 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
  551. 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
  552. 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
  553. 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
  554. 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
  555. 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
  556. 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
  557. 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
  558. 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
  559. 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
  560. 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
  561. 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
  562. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes.rb +1 -1
  563. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter/concern.rb +30 -0
  564. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter/middleware.rb +38 -0
  565. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter.rb +4 -0
  566. 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
  567. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +47 -0
  568. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/raises_on_not_checked_result_status.rb +1 -1
  569. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins.rb +6 -3
  570. data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result.rb +1 -1
  571. data/lib/convenient_service/service/plugins/has_j_send_result/exceptions.rb +21 -0
  572. data/lib/convenient_service/service/plugins/has_j_send_result.rb +8 -0
  573. data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_active_model_validations/concern.rb +1 -1
  574. data/lib/convenient_service/service/plugins/has_j_send_result_params_validations/using_active_model_validations/middleware.rb +48 -0
  575. data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_dry_validation/concern.rb +1 -1
  576. data/lib/convenient_service/service/plugins/has_j_send_result_params_validations/using_dry_validation/middleware.rb +73 -0
  577. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/concern.rb +1 -1
  578. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/exceptions.rb +87 -0
  579. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/middleware.rb +56 -0
  580. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error.rb +1 -2
  581. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/exceptions.rb +90 -0
  582. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/middleware.rb +56 -0
  583. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure.rb +4 -0
  584. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb +67 -0
  585. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands.rb +3 -0
  586. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/exceptions.rb +41 -0
  587. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/middleware.rb +27 -0
  588. data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/success.rb +1 -1
  589. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax.rb +6 -0
  590. data/lib/convenient_service/service/plugins/{has_result_status_check_short_syntax → has_j_send_result_status_check_short_syntax}/concern.rb +1 -1
  591. data/lib/convenient_service/service/plugins/has_j_send_result_status_check_short_syntax.rb +3 -0
  592. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/concern.rb +24 -0
  593. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_lines.rb +94 -0
  594. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_method_step_lines.rb +115 -0
  595. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_result_lines.rb +105 -0
  596. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_service_lines.rb +88 -0
  597. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_service_step_lines.rb +127 -0
  598. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands.rb +7 -0
  599. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb +90 -0
  600. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb +144 -0
  601. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/template.rb +85 -0
  602. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities.rb +5 -0
  603. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/templates/flowchart.html.erb +95 -0
  604. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart.rb +108 -0
  605. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities.rb +3 -0
  606. data/lib/convenient_service/service/plugins/has_mermaid_flowchart.rb +4 -0
  607. data/lib/convenient_service/service/plugins/has_result/concern.rb +17 -6
  608. data/lib/convenient_service/service/plugins/has_result/exceptions.rb +21 -0
  609. data/lib/convenient_service/service/plugins/has_result.rb +1 -5
  610. data/lib/convenient_service/service/plugins/raises_on_double_result/{errors.rb → exceptions.rb} +2 -2
  611. data/lib/convenient_service/service/plugins/raises_on_double_result/middleware.rb +11 -9
  612. data/lib/convenient_service/service/plugins/raises_on_double_result.rb +1 -1
  613. data/lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb +24 -0
  614. data/lib/convenient_service/service/plugins/raises_on_not_result_return_value/middleware.rb +25 -0
  615. data/lib/convenient_service/service/plugins/raises_on_not_result_return_value.rb +4 -0
  616. data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/middleware.rb +49 -7
  617. data/lib/convenient_service/service/plugins/sets_parent_to_foreign_result/middleware.rb +56 -0
  618. data/lib/convenient_service/service/plugins/sets_parent_to_foreign_result.rb +3 -0
  619. data/lib/convenient_service/service/plugins/wraps_result_in_db_transaction/middleware.rb +3 -1
  620. data/lib/convenient_service/service/plugins.rb +14 -6
  621. data/lib/convenient_service/support/abstract_method/{errors.rb → exceptions.rb} +2 -2
  622. data/lib/convenient_service/support/abstract_method.rb +2 -2
  623. data/lib/convenient_service/support/cache/constants.rb +36 -0
  624. data/lib/convenient_service/support/cache/entities/caches/array/entities/pair.rb +52 -0
  625. data/lib/convenient_service/support/cache/entities/caches/array/entities.rb +3 -0
  626. data/lib/convenient_service/support/cache/entities/caches/array.rb +135 -0
  627. data/lib/convenient_service/support/cache/entities/caches/base.rb +112 -0
  628. data/lib/convenient_service/support/cache/entities/caches/hash.rb +113 -0
  629. data/lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb +89 -0
  630. data/lib/convenient_service/support/cache/entities/caches.rb +8 -0
  631. data/lib/convenient_service/support/cache/entities/key.rb +102 -0
  632. data/lib/convenient_service/support/cache/entities.rb +4 -0
  633. data/lib/convenient_service/support/cache/exceptions.rb +34 -0
  634. data/lib/convenient_service/support/cache.rb +16 -143
  635. data/lib/convenient_service/support/castable/{errors.rb → exceptions.rb} +3 -3
  636. data/lib/convenient_service/support/castable.rb +2 -2
  637. data/lib/convenient_service/support/command.rb +42 -3
  638. data/lib/convenient_service/support/copyable.rb +7 -23
  639. data/lib/convenient_service/support/counter.rb +7 -8
  640. data/lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb +2 -2
  641. data/lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb +8 -8
  642. data/lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb +2 -2
  643. data/lib/convenient_service/support/dependency_container/entities/method.rb +49 -12
  644. data/lib/convenient_service/support/dependency_container/entities/method_collection.rb +3 -3
  645. data/lib/convenient_service/support/dependency_container/{errors.rb → exceptions.rb} +5 -5
  646. data/lib/convenient_service/support/dependency_container/export.rb +4 -4
  647. data/lib/convenient_service/support/dependency_container/import.rb +7 -4
  648. data/lib/convenient_service/support/dependency_container.rb +1 -1
  649. data/lib/convenient_service/support/finite_loop.rb +8 -8
  650. data/lib/convenient_service/support/gems/logger.rb +37 -0
  651. data/lib/convenient_service/support/gems/paint.rb +37 -0
  652. data/lib/convenient_service/support/gems.rb +2 -0
  653. data/lib/convenient_service/support/safe_method.rb +1 -1
  654. data/lib/convenient_service/support/thread_safe_counter.rb +9 -0
  655. data/lib/convenient_service/support.rb +1 -0
  656. data/lib/convenient_service/utils/array/contain_exactly.rb +1 -5
  657. data/lib/convenient_service/utils/array/{errors.rb → exceptions.rb} +2 -2
  658. data/lib/convenient_service/utils/array/limited_push.rb +54 -0
  659. data/lib/convenient_service/utils/array/merge.rb +3 -3
  660. data/lib/convenient_service/utils/array.rb +6 -1
  661. data/lib/convenient_service/utils/class/display_name.rb +49 -0
  662. data/lib/convenient_service/utils/class.rb +20 -0
  663. data/lib/convenient_service/utils/hash/assert_valid_keys.rb +50 -0
  664. data/lib/convenient_service/utils/hash/except.rb +1 -1
  665. data/lib/convenient_service/utils/hash/triple_equality_compare.rb +51 -0
  666. data/lib/convenient_service/utils/hash.rb +10 -0
  667. data/lib/convenient_service/utils/method/defined.rb +50 -6
  668. data/lib/convenient_service/utils/module/class_method_defined.rb +22 -2
  669. data/lib/convenient_service/utils/module/get_own_instance_method.rb +3 -0
  670. data/lib/convenient_service/utils/module/instance_method_defined.rb +22 -2
  671. data/lib/convenient_service/utils/object/clamp_class.rb +77 -0
  672. data/lib/convenient_service/utils/object/duck_class.rb +112 -0
  673. data/lib/convenient_service/utils/object/memoize_including_falsy_values.rb +1 -1
  674. data/lib/convenient_service/utils/object.rb +19 -10
  675. data/lib/convenient_service/utils/string/truncate.rb +69 -0
  676. data/lib/convenient_service/utils/string.rb +5 -0
  677. data/lib/convenient_service/utils.rb +21 -0
  678. data/lib/convenient_service/version.rb +1 -1
  679. data/lib/convenient_service.rb +14 -7
  680. data/minitest.rb +30 -0
  681. metadata +682 -153
  682. data/lib/convenient_service/common/plugins/caches_constructor_params/concern.rb +0 -22
  683. data/lib/convenient_service/common/plugins/caches_constructor_params/entities/constructor_params.rb +0 -34
  684. data/lib/convenient_service/common/plugins/caches_constructor_params/entities.rb +0 -3
  685. data/lib/convenient_service/common/plugins/caches_constructor_params/middleware.rb +0 -17
  686. data/lib/convenient_service/common/plugins/caches_constructor_params.rb +0 -5
  687. data/lib/convenient_service/core/class_methods.rb +0 -96
  688. data/lib/convenient_service/core/entities/classic_middleware.rb +0 -32
  689. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/chain.rb +0 -71
  690. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware.rb +0 -131
  691. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creator.rb +0 -62
  692. data/lib/convenient_service/core/instance_methods.rb +0 -56
  693. data/lib/convenient_service/error.rb +0 -16
  694. data/lib/convenient_service/rspec/helpers/custom/ignoring_error.rb +0 -32
  695. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_method_step.rb +0 -74
  696. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_result_method_step.rb +0 -66
  697. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb +0 -48
  698. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/generate_expected_step_part.rb +0 -42
  699. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/generate_got_step_part.rb +0 -42
  700. data/lib/convenient_service/rspec/matchers/custom/results/base/commands/match_result_step.rb +0 -89
  701. data/lib/convenient_service/rspec/matchers/custom/results/base/commands.rb +0 -10
  702. data/lib/convenient_service/service/plugins/can_have_result_step/middleware.rb +0 -43
  703. data/lib/convenient_service/service/plugins/can_have_result_step.rb +0 -3
  704. data/lib/convenient_service/service/plugins/can_have_steps/entities/service/class_methods.rb +0 -32
  705. data/lib/convenient_service/service/plugins/can_have_stubbed_result/concern.rb +0 -59
  706. data/lib/convenient_service/service/plugins/can_have_stubbed_result/middleware.rb +0 -36
  707. data/lib/convenient_service/service/plugins/can_have_stubbed_result.rb +0 -4
  708. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/aliases.rb +0 -7
  709. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/initialize/middleware.rb +0 -27
  710. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/initialize.rb +0 -3
  711. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/to_kwargs/middleware.rb +0 -25
  712. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/to_kwargs.rb +0 -3
  713. 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
  714. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/concern/class_methods.rb +0 -69
  715. 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
  716. 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
  717. 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
  718. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax/concern.rb +0 -62
  719. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax.rb +0 -3
  720. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/initialize/middleware.rb +0 -27
  721. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/initialize.rb +0 -3
  722. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/to_kwargs/middleware.rb +0 -25
  723. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/to_kwargs.rb +0 -3
  724. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step.rb +0 -5
  725. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/marks_result_status_as_checked/middleware.rb +0 -25
  726. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/marks_result_status_as_checked.rb +0 -3
  727. data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +0 -33
  728. data/lib/convenient_service/service/plugins/has_result/errors.rb +0 -34
  729. data/lib/convenient_service/service/plugins/has_result/middleware.rb +0 -19
  730. data/lib/convenient_service/service/plugins/has_result_params_validations/using_active_model_validations/middleware.rb +0 -35
  731. data/lib/convenient_service/service/plugins/has_result_params_validations/using_dry_validation/middleware.rb +0 -49
  732. data/lib/convenient_service/service/plugins/has_result_short_syntax/error/commands/assert_args_count_lower_than_three.rb +0 -25
  733. data/lib/convenient_service/service/plugins/has_result_short_syntax/error/commands/assert_either_args_or_kwargs_are_passed.rb +0 -26
  734. data/lib/convenient_service/service/plugins/has_result_short_syntax/error/commands.rb +0 -4
  735. data/lib/convenient_service/service/plugins/has_result_short_syntax/error/errors.rb +0 -46
  736. data/lib/convenient_service/service/plugins/has_result_short_syntax/error/middleware.rb +0 -27
  737. data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/commands/refute_kwargs_contain_data_and_extra_keys.rb +0 -29
  738. data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/commands.rb +0 -3
  739. data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/errors.rb +0 -28
  740. data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/middleware.rb +0 -19
  741. data/lib/convenient_service/service/plugins/has_result_short_syntax/failure.rb +0 -5
  742. data/lib/convenient_service/service/plugins/has_result_short_syntax/success/commands/refute_kwargs_contain_data_and_extra_keys.rb +0 -29
  743. data/lib/convenient_service/service/plugins/has_result_short_syntax/success/commands.rb +0 -3
  744. data/lib/convenient_service/service/plugins/has_result_short_syntax/success/errors.rb +0 -28
  745. data/lib/convenient_service/service/plugins/has_result_short_syntax/success/middleware.rb +0 -19
  746. data/lib/convenient_service/service/plugins/has_result_short_syntax.rb +0 -6
  747. data/lib/convenient_service/service/plugins/has_result_status_check_short_syntax.rb +0 -3
  748. data/lib/convenient_service/services/run_method_in_organizer.rb +0 -28
  749. data/lib/convenient_service/services/run_own_method_in_organizer.rb +0 -64
  750. data/lib/convenient_service/support/cache/key.rb +0 -100
  751. data/lib/convenient_service/utils/object/resolve_class.rb +0 -56
  752. /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_recalculate_result.rb +0 -0
  753. /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_inspect.rb +0 -0
  754. /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
  755. /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
  756. /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
  757. /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities.rb +0 -0
  758. /data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_active_model_validations.rb +0 -0
  759. /data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_dry_validation.rb +0 -0
@@ -0,0 +1,123 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "validator/commands"
4
+
5
+ module ConvenientService
6
+ module RSpec
7
+ module Matchers
8
+ module Custom
9
+ module Results
10
+ class Base
11
+ module Entities
12
+ class Validator
13
+ ##
14
+ # @api private
15
+ #
16
+ # @!attribute [r] matcher
17
+ # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
18
+ #
19
+ attr_reader :matcher
20
+
21
+ ##
22
+ # @api private
23
+ #
24
+ # @param matcher [ConvenientService::RSpec::Matchers::Custom::Results::Base]
25
+ # @return [void]
26
+ #
27
+ def initialize(matcher:)
28
+ @matcher = matcher
29
+ end
30
+
31
+ ##
32
+ # @api private
33
+ #
34
+ # @return [Boolean]
35
+ #
36
+ def valid_result?
37
+ Commands::ValidateResult[validator: self]
38
+ end
39
+
40
+ ##
41
+ # @api private
42
+ #
43
+ # @return [Boolean]
44
+ #
45
+ def valid_result_code?
46
+ Commands::ValidateResultCode[validator: self]
47
+ end
48
+
49
+ ##
50
+ # @api private
51
+ #
52
+ # @return [Boolean]
53
+ #
54
+ def valid_result_data?
55
+ Commands::ValidateResultData[validator: self]
56
+ end
57
+
58
+ ##
59
+ # @api private
60
+ #
61
+ # @return [Boolean]
62
+ #
63
+ def valid_result_message?
64
+ Commands::ValidateResultMessage[validator: self]
65
+ end
66
+
67
+ ##
68
+ # @api private
69
+ #
70
+ # @return [Boolean]
71
+ #
72
+ def valid_result_service?
73
+ Commands::ValidateResultService[validator: self]
74
+ end
75
+
76
+ ##
77
+ # @api private
78
+ #
79
+ # @return [Boolean]
80
+ #
81
+ def valid_result_status?
82
+ Commands::ValidateResultStatus[validator: self]
83
+ end
84
+
85
+ ##
86
+ # @api private
87
+ #
88
+ # @return [Boolean]
89
+ #
90
+ def valid_result_step?
91
+ Commands::ValidateResultStep[validator: self]
92
+ end
93
+
94
+ ##
95
+ # @api private
96
+ #
97
+ # @return [Boolean]
98
+ #
99
+ def valid_result_type?
100
+ Commands::ValidateResultType[validator: self]
101
+ end
102
+
103
+ ##
104
+ # @api private
105
+ #
106
+ # @param other [Object] Can be any type.
107
+ # @return [Boolean, nil]
108
+ #
109
+ def ==(other)
110
+ return nil unless other.instance_of?(self.class)
111
+
112
+ return false if matcher != other.matcher
113
+
114
+ true
115
+ end
116
+ end
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "entities/chain"
4
+ require_relative "entities/printers"
5
+ require_relative "entities/validator"
@@ -6,8 +6,14 @@ module ConvenientService
6
6
  module Custom
7
7
  module Results
8
8
  class Base
9
- module Errors
10
- class InvalidStep < ::ConvenientService::Error
9
+ module Exceptions
10
+ class InvalidStep < ::ConvenientService::Exception
11
+ ##
12
+ # @api private
13
+ #
14
+ # @param step [ConvenientService::Service, Symbol]
15
+ # @return [void]
16
+ #
11
17
  def initialize(step:)
12
18
  message = <<~TEXT
13
19
  Step `#{step}` is NOT valid.
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "base/commands"
4
3
  require_relative "base/constants"
5
- require_relative "base/errors"
4
+ require_relative "base/entities"
5
+ require_relative "base/exceptions"
6
6
 
7
7
  module ConvenientService
8
8
  module RSpec
@@ -13,301 +13,264 @@ module ConvenientService
13
13
  include Support::AbstractMethod
14
14
 
15
15
  ##
16
+ # @api private
17
+ #
18
+ # @!attribute [r] result
19
+ # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
20
+ #
21
+ attr_reader :result
22
+
23
+ ##
24
+ # @api private
25
+ #
16
26
  # @return [String, Symbol]
17
27
  #
18
28
  abstract_method :statuses
19
29
 
20
30
  ##
21
- # @param result [ConvenientService::Service::Plugins::HasResult::Entities::Result]
31
+ # @api private
32
+ #
33
+ # @return [void]
34
+ #
35
+ def initialize(statuses: self.statuses, result: nil)
36
+ chain.statuses = statuses
37
+
38
+ @result = result
39
+ end
40
+
41
+ ##
42
+ # @api public
43
+ #
44
+ # @param result [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
22
45
  # @return [Boolean]
23
46
  #
24
47
  def matches?(result)
25
48
  @result = result
26
49
 
27
- rules = []
28
-
29
50
  ##
30
- # IMPORTANT: Makes `result.class.include?` from the following line idempotent.
51
+ # IMPORTANT: Makes `result.class.include?` idempotent.
31
52
  #
32
- result.commit_config!(trigger: Constants::Triggers::BE_RESULT) if result.respond_to?(:commit_config!)
33
-
34
- rules << ->(result) { result.class.include?(Service::Plugins::HasResult::Entities::Result::Concern) }
35
-
36
- ##
37
- # IMPORTANT: Result status is NOT marked as checked intentionally, since it is a mutable operation.
53
+ # TODO: Explainer when `result.class.commit_config!` is required. It was introduced in panic when the first thread-safety issues occurred. Looks like it is an outdated operation now. It is probably useful only when a config has almost zero plugins.
38
54
  #
39
- rules << ->(result) { result.status.in?(statuses) }
40
-
41
- rules << ->(result) { result.service.instance_of?(service_class) } if used_of_service?
42
- rules << ->(result) { Commands::MatchResultStep.call(result: result, step: step) } if used_of_step?
43
- rules << ->(result) { result.unsafe_data == data } if used_data?
44
- rules << ->(result) { result.unsafe_message == message } if used_message?
45
- rules << ->(result) { result.unsafe_code == code } if used_code?
46
-
47
- condition = Utils::Proc.conjunct(rules)
55
+ # TODO: Resolve a bug in `delegate_to`. It makes `respond_to?` always return `true`, even for classes that do NOT have the `commit_config!` method. See specs for details.
56
+ #
57
+ # let(:result) { "foo" }
58
+ #
59
+ # specify do
60
+ # expect { matcher.matches?(result) }
61
+ # .not_to delegate_to(result.class, :commit_config!)
62
+ # .with_any_arguments
63
+ # .without_calling_original
64
+ # end
65
+ #
66
+ # `result.class.method(:commit_config!)`
67
+ # # => <Method: String.commit_config!(*args, &block) /usr/local/bundle/gems/rspec-mocks-3.11.2/lib/rspec/mocks/method_double.rb:63>
68
+ #
69
+ result.class.commit_config!(trigger: Constants::Triggers::BE_RESULT) if result.class.respond_to?(:commit_config!)
48
70
 
49
- condition.call(result)
71
+ validator.valid_result?
50
72
  end
51
73
 
52
74
  ##
75
+ # @api public
76
+ #
53
77
  # @return [String]
54
78
  #
55
79
  def description
56
- expected_parts
80
+ printer.description
57
81
  end
58
82
 
59
83
  ##
84
+ # @api public
85
+ #
60
86
  # @return [String]
61
87
  #
62
88
  def failure_message
63
- "expected that `#{result.service.class}` result would #{default_text}"
89
+ printer.failure_message
64
90
  end
65
91
 
66
92
  ##
93
+ # @api public
94
+ #
67
95
  # @return [String]
68
96
  #
69
97
  # @internal
70
- # https://relishapp.com/rspec/rspec-expectations/v/3-11/docs/custom-matchers/define-a-custom-matcher#overriding-the-failure-message-when-negated
98
+ # - https://relishapp.com/rspec/rspec-expectations/v/3-11/docs/custom-matchers/define-a-custom-matcher#overriding-the-failure-message-when-negated
71
99
  #
72
100
  def failure_message_when_negated
73
- "expected that `#{result.service.class}` result would NOT #{default_text}"
101
+ printer.failure_message_when_negated
74
102
  end
75
103
 
76
104
  ##
105
+ # @api public
106
+ #
77
107
  # @param data [Hash]
78
108
  # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
79
109
  #
80
110
  def with_data(data)
81
- chain[:data] = data
111
+ chain.data = data
82
112
 
83
113
  self
84
114
  end
85
115
 
86
116
  ##
117
+ # @api public
118
+ #
87
119
  # @param data [Hash]
88
120
  # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
89
121
  #
90
122
  def and_data(data)
91
- chain[:data] = data
123
+ chain.data = data
92
124
 
93
125
  self
94
126
  end
95
127
 
96
128
  ##
129
+ # @api public
130
+ #
97
131
  # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
98
132
  #
99
133
  def without_data
100
- chain[:data] = {}
134
+ chain.data = {}
101
135
 
102
136
  self
103
137
  end
104
138
 
105
139
  ##
140
+ # @api public
141
+ #
106
142
  # @param message [String]
107
143
  # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
108
144
  #
109
145
  def with_message(message)
110
- chain[:message] = message
146
+ chain.message = message
111
147
 
112
148
  self
113
149
  end
114
150
 
115
151
  ##
152
+ # @api public
153
+ #
116
154
  # @param message [String]
117
155
  # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
118
156
  #
119
157
  def and_message(message)
120
- chain[:message] = message
158
+ chain.message = message
121
159
 
122
160
  self
123
161
  end
124
162
 
125
163
  ##
164
+ # @api public
165
+ #
126
166
  # @return [String, Symbol]
127
167
  # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
128
168
  #
129
169
  def with_code(code)
130
- chain[:code] = code
170
+ chain.code = code
131
171
 
132
172
  self
133
173
  end
134
174
 
135
175
  ##
176
+ # @api public
177
+ #
136
178
  # @return [String, Symbol]
137
179
  # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
138
180
  #
139
181
  def and_code(code)
140
- chain[:code] = code
182
+ chain.code = code
141
183
 
142
184
  self
143
185
  end
144
186
 
145
187
  ##
146
- # @param service_class [Class]
188
+ # @api public
189
+ #
190
+ # @param service [ConvenientService::Service]
147
191
  # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
148
192
  #
149
- def of_service(service_class)
150
- chain[:service_class] = service_class
193
+ def of_service(service)
194
+ chain.service = service
151
195
 
152
196
  self
153
197
  end
154
198
 
155
199
  ##
200
+ # @api public
201
+ #
156
202
  # @param step [Class, Symbol]
157
203
  # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
158
204
  #
159
205
  def of_step(step)
160
- chain[:step] = step
206
+ chain.step = step
161
207
 
162
208
  self
163
209
  end
164
210
 
165
211
  ##
212
+ # @api public
213
+ #
166
214
  # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
167
215
  #
168
216
  def without_step
169
- chain[:step] = nil
217
+ chain.step = nil
170
218
 
171
219
  self
172
220
  end
173
221
 
174
- private
175
-
176
- ##
177
- # @!attribute [r] result
178
- # @return [ConvenientService::Service::Plugins::HasResult::Entities::Result]
179
- #
180
- attr_reader :result
181
-
182
222
  ##
183
- # @return [String]
184
- #
185
- def default_text
186
- expected_parts << "\n\n" << got_parts
187
- end
188
-
189
- ##
190
- # @return [String]
223
+ # @api public
191
224
  #
192
- # @internal
193
- # TODO: Align for easier visual comparison.
194
- # TODO: New line for each attribute.
195
- #
196
- def expected_parts
197
- parts = []
198
-
199
- parts << "be #{printable_statuses}"
200
- parts << "of service `#{service_class}`" if used_of_service?
201
- parts << Commands::GenerateExpectedStepPart.call(step: step) if used_of_step?
202
- parts << "with data `#{data}`" if used_data?
203
- parts << "with message `#{message}`" if used_message?
204
- parts << "with code `#{code}`" if used_code?
205
-
206
- parts.join(" ")
207
- end
208
-
209
- ##
210
- # @return [String]
211
- #
212
- # @internal
213
- # TODO: Align for easier visual comparison.
214
- # TODO: New line for each attribute.
225
+ # @param comparison_method [Symbo, String]
226
+ # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base]
215
227
  #
216
- def got_parts
217
- parts = []
218
-
219
- parts << "got `#{result.status}`"
220
- parts << "of service `#{result.service.class}`" if used_of_service?
221
- parts << Commands::GenerateGotStepPart.call(result: result) if used_of_step?
222
- parts << "with data `#{result.unsafe_data}`" if used_data?
223
- parts << "with message `#{result.unsafe_message}`" if used_message?
224
- parts << "with code `#{result.unsafe_code}`" if used_code?
228
+ def comparing_by(comparison_method)
229
+ chain.comparison_method = comparison_method
225
230
 
226
- parts.join(" ")
227
- end
228
-
229
- ##
230
- # @return [Boolean]
231
- #
232
- def used_data?
233
- chain.key?(:data)
231
+ self
234
232
  end
235
233
 
236
234
  ##
237
- # @return [Boolean]
235
+ # @api private
238
236
  #
239
- def used_message?
240
- chain.key?(:message)
241
- end
242
-
243
- ##
244
- # @return [Boolean]
237
+ # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base::Entities::Chain]
245
238
  #
246
- def used_code?
247
- chain.key?(:code)
248
- end
249
-
250
- ##
251
- # @return [Boolean]
252
- #
253
- def used_of_service?
254
- chain.key?(:service_class)
239
+ def chain
240
+ @chain ||= Entities::Chain.new
255
241
  end
256
242
 
257
243
  ##
258
- # @return [Boolean]
244
+ # @api private
259
245
  #
260
- def used_of_step?
261
- chain.key?(:step)
262
- end
263
-
264
- ##
265
- # @return [Hash]
246
+ # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base::Entities::Printers::Base]
266
247
  #
267
- def data
268
- @data ||= chain[:data] || {}
248
+ def printer
249
+ @printer ||= Entities::Printers.create(matcher: self)
269
250
  end
270
251
 
271
252
  ##
272
- # @return [String]
253
+ # @api private
273
254
  #
274
- def message
275
- @message ||= chain[:message] || ""
276
- end
277
-
278
- ##
279
- # @return [String, Symbol]
255
+ # @return [ConvenientService::RSpec::Matchers::Custom::Results::Base::Entities::Validator]
280
256
  #
281
- def code
282
- @code ||= chain[:code] || ""
257
+ def validator
258
+ @validator ||= Entities::Validator.new(matcher: self)
283
259
  end
284
260
 
285
261
  ##
286
- # @return [Class]
262
+ # @api private
287
263
  #
288
- def service_class
289
- Utils::Object.instance_variable_fetch(self, :@service_class) { chain[:service_class] }
290
- end
291
-
292
- ##
293
- # @return [Class]
264
+ # @param other [Object] Can be any type.
265
+ # @return [Boolean, nil]
294
266
  #
295
- def step
296
- Utils::Object.instance_variable_fetch(self, :@step) { chain[:step] }
297
- end
267
+ def ==(other)
268
+ return unless other.instance_of?(self.class)
298
269
 
299
- ##
300
- # @return [Hash]
301
- #
302
- def chain
303
- @chain ||= {}
304
- end
270
+ return false if chain != other.chain
271
+ return false if result != other.result
305
272
 
306
- ##
307
- # @return [String]
308
- #
309
- def printable_statuses
310
- statuses.map { |status| "`#{status}`" }.join(" or ")
273
+ true
311
274
  end
312
275
  end
313
276
  end
@@ -6,8 +6,13 @@ module ConvenientService
6
6
  module Custom
7
7
  module Results
8
8
  class BeError < Results::Base
9
+ ##
10
+ # @api private
11
+ #
12
+ # @return [Array<Symbol>]
13
+ #
9
14
  def statuses
10
- [Service::Plugins::HasResult::Constants::ERROR_STATUS]
15
+ [Service::Plugins::HasJSendResult::Constants::ERROR_STATUS]
11
16
  end
12
17
  end
13
18
  end
@@ -6,8 +6,13 @@ module ConvenientService
6
6
  module Custom
7
7
  module Results
8
8
  class BeFailure < Results::Base
9
+ ##
10
+ # @api private
11
+ #
12
+ # @return [Array<Symbol>]
13
+ #
9
14
  def statuses
10
- [Service::Plugins::HasResult::Constants::FAILURE_STATUS]
15
+ [Service::Plugins::HasJSendResult::Constants::FAILURE_STATUS]
11
16
  end
12
17
  end
13
18
  end
@@ -6,10 +6,15 @@ module ConvenientService
6
6
  module Custom
7
7
  module Results
8
8
  class BeNotError < Results::Base
9
+ ##
10
+ # @api private
11
+ #
12
+ # @return [Array<Symbol>]
13
+ #
9
14
  def statuses
10
15
  [
11
- Service::Plugins::HasResult::Constants::FAILURE_STATUS,
12
- Service::Plugins::HasResult::Constants::SUCCESS_STATUS
16
+ Service::Plugins::HasJSendResult::Constants::SUCCESS_STATUS,
17
+ Service::Plugins::HasJSendResult::Constants::FAILURE_STATUS
13
18
  ]
14
19
  end
15
20
  end
@@ -6,10 +6,15 @@ module ConvenientService
6
6
  module Custom
7
7
  module Results
8
8
  class BeNotFailure < Results::Base
9
+ ##
10
+ # @api private
11
+ #
12
+ # @return [Array<Symbol>]
13
+ #
9
14
  def statuses
10
15
  [
11
- Service::Plugins::HasResult::Constants::ERROR_STATUS,
12
- Service::Plugins::HasResult::Constants::SUCCESS_STATUS
16
+ Service::Plugins::HasJSendResult::Constants::SUCCESS_STATUS,
17
+ Service::Plugins::HasJSendResult::Constants::ERROR_STATUS
13
18
  ]
14
19
  end
15
20
  end
@@ -6,10 +6,15 @@ module ConvenientService
6
6
  module Custom
7
7
  module Results
8
8
  class BeNotSuccess < Results::Base
9
+ ##
10
+ # @api private
11
+ #
12
+ # @return [Array<Symbol>]
13
+ #
9
14
  def statuses
10
15
  [
11
- Service::Plugins::HasResult::Constants::ERROR_STATUS,
12
- Service::Plugins::HasResult::Constants::FAILURE_STATUS
16
+ Service::Plugins::HasJSendResult::Constants::FAILURE_STATUS,
17
+ Service::Plugins::HasJSendResult::Constants::ERROR_STATUS
13
18
  ]
14
19
  end
15
20
  end
@@ -6,8 +6,13 @@ module ConvenientService
6
6
  module Custom
7
7
  module Results
8
8
  class BeSuccess < Results::Base
9
+ ##
10
+ # @api private
11
+ #
12
+ # @return [Array<Symbol>]
13
+ #
9
14
  def statuses
10
- [Service::Plugins::HasResult::Constants::SUCCESS_STATUS]
15
+ [Service::Plugins::HasJSendResult::Constants::SUCCESS_STATUS]
11
16
  end
12
17
  end
13
18
  end
@@ -5,6 +5,9 @@ module ConvenientService
5
5
  module Matchers
6
6
  module Results
7
7
  module BeError
8
+ ##
9
+ # @api public
10
+ #
8
11
  def be_error(...)
9
12
  Custom::Results::BeError.new(...)
10
13
  end