convenient_service 0.16.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/convenient_service/common/plugins/can_have_user_provided_entity/commands/find_or_create_entity.rb +7 -2
- data/lib/convenient_service/common/plugins/can_have_user_provided_entity/exceptions.rb +4 -4
- data/lib/convenient_service/common/plugins/ensures_negated_j_send_result/middleware.rb +22 -0
- data/lib/convenient_service/common/plugins/ensures_negated_j_send_result.rb +3 -0
- data/lib/convenient_service/common/plugins/has_around_callbacks/concern.rb +8 -1
- data/lib/convenient_service/common/plugins/has_around_callbacks/exceptions.rb +2 -2
- data/lib/convenient_service/common/plugins/has_around_callbacks/middleware.rb +30 -9
- data/lib/convenient_service/common/plugins/has_callbacks/concern.rb +19 -9
- data/lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb +49 -1
- data/lib/convenient_service/common/plugins/has_callbacks/middleware.rb +21 -3
- data/lib/convenient_service/common/plugins/has_callbacks.rb +0 -1
- data/lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class.rb +83 -0
- data/lib/convenient_service/common/plugins/has_instance_proxy/commands.rb +3 -0
- data/lib/convenient_service/common/plugins/has_instance_proxy/concern.rb +22 -0
- data/lib/convenient_service/common/plugins/has_instance_proxy/entities/instance_proxy.rb +76 -0
- data/lib/convenient_service/common/plugins/has_instance_proxy/entities.rb +3 -0
- data/lib/convenient_service/common/plugins/has_instance_proxy/middleware.rb +20 -0
- data/lib/convenient_service/common/plugins/has_instance_proxy.rb +6 -0
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/has_cache/concern.rb +12 -0
- data/lib/convenient_service/common/plugins.rb +2 -0
- data/lib/convenient_service/core/concern/class_methods.rb +7 -2
- data/lib/convenient_service/core/concern/instance_methods.rb +7 -2
- data/lib/convenient_service/core/entities/config/commands/track_method_missing_commit_trigger.rb +1 -1
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/commands/define_method_middlewares_caller.rb +2 -2
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/commands/create_observable_middleware.rb +3 -0
- data/lib/convenient_service/core/entities/config/exceptions.rb +6 -4
- data/lib/convenient_service/core/entities/config.rb +4 -1
- data/lib/convenient_service/dependencies/extractions/active_support_backtrace_cleaner/backtrace_cleaner.rb +28 -8
- data/lib/convenient_service/dependencies/extractions/active_support_backtrace_cleaner.rb +3 -3
- data/lib/convenient_service/dependencies/extractions/b.rb +2 -0
- data/lib/convenient_service/dependencies/extractions/ce.rb +16 -0
- data/lib/convenient_service/dependencies/extractions.rb +1 -0
- data/lib/convenient_service/dependencies.rb +17 -4
- data/lib/convenient_service/exception.rb +98 -10
- data/lib/convenient_service/feature/configs/standard.rb +8 -0
- data/lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb +49 -0
- data/lib/convenient_service/feature/plugins/can_have_entries/commands/define_entry.rb +18 -4
- data/lib/convenient_service/feature/plugins/can_have_entries/commands.rb +1 -0
- data/lib/convenient_service/feature/plugins/can_have_entries/concern.rb +13 -4
- data/lib/convenient_service/feature/plugins/can_have_entries/exceptions.rb +14 -4
- data/lib/convenient_service/logger.rb +13 -2
- data/lib/convenient_service/rspec/helpers/classes/stub_service/entities/result_spec.rb +0 -8
- data/lib/convenient_service/rspec/helpers/classes/wrap_method/entities/wrapped_method.rb +5 -5
- data/lib/convenient_service/rspec/helpers/classes/wrap_method/exceptions.rb +2 -2
- data/lib/convenient_service/rspec/matchers/classes/call_chain_next.rb +41 -0
- data/lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result_step.rb +1 -1
- data/lib/convenient_service/rspec/matchers/classes/results/base/exceptions.rb +2 -2
- data/lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception/exceptions.rb +2 -2
- data/lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb +1 -1
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb +46 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/delegation.rb +89 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/inputs.rb +223 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/outputs.rb +38 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matcher_collection.rb +157 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/arguments/commands/apply_stub_to_track_delegations.rb +77 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/arguments/commands/generate_printable_arguments.rb +94 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/arguments.rb +89 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/base.rb +99 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/return_custom_value.rb +91 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/return_delegation_value.rb +129 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/with_any_arguments.rb +31 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/with_concrete_arguments.rb +31 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/without_arguments.rb +31 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers.rb +11 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities.rb +5 -1
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/exceptions.rb +65 -0
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb +163 -41
- data/lib/convenient_service/service/configs/minimal.rb +85 -33
- data/lib/convenient_service/service/configs/standard/v1.rb +42 -24
- data/lib/convenient_service/service/configs/standard.rb +60 -46
- data/lib/convenient_service/service/plugins/can_have_connected_steps/concern.rb +503 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb +133 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/base.rb +126 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/empty.rb +104 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/group.rb +118 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb +118 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/or.rb +145 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb +133 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions.rb +10 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/step_collection.rb +217 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities.rb +4 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/exceptions.rb +95 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps/middleware.rb +30 -0
- data/lib/convenient_service/service/plugins/can_have_connected_steps.rb +6 -0
- data/lib/convenient_service/service/plugins/can_have_fallbacks/concern.rb +2 -2
- data/lib/convenient_service/service/plugins/can_have_fallbacks/exceptions.rb +4 -4
- data/lib/convenient_service/service/plugins/can_have_fallbacks/middleware.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_sequential_steps/concern.rb +76 -0
- data/lib/convenient_service/service/plugins/{can_have_steps → can_have_sequential_steps}/entities/step_collection.rb +54 -10
- data/lib/convenient_service/service/plugins/can_have_sequential_steps/entities.rb +3 -0
- data/lib/convenient_service/service/plugins/{can_have_steps → can_have_sequential_steps}/middleware.rb +7 -3
- data/lib/convenient_service/service/plugins/can_have_sequential_steps.rb +5 -0
- data/lib/convenient_service/service/plugins/can_have_steps/concern.rb +5 -58
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb +45 -26
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/alias.rb +2 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/proc.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/raw.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/reassignment.rb +2 -4
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/usual.rb +2 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/input.rb +2 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/output.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/exceptions.rb +27 -47
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb +156 -81
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/exceptions.rb +21 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/{can_be_result_step → can_be_method_step}/can_be_executed/exceptions.rb +3 -3
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed/middleware.rb +64 -4
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed.rb +1 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/concern.rb +7 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_alternative_steps.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/concern.rb +0 -46
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/middleware.rb +26 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_parent_result/middleware.rb +13 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/{can_be_result_step → has_result}/concern.rb +8 -4
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_result/middleware.rb +33 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_result.rb +4 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/raises_on_not_result_return_value/exceptions.rb +2 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/raises_on_not_result_return_value/middleware.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins.rb +2 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities.rb +0 -1
- data/lib/convenient_service/service/plugins/can_have_steps.rb +0 -1
- data/lib/convenient_service/service/plugins/has_inspect/concern.rb +0 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status/concern.rb +2 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status.rb +0 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/concern/instance_methods.rb +140 -0
- 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 +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb +45 -3
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/can_be_checked/concern.rb +38 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/can_be_checked/middleware.rb +51 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/can_be_checked.rb +4 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins.rb +1 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/exceptions.rb +17 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_negated_result/concern.rb +72 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_negated_result.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/exceptions.rb +2 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +2 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins.rb +1 -0
- data/lib/convenient_service/service/plugins/has_j_send_result.rb +39 -1
- data/lib/convenient_service/service/plugins/has_j_send_result_params_validations/using_dry_validation/middleware.rb +4 -0
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/exceptions.rb +6 -6
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/middleware.rb +3 -3
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/exceptions.rb +6 -6
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/middleware.rb +3 -3
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/exceptions.rb +2 -2
- data/lib/convenient_service/service/plugins/has_j_send_result_status_check_short_syntax/concern.rb +0 -8
- data/lib/convenient_service/service/plugins/has_negated_j_send_result/concern.rb +23 -0
- data/lib/convenient_service/service/plugins/has_negated_j_send_result.rb +3 -0
- data/lib/convenient_service/service/plugins/has_negated_result/concern.rb +33 -0
- data/lib/convenient_service/service/plugins/has_negated_result/exceptions.rb +21 -0
- data/lib/convenient_service/service/plugins/has_negated_result.rb +4 -0
- data/lib/convenient_service/service/plugins/has_result/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_result/exceptions.rb +2 -2
- data/lib/convenient_service/service/plugins/raises_on_double_result/exceptions.rb +2 -2
- data/lib/convenient_service/service/plugins/raises_on_double_result/middleware.rb +1 -1
- data/lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb +2 -2
- data/lib/convenient_service/service/plugins/raises_on_not_result_return_value/middleware.rb +1 -1
- data/lib/convenient_service/service/plugins/{wraps_result_in_db_transaction → wraps_result_in_d_b_transaction}/middleware.rb +1 -1
- data/lib/convenient_service/service/plugins.rb +7 -2
- data/lib/convenient_service/specification.rb +28 -0
- data/lib/convenient_service/support/abstract_method/exceptions.rb +2 -2
- data/lib/convenient_service/support/abstract_method.rb +1 -1
- data/lib/convenient_service/support/backtrace_cleaner.rb +128 -0
- data/lib/convenient_service/support/cache/entities/caches/base.rb +3 -0
- data/lib/convenient_service/support/cache/exceptions.rb +2 -2
- data/lib/convenient_service/support/cache.rb +1 -1
- data/lib/convenient_service/support/castable/exceptions.rb +4 -4
- data/lib/convenient_service/support/castable.rb +1 -1
- data/lib/convenient_service/support/command.rb +3 -3
- data/lib/convenient_service/support/counter.rb +6 -6
- data/lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb +1 -1
- data/lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb +1 -1
- data/lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb +1 -1
- data/lib/convenient_service/support/dependency_container/exceptions.rb +8 -8
- data/lib/convenient_service/support/dependency_container/export.rb +1 -1
- data/lib/convenient_service/support/finite_loop.rb +6 -6
- data/lib/convenient_service/support/method_parameters.rb +121 -0
- data/lib/convenient_service/support/never_reach_here.rb +21 -0
- data/lib/convenient_service/support/unique_value.rb +3 -0
- data/lib/convenient_service/support/value.rb +78 -0
- data/lib/convenient_service/support.rb +4 -0
- data/lib/convenient_service/utils/array/exceptions.rb +2 -2
- data/lib/convenient_service/utils/array/find_last.rb +8 -3
- data/lib/convenient_service/utils/array/merge.rb +1 -1
- data/lib/convenient_service/utils/hash/assert_valid_keys.rb +1 -1
- data/lib/convenient_service/utils/object/instance_variable_delete.rb +1 -1
- data/lib/convenient_service/version.rb +1 -1
- data/lib/convenient_service.rb +121 -0
- metadata +129 -347
- data/.dev/.tmuxinator.yml +0 -22
- data/.dockerignore +0 -1
- data/.gem_release.yml +0 -11
- data/.github/contributing.md +0 -15
- data/.github/issue_template.md +0 -35
- data/.github/pull_request_template.md +0 -31
- data/.github/workflows/cd.yml +0 -68
- data/.github/workflows/ci.yml +0 -212
- data/.gitignore +0 -66
- data/.inch.yml +0 -7
- data/.rspec +0 -3
- data/.rubocop.yml +0 -45
- data/.rubocop_rspec.yml +0 -58
- data/.ruby-version +0 -1
- data/.tool-versions +0 -1
- data/.vscode/CacheItsValue.code-snippets +0 -15
- data/.vscode/DelegateTo.code-snippets +0 -15
- data/.vscode/cache_its_value.code-snippets +0 -17
- data/.vscode/comparison.code-snippets +0 -41
- data/.vscode/delegate_to.code-snippets +0 -20
- data/.yardopts +0 -16
- data/Appraisals +0 -146
- data/CHANGELOG.md +0 -474
- data/Gemfile +0 -17
- data/ROADMAP.md +0 -92
- data/Rakefile +0 -54
- data/Taskfile.yml +0 -679
- data/benchmark/commit_config/ips.rb +0 -18
- data/benchmark/commit_config/profile.rb +0 -30
- data/benchmark/empty_service/ips.rb +0 -123
- data/benchmark/has_committed_config/ips.rb +0 -78
- data/benchmark/has_committed_config/profile.rb +0 -30
- data/convenient_service.gemspec +0 -214
- data/coverage/.gitkeep +0 -0
- data/docker/2.7/Dockerfile +0 -73
- data/docker/3.0/Dockerfile +0 -73
- data/docker/3.1/Dockerfile +0 -73
- data/docker/3.2/Dockerfile +0 -73
- data/docker/jruby-9.4/Dockerfile +0 -88
- data/docker/truffleruby-22.3/Dockerfile +0 -91
- data/docs/.gitkeep +0 -0
- data/docs/api/.gitkeep +0 -0
- data/env.rb +0 -23
- data/gemfiles/.gitkeep +0 -0
- data/lib/convenient_service/common/plugins/has_callbacks/container.rb +0 -17
- data/lib/convenient_service/examples/dry/gemfile/dry_service/config.rb +0 -45
- data/lib/convenient_service/examples/dry/gemfile/dry_service.rb +0 -3
- data/lib/convenient_service/examples/dry/gemfile/services/assert_file_exists.rb +0 -29
- data/lib/convenient_service/examples/dry/gemfile/services/assert_file_not_empty.rb +0 -29
- data/lib/convenient_service/examples/dry/gemfile/services/assert_node_available.rb +0 -26
- data/lib/convenient_service/examples/dry/gemfile/services/assert_npm_package_available.rb +0 -39
- data/lib/convenient_service/examples/dry/gemfile/services/assert_valid_ruby_syntax.rb +0 -41
- data/lib/convenient_service/examples/dry/gemfile/services/format.rb +0 -37
- data/lib/convenient_service/examples/dry/gemfile/services/format_body.rb +0 -93
- data/lib/convenient_service/examples/dry/gemfile/services/format_gems_with_envs.rb +0 -96
- data/lib/convenient_service/examples/dry/gemfile/services/format_gems_without_envs.rb +0 -84
- data/lib/convenient_service/examples/dry/gemfile/services/format_header.rb +0 -74
- data/lib/convenient_service/examples/dry/gemfile/services/parse_content.rb +0 -93
- data/lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb +0 -44
- data/lib/convenient_service/examples/dry/gemfile/services/read_file_content.rb +0 -31
- data/lib/convenient_service/examples/dry/gemfile/services/run_shell_command.rb +0 -45
- data/lib/convenient_service/examples/dry/gemfile/services/strip_comments.rb +0 -109
- data/lib/convenient_service/examples/dry/gemfile/services.rb +0 -18
- data/lib/convenient_service/examples/dry/gemfile.rb +0 -27
- data/lib/convenient_service/examples/dry/v1/gemfile/dry_service/config.rb +0 -47
- data/lib/convenient_service/examples/dry/v1/gemfile/dry_service.rb +0 -3
- data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_exists.rb +0 -31
- data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_not_empty.rb +0 -31
- data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_node_available.rb +0 -28
- data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_npm_package_available.rb +0 -41
- data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_valid_ruby_syntax.rb +0 -43
- data/lib/convenient_service/examples/dry/v1/gemfile/services/format.rb +0 -39
- data/lib/convenient_service/examples/dry/v1/gemfile/services/format_body.rb +0 -95
- data/lib/convenient_service/examples/dry/v1/gemfile/services/format_gems_with_envs.rb +0 -98
- data/lib/convenient_service/examples/dry/v1/gemfile/services/format_gems_without_envs.rb +0 -86
- data/lib/convenient_service/examples/dry/v1/gemfile/services/format_header.rb +0 -76
- data/lib/convenient_service/examples/dry/v1/gemfile/services/parse_content.rb +0 -95
- data/lib/convenient_service/examples/dry/v1/gemfile/services/read_file_content.rb +0 -33
- data/lib/convenient_service/examples/dry/v1/gemfile/services/run_shell_command.rb +0 -43
- data/lib/convenient_service/examples/dry/v1/gemfile/services/strip_comments.rb +0 -111
- data/lib/convenient_service/examples/dry/v1/gemfile/services.rb +0 -17
- data/lib/convenient_service/examples/dry/v1/gemfile.rb +0 -29
- data/lib/convenient_service/examples/rails/gemfile/rails_service/config.rb +0 -56
- data/lib/convenient_service/examples/rails/gemfile/rails_service.rb +0 -3
- data/lib/convenient_service/examples/rails/gemfile/services/assert_file_exists.rb +0 -25
- data/lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb +0 -25
- data/lib/convenient_service/examples/rails/gemfile/services/assert_node_available.rb +0 -26
- data/lib/convenient_service/examples/rails/gemfile/services/assert_npm_package_available.rb +0 -35
- data/lib/convenient_service/examples/rails/gemfile/services/assert_valid_ruby_syntax.rb +0 -35
- data/lib/convenient_service/examples/rails/gemfile/services/format.rb +0 -66
- data/lib/convenient_service/examples/rails/gemfile/services/format_body.rb +0 -79
- data/lib/convenient_service/examples/rails/gemfile/services/format_gems_with_envs.rb +0 -82
- data/lib/convenient_service/examples/rails/gemfile/services/format_gems_without_envs.rb +0 -70
- data/lib/convenient_service/examples/rails/gemfile/services/format_header.rb +0 -68
- data/lib/convenient_service/examples/rails/gemfile/services/merge_sections.rb +0 -25
- data/lib/convenient_service/examples/rails/gemfile/services/parse_content.rb +0 -89
- data/lib/convenient_service/examples/rails/gemfile/services/print_shell_command.rb +0 -40
- data/lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb +0 -27
- data/lib/convenient_service/examples/rails/gemfile/services/replace_file_content.rb +0 -37
- data/lib/convenient_service/examples/rails/gemfile/services/run_shell_command.rb +0 -40
- data/lib/convenient_service/examples/rails/gemfile/services/strip_comments.rb +0 -107
- data/lib/convenient_service/examples/rails/gemfile/services.rb +0 -21
- data/lib/convenient_service/examples/rails/gemfile.rb +0 -27
- data/lib/convenient_service/examples/rails/v1/gemfile/rails_service/config.rb +0 -58
- data/lib/convenient_service/examples/rails/v1/gemfile/rails_service.rb +0 -3
- data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_file_exists.rb +0 -27
- data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_file_not_empty.rb +0 -27
- data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_node_available.rb +0 -28
- data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_npm_package_available.rb +0 -37
- data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_valid_ruby_syntax.rb +0 -37
- data/lib/convenient_service/examples/rails/v1/gemfile/services/format.rb +0 -68
- data/lib/convenient_service/examples/rails/v1/gemfile/services/format_body.rb +0 -81
- data/lib/convenient_service/examples/rails/v1/gemfile/services/format_gems_with_envs.rb +0 -84
- data/lib/convenient_service/examples/rails/v1/gemfile/services/format_gems_without_envs.rb +0 -72
- data/lib/convenient_service/examples/rails/v1/gemfile/services/format_header.rb +0 -70
- data/lib/convenient_service/examples/rails/v1/gemfile/services/merge_sections.rb +0 -27
- data/lib/convenient_service/examples/rails/v1/gemfile/services/parse_content.rb +0 -91
- data/lib/convenient_service/examples/rails/v1/gemfile/services/read_file_content.rb +0 -29
- data/lib/convenient_service/examples/rails/v1/gemfile/services/replace_file_content.rb +0 -39
- data/lib/convenient_service/examples/rails/v1/gemfile/services/run_shell_command.rb +0 -38
- data/lib/convenient_service/examples/rails/v1/gemfile/services/strip_comments.rb +0 -109
- data/lib/convenient_service/examples/rails/v1/gemfile/services.rb +0 -20
- data/lib/convenient_service/examples/rails/v1/gemfile.rb +0 -29
- data/lib/convenient_service/examples/standard/cowsay/services/build_cloud.rb +0 -42
- data/lib/convenient_service/examples/standard/cowsay/services/build_cow.rb +0 -38
- data/lib/convenient_service/examples/standard/cowsay/services/print.rb +0 -32
- data/lib/convenient_service/examples/standard/cowsay/services.rb +0 -5
- data/lib/convenient_service/examples/standard/cowsay.rb +0 -26
- data/lib/convenient_service/examples/standard/date_time/services/safe_parse.rb +0 -31
- data/lib/convenient_service/examples/standard/date_time/services.rb +0 -3
- data/lib/convenient_service/examples/standard/date_time.rb +0 -25
- data/lib/convenient_service/examples/standard/factorial/services/calculate.rb +0 -55
- data/lib/convenient_service/examples/standard/factorial/services.rb +0 -3
- data/lib/convenient_service/examples/standard/factorial/utils/timeout/with_timeout.rb +0 -50
- data/lib/convenient_service/examples/standard/factorial/utils/timeout.rb +0 -21
- data/lib/convenient_service/examples/standard/factorial/utils.rb +0 -3
- data/lib/convenient_service/examples/standard/factorial.rb +0 -26
- data/lib/convenient_service/examples/standard/gemfile/services/assert_file_exists.rb +0 -30
- data/lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb +0 -30
- data/lib/convenient_service/examples/standard/gemfile/services/assert_node_available.rb +0 -26
- data/lib/convenient_service/examples/standard/gemfile/services/assert_npm_package_available.rb +0 -48
- data/lib/convenient_service/examples/standard/gemfile/services/assert_valid_ruby_syntax.rb +0 -39
- data/lib/convenient_service/examples/standard/gemfile/services/format.rb +0 -80
- data/lib/convenient_service/examples/standard/gemfile/services/format_body.rb +0 -83
- data/lib/convenient_service/examples/standard/gemfile/services/format_gems_with_envs.rb +0 -86
- data/lib/convenient_service/examples/standard/gemfile/services/format_gems_without_envs.rb +0 -74
- data/lib/convenient_service/examples/standard/gemfile/services/format_header.rb +0 -66
- data/lib/convenient_service/examples/standard/gemfile/services/merge_sections.rb +0 -52
- data/lib/convenient_service/examples/standard/gemfile/services/parse_content.rb +0 -101
- data/lib/convenient_service/examples/standard/gemfile/services/print_shell_command.rb +0 -45
- data/lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb +0 -39
- data/lib/convenient_service/examples/standard/gemfile/services/replace_file_content.rb +0 -48
- data/lib/convenient_service/examples/standard/gemfile/services/run_shell_command.rb +0 -54
- data/lib/convenient_service/examples/standard/gemfile/services/strip_comments.rb +0 -111
- data/lib/convenient_service/examples/standard/gemfile/services.rb +0 -21
- data/lib/convenient_service/examples/standard/gemfile.rb +0 -26
- data/lib/convenient_service/examples/standard/request_params/constants.rb +0 -15
- data/lib/convenient_service/examples/standard/request_params/entities/description.rb +0 -40
- data/lib/convenient_service/examples/standard/request_params/entities/format.rb +0 -40
- data/lib/convenient_service/examples/standard/request_params/entities/id.rb +0 -47
- data/lib/convenient_service/examples/standard/request_params/entities/logger.rb +0 -21
- data/lib/convenient_service/examples/standard/request_params/entities/request.rb +0 -23
- data/lib/convenient_service/examples/standard/request_params/entities/source.rb +0 -40
- data/lib/convenient_service/examples/standard/request_params/entities/tag.rb +0 -40
- data/lib/convenient_service/examples/standard/request_params/entities/title.rb +0 -40
- data/lib/convenient_service/examples/standard/request_params/entities.rb +0 -11
- data/lib/convenient_service/examples/standard/request_params/services/apply_default_param_values.rb +0 -26
- data/lib/convenient_service/examples/standard/request_params/services/cast_params.rb +0 -38
- data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_body.rb +0 -70
- data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_path.rb +0 -62
- data/lib/convenient_service/examples/standard/request_params/services/filter_out_unpermitted_params.rb +0 -26
- data/lib/convenient_service/examples/standard/request_params/services/log_request_params.rb +0 -54
- data/lib/convenient_service/examples/standard/request_params/services/merge_params.rb +0 -26
- data/lib/convenient_service/examples/standard/request_params/services/prepare.rb +0 -65
- data/lib/convenient_service/examples/standard/request_params/services/validate_casted_params.rb +0 -94
- data/lib/convenient_service/examples/standard/request_params/services/validate_uncasted_params.rb +0 -72
- data/lib/convenient_service/examples/standard/request_params/services.rb +0 -13
- data/lib/convenient_service/examples/standard/request_params/utils/array/wrap.rb +0 -46
- data/lib/convenient_service/examples/standard/request_params/utils/array.rb +0 -21
- data/lib/convenient_service/examples/standard/request_params/utils/http/request/parse_body.rb +0 -42
- data/lib/convenient_service/examples/standard/request_params/utils/http/request/parse_path.rb +0 -40
- data/lib/convenient_service/examples/standard/request_params/utils/http/request.rb +0 -28
- data/lib/convenient_service/examples/standard/request_params/utils/http.rb +0 -3
- data/lib/convenient_service/examples/standard/request_params/utils/integer/safe_parse.rb +0 -31
- data/lib/convenient_service/examples/standard/request_params/utils/integer.rb +0 -25
- data/lib/convenient_service/examples/standard/request_params/utils/json/safe_parse.rb +0 -40
- data/lib/convenient_service/examples/standard/request_params/utils/json.rb +0 -21
- data/lib/convenient_service/examples/standard/request_params/utils/object/blank.rb +0 -34
- data/lib/convenient_service/examples/standard/request_params/utils/object/present.rb +0 -31
- data/lib/convenient_service/examples/standard/request_params/utils/object.rb +0 -26
- data/lib/convenient_service/examples/standard/request_params/utils/url/valid.rb +0 -47
- data/lib/convenient_service/examples/standard/request_params/utils/url.rb +0 -21
- data/lib/convenient_service/examples/standard/request_params/utils.rb +0 -8
- data/lib/convenient_service/examples/standard/request_params.rb +0 -50
- data/lib/convenient_service/examples/standard/v1/cowsay/services/build_cloud.rb +0 -44
- data/lib/convenient_service/examples/standard/v1/cowsay/services/build_cow.rb +0 -40
- data/lib/convenient_service/examples/standard/v1/cowsay/services/print.rb +0 -34
- data/lib/convenient_service/examples/standard/v1/cowsay/services.rb +0 -5
- data/lib/convenient_service/examples/standard/v1/cowsay.rb +0 -26
- data/lib/convenient_service/examples/standard/v1/date_time/services/safe_parse.rb +0 -33
- data/lib/convenient_service/examples/standard/v1/date_time/services.rb +0 -3
- data/lib/convenient_service/examples/standard/v1/date_time.rb +0 -25
- data/lib/convenient_service/examples/standard/v1/factorial/services/calculate.rb +0 -51
- data/lib/convenient_service/examples/standard/v1/factorial/services.rb +0 -3
- data/lib/convenient_service/examples/standard/v1/factorial/utils/timeout/with_timeout.rb +0 -52
- data/lib/convenient_service/examples/standard/v1/factorial/utils/timeout.rb +0 -23
- data/lib/convenient_service/examples/standard/v1/factorial/utils.rb +0 -3
- data/lib/convenient_service/examples/standard/v1/factorial.rb +0 -26
- data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_file_exists.rb +0 -32
- data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_file_not_empty.rb +0 -32
- data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_node_available.rb +0 -28
- data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_npm_package_available.rb +0 -50
- data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_valid_ruby_syntax.rb +0 -41
- data/lib/convenient_service/examples/standard/v1/gemfile/services/format.rb +0 -82
- data/lib/convenient_service/examples/standard/v1/gemfile/services/format_body.rb +0 -85
- data/lib/convenient_service/examples/standard/v1/gemfile/services/format_gems_with_envs.rb +0 -88
- data/lib/convenient_service/examples/standard/v1/gemfile/services/format_gems_without_envs.rb +0 -76
- data/lib/convenient_service/examples/standard/v1/gemfile/services/format_header.rb +0 -68
- data/lib/convenient_service/examples/standard/v1/gemfile/services/merge_sections.rb +0 -54
- data/lib/convenient_service/examples/standard/v1/gemfile/services/parse_content.rb +0 -103
- data/lib/convenient_service/examples/standard/v1/gemfile/services/print_shell_command.rb +0 -47
- data/lib/convenient_service/examples/standard/v1/gemfile/services/read_file_content.rb +0 -41
- data/lib/convenient_service/examples/standard/v1/gemfile/services/replace_file_content.rb +0 -50
- data/lib/convenient_service/examples/standard/v1/gemfile/services/run_shell_command.rb +0 -52
- data/lib/convenient_service/examples/standard/v1/gemfile/services/strip_comments.rb +0 -113
- data/lib/convenient_service/examples/standard/v1/gemfile/services.rb +0 -20
- data/lib/convenient_service/examples/standard/v1/gemfile.rb +0 -26
- data/lib/convenient_service/examples/standard/v1/request_params/constants.rb +0 -17
- data/lib/convenient_service/examples/standard/v1/request_params/entities/description.rb +0 -42
- data/lib/convenient_service/examples/standard/v1/request_params/entities/format.rb +0 -42
- data/lib/convenient_service/examples/standard/v1/request_params/entities/id.rb +0 -49
- data/lib/convenient_service/examples/standard/v1/request_params/entities/logger.rb +0 -23
- data/lib/convenient_service/examples/standard/v1/request_params/entities/request.rb +0 -25
- data/lib/convenient_service/examples/standard/v1/request_params/entities/source.rb +0 -42
- data/lib/convenient_service/examples/standard/v1/request_params/entities/tag.rb +0 -42
- data/lib/convenient_service/examples/standard/v1/request_params/entities/title.rb +0 -42
- data/lib/convenient_service/examples/standard/v1/request_params/entities.rb +0 -11
- data/lib/convenient_service/examples/standard/v1/request_params/services/apply_default_param_values.rb +0 -28
- data/lib/convenient_service/examples/standard/v1/request_params/services/cast_params.rb +0 -40
- data/lib/convenient_service/examples/standard/v1/request_params/services/extract_params_from_body.rb +0 -72
- data/lib/convenient_service/examples/standard/v1/request_params/services/extract_params_from_path.rb +0 -64
- data/lib/convenient_service/examples/standard/v1/request_params/services/filter_out_unpermitted_params.rb +0 -28
- data/lib/convenient_service/examples/standard/v1/request_params/services/log_request_params.rb +0 -56
- data/lib/convenient_service/examples/standard/v1/request_params/services/merge_params.rb +0 -28
- data/lib/convenient_service/examples/standard/v1/request_params/services/prepare.rb +0 -67
- data/lib/convenient_service/examples/standard/v1/request_params/services/validate_casted_params.rb +0 -96
- data/lib/convenient_service/examples/standard/v1/request_params/services/validate_uncasted_params.rb +0 -74
- data/lib/convenient_service/examples/standard/v1/request_params/services.rb +0 -13
- data/lib/convenient_service/examples/standard/v1/request_params/utils/array/wrap.rb +0 -48
- data/lib/convenient_service/examples/standard/v1/request_params/utils/array.rb +0 -23
- data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_body.rb +0 -44
- data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_path.rb +0 -42
- data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request.rb +0 -30
- data/lib/convenient_service/examples/standard/v1/request_params/utils/http.rb +0 -3
- data/lib/convenient_service/examples/standard/v1/request_params/utils/integer/safe_parse.rb +0 -33
- data/lib/convenient_service/examples/standard/v1/request_params/utils/integer.rb +0 -27
- data/lib/convenient_service/examples/standard/v1/request_params/utils/json/safe_parse.rb +0 -42
- data/lib/convenient_service/examples/standard/v1/request_params/utils/json.rb +0 -23
- data/lib/convenient_service/examples/standard/v1/request_params/utils/object/blank.rb +0 -36
- data/lib/convenient_service/examples/standard/v1/request_params/utils/object/present.rb +0 -33
- data/lib/convenient_service/examples/standard/v1/request_params/utils/object.rb +0 -28
- data/lib/convenient_service/examples/standard/v1/request_params/utils/url/valid.rb +0 -49
- data/lib/convenient_service/examples/standard/v1/request_params/utils/url.rb +0 -23
- data/lib/convenient_service/examples/standard/v1/request_params/utils.rb +0 -8
- data/lib/convenient_service/examples/standard/v1/request_params.rb +0 -50
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/commands/generate_printable_method.rb +0 -50
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands/apply_stub_to_track_delegations.rb +0 -78
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands/generate_printable_arguments.rb +0 -100
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments.rb +0 -95
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/base.rb +0 -87
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/return_its_value.rb +0 -132
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_any_arguments.rb +0 -37
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_concrete_arguments.rb +0 -37
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/without_arguments.rb +0 -37
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/values/base.rb +0 -41
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/values/with_calling_original.rb +0 -30
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/values/without_calling_original.rb +0 -30
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings.rb +0 -12
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings_collection/exceptions.rb +0 -57
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings_collection.rb +0 -171
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/delegation.rb +0 -79
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities.rb +0 -5
- data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher.rb +0 -276
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/reassignment/commands/define_method_in_container.rb +0 -74
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/reassignment/commands.rb +0 -3
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed/middleware.rb +0 -72
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed.rb +0 -4
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step.rb +0 -5
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status/middleware.rb +0 -43
- data/lib/convenient_service/service/plugins/has_j_send_result/exceptions.rb +0 -21
- data/logo.png +0 -0
- data/minitest.rb +0 -30
- data/yard/yard-convenient_service_concern.rb +0 -45
- /data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/{entities/matcher/commands.rb → commands.rb} +0 -0
- /data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/{matcher/entities/chainings/sub_matchers → sub_matchers}/arguments/commands.rb +0 -0
@@ -3,11 +3,21 @@
|
|
3
3
|
module ConvenientService
|
4
4
|
module Service
|
5
5
|
module Plugins
|
6
|
-
module
|
6
|
+
module CanHaveSequentialSteps
|
7
7
|
module Entities
|
8
8
|
class StepCollection
|
9
9
|
include ::Enumerable
|
10
10
|
|
11
|
+
include Support::Copyable
|
12
|
+
|
13
|
+
##
|
14
|
+
# @api private
|
15
|
+
#
|
16
|
+
# @!attribute [r] container
|
17
|
+
# @return [ConvenientService::Service]
|
18
|
+
#
|
19
|
+
attr_reader :container
|
20
|
+
|
11
21
|
##
|
12
22
|
# @api private
|
13
23
|
#
|
@@ -19,13 +29,35 @@ module ConvenientService
|
|
19
29
|
##
|
20
30
|
# @api private
|
21
31
|
#
|
32
|
+
# @param container [ConvenientService::Service]
|
22
33
|
# @param steps [Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step>]
|
23
34
|
# @return [void]
|
24
35
|
#
|
25
|
-
def initialize(steps: [])
|
36
|
+
def initialize(container:, steps: [])
|
37
|
+
@container = container
|
26
38
|
@steps = steps
|
27
39
|
end
|
28
40
|
|
41
|
+
##
|
42
|
+
# @api private
|
43
|
+
#
|
44
|
+
# @param args [Array<Object>]
|
45
|
+
# @param kwargs [Hash{Symbol => Object}]
|
46
|
+
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
|
47
|
+
#
|
48
|
+
def create(*args, **kwargs)
|
49
|
+
step_class.new(*args, **kwargs.merge(container: container, index: next_available_index))
|
50
|
+
.tap { |step| steps << step }
|
51
|
+
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# @param organizer [ConvenientService::Service]
|
55
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::StepCollection]
|
56
|
+
#
|
57
|
+
def with_organizer(organizer)
|
58
|
+
copy(overrides: {kwargs: {steps: steps.map { |step| step.with_organizer(organizer) }}})
|
59
|
+
end
|
60
|
+
|
29
61
|
##
|
30
62
|
# @api public
|
31
63
|
#
|
@@ -43,6 +75,8 @@ module ConvenientService
|
|
43
75
|
|
44
76
|
steps.each(&:define!).freeze
|
45
77
|
|
78
|
+
freeze
|
79
|
+
|
46
80
|
true
|
47
81
|
end
|
48
82
|
|
@@ -81,15 +115,10 @@ module ConvenientService
|
|
81
115
|
end
|
82
116
|
|
83
117
|
##
|
84
|
-
# @
|
118
|
+
# @return [String]
|
85
119
|
#
|
86
|
-
|
87
|
-
|
88
|
-
#
|
89
|
-
def <<(step)
|
90
|
-
steps << step.copy(overrides: {kwargs: {index: next_available_index}})
|
91
|
-
|
92
|
-
self
|
120
|
+
def inspect
|
121
|
+
steps.inspect
|
93
122
|
end
|
94
123
|
|
95
124
|
##
|
@@ -101,11 +130,19 @@ module ConvenientService
|
|
101
130
|
def ==(other)
|
102
131
|
return unless other.instance_of?(self.class)
|
103
132
|
|
133
|
+
return false if container != other.container
|
104
134
|
return false if steps != other.steps
|
105
135
|
|
106
136
|
true
|
107
137
|
end
|
108
138
|
|
139
|
+
##
|
140
|
+
# @return [ConvenientService::Support::Arguments]
|
141
|
+
#
|
142
|
+
def to_arguments
|
143
|
+
Support::Arguments.new(container: container, steps: steps)
|
144
|
+
end
|
145
|
+
|
109
146
|
private
|
110
147
|
|
111
148
|
##
|
@@ -114,6 +151,13 @@ module ConvenientService
|
|
114
151
|
def next_available_index
|
115
152
|
steps.size
|
116
153
|
end
|
154
|
+
|
155
|
+
##
|
156
|
+
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
|
157
|
+
#
|
158
|
+
def step_class
|
159
|
+
container.step_class
|
160
|
+
end
|
117
161
|
end
|
118
162
|
end
|
119
163
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module ConvenientService
|
4
4
|
module Service
|
5
5
|
module Plugins
|
6
|
-
module
|
6
|
+
module CanHaveSequentialSteps
|
7
7
|
class Middleware < MethodChainMiddleware
|
8
8
|
intended_for :result, entity: :service
|
9
9
|
|
@@ -50,7 +50,8 @@ module ConvenientService
|
|
50
50
|
#
|
51
51
|
def find_first_not_successful_step_with_side_effects_during_lookup
|
52
52
|
entity.steps.find do |step|
|
53
|
-
step.
|
53
|
+
step.status.unsafe_not_success?
|
54
|
+
.tap { step.save_outputs_in_organizer! }
|
54
55
|
.tap { step.mark_as_completed! }
|
55
56
|
.tap { step.trigger_callback }
|
56
57
|
end
|
@@ -59,8 +60,11 @@ module ConvenientService
|
|
59
60
|
##
|
60
61
|
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
|
61
62
|
#
|
63
|
+
# @internal
|
64
|
+
# NOTE: Custom `Enumerable` objects do NOT implement the `last` method. It is available for `Array` instances.
|
65
|
+
#
|
62
66
|
def just_take_last_step_since_all_steps_are_successful
|
63
|
-
entity.steps
|
67
|
+
entity.steps[-1]
|
64
68
|
end
|
65
69
|
end
|
66
70
|
end
|
@@ -7,62 +7,12 @@ module ConvenientService
|
|
7
7
|
module Concern
|
8
8
|
include Support::Concern
|
9
9
|
|
10
|
-
instance_methods do
|
11
|
-
##
|
12
|
-
# @api public
|
13
|
-
#
|
14
|
-
# @note May be useful for debugging purposes.
|
15
|
-
# @see https://marian13.github.io/convenient_service_docs/guides/how_to_debug_services_via_callbacks
|
16
|
-
#
|
17
|
-
# @note `steps` are frozen.
|
18
|
-
# @see https://marian13.github.io/convenient_service_docs/faq#is-it-possible-to-modify-the-step-collection-from-a-callback
|
19
|
-
#
|
20
|
-
# @return [Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step>]
|
21
|
-
#
|
22
|
-
# @internal
|
23
|
-
# IMPORTANT: `map` result is NOT wrapped by `StepCollection` in order to NOT expose too much internals to the end-user.
|
24
|
-
#
|
25
|
-
def steps
|
26
|
-
internals.cache.fetch(:steps) do
|
27
|
-
self.class
|
28
|
-
.steps
|
29
|
-
.tap(&:commit!)
|
30
|
-
.map { |step| step.copy(overrides: {kwargs: {organizer: self}}) }
|
31
|
-
.freeze
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
##
|
36
|
-
# Returns step by index.
|
37
|
-
# Returns `nil` when index is out of range.
|
38
|
-
#
|
39
|
-
# @param index [Integer]
|
40
|
-
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
|
41
|
-
#
|
42
|
-
# @note This method was initially designed as a hook (callback trigger).
|
43
|
-
# @see ConvenientService::Service::Plugins::CanHaveSteps::Middleware#next
|
44
|
-
#
|
45
|
-
def step(index)
|
46
|
-
steps[index]
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
10
|
class_methods do
|
51
11
|
##
|
52
|
-
#
|
53
|
-
#
|
54
|
-
# @param args [Array<Object>]
|
55
|
-
# @param kwargs [Hash{Symbol => Object}]
|
56
|
-
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
|
12
|
+
# @api public
|
57
13
|
#
|
58
|
-
def step(*args, **kwargs)
|
59
|
-
step_class.new(*args, **kwargs.merge(container: self))
|
60
|
-
.tap { |step_instance| steps << step_instance }
|
61
|
-
end
|
62
|
-
|
63
|
-
##
|
64
14
|
# Allows to pass a value to `in` method without its intermediate processing.
|
65
|
-
# @see https://
|
15
|
+
# @see https://userdocs.convenientservice.org/basics/step_to_result_translation_table
|
66
16
|
#
|
67
17
|
# @example `:chat_v2` is passed to `AssertFeatureEnabled` as it is.
|
68
18
|
# step AssertFeatureEnabled, in: {name: raw(:chat_v2)}
|
@@ -77,6 +27,8 @@ module ConvenientService
|
|
77
27
|
end
|
78
28
|
|
79
29
|
##
|
30
|
+
# @api public
|
31
|
+
#
|
80
32
|
# @param method_name [String, Symbol]
|
81
33
|
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Entities::Values::Reassignment]
|
82
34
|
#
|
@@ -85,13 +37,8 @@ module ConvenientService
|
|
85
37
|
end
|
86
38
|
|
87
39
|
##
|
88
|
-
# @
|
40
|
+
# @api private
|
89
41
|
#
|
90
|
-
def steps
|
91
|
-
@steps ||= Entities::StepCollection.new
|
92
|
-
end
|
93
|
-
|
94
|
-
##
|
95
42
|
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
|
96
43
|
#
|
97
44
|
def step_class
|
@@ -10,48 +10,67 @@ module ConvenientService
|
|
10
10
|
class DefineMethodInContainer < Support::Command
|
11
11
|
include Support::Delegate
|
12
12
|
|
13
|
-
|
13
|
+
##
|
14
|
+
# @!attribute [r] method
|
15
|
+
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method]
|
16
|
+
#
|
17
|
+
attr_reader :method
|
14
18
|
|
15
|
-
|
19
|
+
##
|
20
|
+
# @!attribute [r] container
|
21
|
+
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
22
|
+
#
|
23
|
+
attr_reader :container
|
16
24
|
|
25
|
+
##
|
26
|
+
# @!attribute [r] index
|
27
|
+
# @return [Integer]
|
28
|
+
#
|
29
|
+
attr_reader :index
|
30
|
+
|
31
|
+
##
|
32
|
+
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Entities::Key]
|
33
|
+
#
|
34
|
+
delegate :key, to: :method
|
35
|
+
|
36
|
+
##
|
37
|
+
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Entities::Name]
|
38
|
+
#
|
39
|
+
delegate :name, to: :method
|
40
|
+
|
41
|
+
##
|
42
|
+
# @param method [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method]
|
43
|
+
# @param container [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
44
|
+
# @param index [Integer]
|
45
|
+
# @return [void]
|
46
|
+
#
|
17
47
|
def initialize(method:, container:, index:)
|
18
48
|
@method = method
|
19
49
|
@container = container
|
20
50
|
@index = index
|
21
51
|
end
|
22
52
|
|
53
|
+
##
|
54
|
+
# @return [Boolean]
|
55
|
+
#
|
56
|
+
# @internal
|
57
|
+
# IMPORTANT: Do NOT depend on `index` inside generated method. It breaks reassignments.
|
58
|
+
#
|
23
59
|
def call
|
24
|
-
##
|
25
|
-
# NOTE: Assignement in the beginning for easier debugging.
|
26
|
-
#
|
27
60
|
<<~RUBY.tap { |code| container.klass.class_eval(code, __FILE__, __LINE__ + 1) }
|
61
|
+
##
|
62
|
+
# @return [Object] Can be any type.
|
63
|
+
# @raise [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Exceptions::OutMethodStepIsNotCompleted]
|
64
|
+
#
|
28
65
|
def #{name}
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
raise #{not_existing_step_result_data_attribute_error}.new(step: step, key: key) unless step.result.unsafe_data.has_attribute?(key)
|
34
|
-
|
35
|
-
step.result.unsafe_data[key]
|
66
|
+
internals.cache.scope(:step_output_values).fetch(__method__) do
|
67
|
+
::ConvenientService.raise ::ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Exceptions::OutMethodStepIsNotCompleted.new(method_name: __method__)
|
68
|
+
end
|
36
69
|
end
|
37
70
|
RUBY
|
38
71
|
|
39
72
|
true
|
40
73
|
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
def not_completed_step_error
|
45
|
-
<<~RUBY.chomp
|
46
|
-
::ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Exceptions::NotCompletedStep
|
47
|
-
RUBY
|
48
|
-
end
|
49
|
-
|
50
|
-
def not_existing_step_result_data_attribute_error
|
51
|
-
<<~RUBY.chomp
|
52
|
-
::ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Exceptions::NotExistingStepResultDataAttribute
|
53
|
-
RUBY
|
54
|
-
end
|
55
74
|
end
|
56
75
|
end
|
57
76
|
end
|
@@ -61,7 +61,7 @@ module ConvenientService
|
|
61
61
|
# @raise [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Exceptions::MethodHasNoOrganizer]
|
62
62
|
#
|
63
63
|
def organizer(raise_when_missing: true)
|
64
|
-
raise Exceptions::MethodHasNoOrganizer.new(method: self) if @organizer.nil? && raise_when_missing
|
64
|
+
::ConvenientService.raise Exceptions::MethodHasNoOrganizer.new(method: self) if @organizer.nil? && raise_when_missing
|
65
65
|
|
66
66
|
@organizer
|
67
67
|
end
|
data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/alias.rb
CHANGED
@@ -16,13 +16,13 @@ module ConvenientService
|
|
16
16
|
def validate_as_input_for_container!(container, method:)
|
17
17
|
return true if container.has_defined_method?(method)
|
18
18
|
|
19
|
-
raise Exceptions::AliasInputMethodIsNotDefinedInContainer.new(method: method, container: container)
|
19
|
+
::ConvenientService.raise Exceptions::AliasInputMethodIsNotDefinedInContainer.new(method: method, container: container)
|
20
20
|
end
|
21
21
|
|
22
22
|
def validate_as_output_for_container!(container, method:)
|
23
23
|
return true unless container.has_defined_method?(method)
|
24
24
|
|
25
|
-
raise Exceptions::AliasOutputMethodIsDefinedInContainer.new(method: method, container: container)
|
25
|
+
::ConvenientService.raise Exceptions::AliasOutputMethodIsDefinedInContainer.new(method: method, container: container)
|
26
26
|
end
|
27
27
|
|
28
28
|
def define_output_in_container!(container, index:, method:)
|
data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/proc.rb
CHANGED
@@ -21,7 +21,7 @@ module ConvenientService
|
|
21
21
|
##
|
22
22
|
# TODO: Better error message.
|
23
23
|
#
|
24
|
-
raise Exceptions::OutputMethodProc.new(method: method, container: container)
|
24
|
+
::ConvenientService.raise Exceptions::OutputMethodProc.new(method: method, container: container)
|
25
25
|
end
|
26
26
|
|
27
27
|
def define_output_in_container!(container, index:, method:)
|
data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/raw.rb
CHANGED
@@ -21,7 +21,7 @@ module ConvenientService
|
|
21
21
|
##
|
22
22
|
# TODO: Better error message.
|
23
23
|
#
|
24
|
-
raise Exceptions::OutputMethodRawValue.new(container: container, method: method)
|
24
|
+
::ConvenientService.raise Exceptions::OutputMethodRawValue.new(container: container, method: method)
|
25
25
|
end
|
26
26
|
|
27
27
|
def define_output_in_container!(container, index:, method:)
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "reassignment/commands"
|
4
|
-
|
5
3
|
module ConvenientService
|
6
4
|
module Service
|
7
5
|
module Plugins
|
@@ -22,11 +20,11 @@ module ConvenientService
|
|
22
20
|
# TODO: Separate `in` and `out` methods?
|
23
21
|
#
|
24
22
|
def calculate_value(method)
|
25
|
-
raise Exceptions::CallerCanNotCalculateReassignment.new(method: method)
|
23
|
+
::ConvenientService.raise Exceptions::CallerCanNotCalculateReassignment.new(method: method)
|
26
24
|
end
|
27
25
|
|
28
26
|
def validate_as_input_for_container!(container, method:)
|
29
|
-
raise Exceptions::InputMethodReassignment.new(method: method, container: container)
|
27
|
+
::ConvenientService.raise Exceptions::InputMethodReassignment.new(method: method, container: container)
|
30
28
|
end
|
31
29
|
|
32
30
|
def validate_as_output_for_container!(container, method:)
|
data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/usual.rb
CHANGED
@@ -16,13 +16,13 @@ module ConvenientService
|
|
16
16
|
def validate_as_input_for_container!(container, method:)
|
17
17
|
return true if container.has_defined_method?(method)
|
18
18
|
|
19
|
-
raise Exceptions::InputMethodIsNotDefinedInContainer.new(method: method, container: container)
|
19
|
+
::ConvenientService.raise Exceptions::InputMethodIsNotDefinedInContainer.new(method: method, container: container)
|
20
20
|
end
|
21
21
|
|
22
22
|
def validate_as_output_for_container!(container, method:)
|
23
23
|
return true unless container.has_defined_method?(method)
|
24
24
|
|
25
|
-
raise Exceptions::OutputMethodIsDefinedInContainer.new(method: method, container: container)
|
25
|
+
::ConvenientService.raise Exceptions::OutputMethodIsDefinedInContainer.new(method: method, container: container)
|
26
26
|
end
|
27
27
|
|
28
28
|
def define_output_in_container!(container, index:, method:)
|
@@ -14,11 +14,11 @@ module ConvenientService
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def validate_as_output_for_container!(container, method:)
|
17
|
-
raise Exceptions::MethodIsNotOutputMethod.new(method: method, container: container)
|
17
|
+
::ConvenientService.raise Exceptions::MethodIsNotOutputMethod.new(method: method, container: container)
|
18
18
|
end
|
19
19
|
|
20
20
|
def define_output_in_container!(container, index:, method:)
|
21
|
-
raise Exceptions::MethodIsNotOutputMethod.new(method: method, container: container)
|
21
|
+
::ConvenientService.raise Exceptions::MethodIsNotOutputMethod.new(method: method, container: container)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -10,7 +10,7 @@ module ConvenientService
|
|
10
10
|
module Directions
|
11
11
|
class Output < Base
|
12
12
|
def validate_as_input_for_container!(container, method:)
|
13
|
-
raise Exceptions::MethodIsNotInputMethod.new(method: method, container: container)
|
13
|
+
::ConvenientService.raise Exceptions::MethodIsNotInputMethod.new(method: method, container: container)
|
14
14
|
end
|
15
15
|
|
16
16
|
def validate_as_output_for_container!(container, method:)
|
@@ -15,14 +15,14 @@ module ConvenientService
|
|
15
15
|
# @internal
|
16
16
|
# TODO: Introduce `Method#step` for more verbose message?
|
17
17
|
#
|
18
|
-
def
|
18
|
+
def initialize_with_kwargs(method:)
|
19
19
|
message = <<~TEXT
|
20
20
|
Organizer for method `:#{method.name}` is NOT assigned yet.
|
21
21
|
|
22
22
|
Did you forget to set it?
|
23
23
|
TEXT
|
24
24
|
|
25
|
-
|
25
|
+
initialize(message)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -32,14 +32,14 @@ module ConvenientService
|
|
32
32
|
# @param container [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
33
33
|
# @return [void]
|
34
34
|
#
|
35
|
-
def
|
35
|
+
def initialize_with_kwargs(method:, container:)
|
36
36
|
message = <<~TEXT
|
37
37
|
`in` method `#{method.name}` is NOT defined in `#{container.klass}`.
|
38
38
|
|
39
39
|
Did you forget to define it?
|
40
40
|
TEXT
|
41
41
|
|
42
|
-
|
42
|
+
initialize(message)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -49,14 +49,14 @@ module ConvenientService
|
|
49
49
|
# @param container [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
50
50
|
# @return [void]
|
51
51
|
#
|
52
|
-
def
|
52
|
+
def initialize_with_kwargs(method:, container:)
|
53
53
|
message = <<~TEXT
|
54
54
|
`out` method `#{method.name}` is already defined in `#{container.klass}`.
|
55
55
|
|
56
56
|
Did you forget to remove it?
|
57
57
|
TEXT
|
58
58
|
|
59
|
-
|
59
|
+
initialize(message)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -66,14 +66,14 @@ module ConvenientService
|
|
66
66
|
# @param container [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
67
67
|
# @return [void]
|
68
68
|
#
|
69
|
-
def
|
69
|
+
def initialize_with_kwargs(method:, container:)
|
70
70
|
message = <<~TEXT
|
71
71
|
Alias `in` method `#{method.name}` is NOT defined in `#{container.klass}`.
|
72
72
|
|
73
73
|
Did you forget to define it?
|
74
74
|
TEXT
|
75
75
|
|
76
|
-
|
76
|
+
initialize(message)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
@@ -83,14 +83,14 @@ module ConvenientService
|
|
83
83
|
# @param container [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
84
84
|
# @return [void]
|
85
85
|
#
|
86
|
-
def
|
86
|
+
def initialize_with_kwargs(method:, container:)
|
87
87
|
message = <<~TEXT
|
88
88
|
Alias `out` method `#{method.name}` is already defined in `#{container.klass}`.
|
89
89
|
|
90
90
|
Did you forget to remove it?
|
91
91
|
TEXT
|
92
92
|
|
93
|
-
|
93
|
+
initialize(message)
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -100,12 +100,12 @@ module ConvenientService
|
|
100
100
|
# @param container [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
101
101
|
# @return [void]
|
102
102
|
#
|
103
|
-
def
|
103
|
+
def initialize_with_kwargs(method:, container:)
|
104
104
|
message = <<~TEXT
|
105
105
|
Procs are not allowed for `out` methods.
|
106
106
|
TEXT
|
107
107
|
|
108
|
-
|
108
|
+
initialize(message)
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
@@ -115,12 +115,12 @@ module ConvenientService
|
|
115
115
|
# @param container [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
116
116
|
# @return [void]
|
117
117
|
#
|
118
|
-
def
|
118
|
+
def initialize_with_kwargs(method:, container:)
|
119
119
|
message = <<~TEXT
|
120
120
|
Raw values are not allowed for `out` methods.
|
121
121
|
TEXT
|
122
122
|
|
123
|
-
|
123
|
+
initialize(message)
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
@@ -129,14 +129,14 @@ module ConvenientService
|
|
129
129
|
# @param method [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method]
|
130
130
|
# @return [void]
|
131
131
|
#
|
132
|
-
def
|
132
|
+
def initialize_with_kwargs(method:)
|
133
133
|
message = <<~TEXT
|
134
134
|
Method caller failed to calculate reassignment for `#{method.name}`.
|
135
135
|
|
136
136
|
Method callers can calculate only `in` methods, while reassignments are always `out` methods.
|
137
137
|
TEXT
|
138
138
|
|
139
|
-
|
139
|
+
initialize(message)
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
@@ -146,12 +146,12 @@ module ConvenientService
|
|
146
146
|
# @param container [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
147
147
|
# @return [void]
|
148
148
|
#
|
149
|
-
def
|
149
|
+
def initialize_with_kwargs(method:, container:)
|
150
150
|
message = <<~TEXT
|
151
151
|
Reassignments are not allowed for `in` methods.
|
152
152
|
TEXT
|
153
153
|
|
154
|
-
|
154
|
+
initialize(message)
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
@@ -161,12 +161,12 @@ module ConvenientService
|
|
161
161
|
# @param container [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
162
162
|
# @return [void]
|
163
163
|
#
|
164
|
-
def
|
164
|
+
def initialize_with_kwargs(method:, container:)
|
165
165
|
message = <<~TEXT
|
166
166
|
Method `#{method.name}` is NOT an `in` method.
|
167
167
|
TEXT
|
168
168
|
|
169
|
-
|
169
|
+
initialize(message)
|
170
170
|
end
|
171
171
|
end
|
172
172
|
|
@@ -176,48 +176,28 @@ module ConvenientService
|
|
176
176
|
# @param container [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service]
|
177
177
|
# @return [void]
|
178
178
|
#
|
179
|
-
def
|
179
|
+
def initialize_with_kwargs(method:, container:)
|
180
180
|
message = <<~TEXT
|
181
181
|
Method `#{method.name}` is NOT an `out` method.
|
182
182
|
TEXT
|
183
183
|
|
184
|
-
|
184
|
+
initialize(message)
|
185
185
|
end
|
186
186
|
end
|
187
187
|
|
188
|
-
class
|
188
|
+
class OutMethodStepIsNotCompleted < ::ConvenientService::Exception
|
189
189
|
##
|
190
190
|
# @param method_name [Symbol]
|
191
|
-
# @param step [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
|
192
191
|
# @return [void]
|
193
192
|
#
|
194
|
-
def
|
193
|
+
def initialize_with_kwargs(method_name:)
|
195
194
|
message = <<~TEXT
|
196
|
-
`out` method `#{method_name}` is called before its corresponding step
|
195
|
+
`out` method `#{method_name}` is called before its corresponding step is completed.
|
197
196
|
|
198
|
-
Maybe it makes sense to change
|
197
|
+
Maybe it makes sense to change steps order?
|
199
198
|
TEXT
|
200
199
|
|
201
|
-
|
202
|
-
end
|
203
|
-
end
|
204
|
-
|
205
|
-
class NotExistingStepResultDataAttribute < ::ConvenientService::Exception
|
206
|
-
##
|
207
|
-
# @param key [Symbol]
|
208
|
-
# @param step [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
|
209
|
-
# @return [void]
|
210
|
-
#
|
211
|
-
def initialize(key:, step:)
|
212
|
-
message = <<~TEXT
|
213
|
-
Step `#{step.printable_service}` result does NOT return `#{key}` data attribute.
|
214
|
-
|
215
|
-
Maybe there is a typo in `out` definition?
|
216
|
-
|
217
|
-
Or `success` of `#{step.printable_service}` accepts a wrong key?
|
218
|
-
TEXT
|
219
|
-
|
220
|
-
super(message)
|
200
|
+
initialize(message)
|
221
201
|
end
|
222
202
|
end
|
223
203
|
end
|