convenient_service 0.17.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -7
- data/lib/convenient_service/commands/is_service.rb +28 -0
- data/lib/convenient_service/commands/is_service_class.rb +30 -0
- data/lib/convenient_service/commands.rb +4 -0
- 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/middleware.rb +28 -7
- 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/entities/instance_proxy.rb +1 -1
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/has_cache/concern.rb +12 -0
- data/lib/convenient_service/common/plugins.rb +3 -3
- data/lib/convenient_service/core/concern/class_methods.rb +3 -0
- data/lib/convenient_service/core/entities/config/entities/concerns/entities/stack.rb +22 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/concern/instance_methods.rb +1 -1
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable/entities/event.rb +13 -15
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands/normalize_env.rb +55 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands.rb +1 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/instance_methods.rb +3 -3
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/classic.rb +14 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/stack.rb +22 -0
- data/lib/convenient_service/core/entities/config/exceptions.rb +2 -0
- data/lib/convenient_service/core/entities/config.rb +3 -0
- data/lib/convenient_service/dependencies/built_in.rb +0 -7
- data/lib/convenient_service/dependencies/extractions/ds.rb +45 -0
- data/lib/convenient_service/dependencies/only_queries.rb +29 -0
- data/lib/convenient_service/dependencies/queries/gems/active_model.rb +38 -0
- data/lib/convenient_service/dependencies/queries/gems/logger.rb +39 -0
- data/lib/convenient_service/dependencies/queries/gems/paint.rb +39 -0
- data/lib/convenient_service/dependencies/queries/gems/rspec.rb +60 -0
- data/lib/convenient_service/dependencies/queries/ruby.rb +103 -0
- data/lib/convenient_service/dependencies/queries/version/null_version.rb +87 -0
- data/lib/convenient_service/dependencies/queries/version.rb +87 -0
- data/lib/convenient_service/dependencies/queries.rb +536 -0
- data/lib/convenient_service/dependencies.rb +2 -430
- data/lib/convenient_service/feature/configs/standard.rb +0 -2
- data/lib/convenient_service/logger.rb +9 -1
- data/lib/convenient_service/rspec/matchers/classes/call_chain_next.rb +41 -0
- 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/amazing_print_inspect/aliases.rb +7 -0
- data/lib/convenient_service/service/configs/amazing_print_inspect.rb +61 -0
- data/lib/convenient_service/service/configs/awesome_print_inspect.rb +1 -1
- data/lib/convenient_service/service/configs/{minimal.rb → essential.rb} +40 -93
- data/lib/convenient_service/service/configs/standard/v1.rb +47 -34
- data/lib/convenient_service/service/configs/standard.rb +70 -68
- data/lib/convenient_service/service/configs.rb +1 -1
- 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 +136 -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 +224 -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 +18 -0
- data/lib/convenient_service/service/plugins/can_have_fallbacks/exceptions.rb +22 -4
- data/lib/convenient_service/service/plugins/can_have_fallbacks/middleware.rb +3 -3
- data/lib/convenient_service/service/plugins/can_have_rollbacks/middleware.rb +66 -0
- data/lib/convenient_service/service/plugins/can_have_rollbacks.rb +3 -0
- 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 +61 -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/commands/is_step.rb +34 -0
- data/lib/convenient_service/service/plugins/can_have_steps/commands.rb +1 -0
- data/lib/convenient_service/service/plugins/can_have_steps/concern.rb +4 -57
- 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/entities/callers/reassignment.rb +0 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/exceptions.rb +4 -24
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb +166 -83
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/exceptions.rb +19 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/{can_be_result_step → can_be_method_step}/can_be_executed/exceptions.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed/middleware.rb +52 -6
- 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/exceptions.rb +53 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/middleware.rb +75 -6
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks.rb +1 -0
- 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/has_amazing_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect/concern.rb +3 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_result/concern.rb +34 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_result/middleware.rb +58 -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.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 +41 -1
- data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/fetch_all_services_stubbed_results_cache.rb +2 -2
- data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/exceptions.rb +53 -0
- data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/middleware.rb +108 -0
- data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments.rb +4 -0
- data/lib/convenient_service/service/plugins/has_amazing_print_inspect/concern.rb +39 -0
- data/lib/convenient_service/service/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/{can_have_steps/entities/step/plugins/can_be_result_step → has_j_send_result/entities/result/plugins/can_be_from_exception}/concern.rb +7 -5
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_from_exception.rb +3 -0
- 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/can_have_step/concern.rb +7 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_amazing_print_inspect/concern.rb +41 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect/concern.rb +2 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/concern/instance_methods.rb +0 -7
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_amazing_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_amazing_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_amazing_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb +45 -17
- 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/has_amazing_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_amazing_print_inspect.rb +3 -0
- 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 +15 -0
- 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/helps_to_learn_similarities_with_common_objects/concern/instance_methods.rb +161 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/concern.rb +27 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/exceptions.rb +34 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects.rb +4 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result.rb +0 -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_mermaid_flowchart/concern.rb +6 -1
- 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_j_send_result → has_negated_result}/exceptions.rb +3 -3
- data/lib/convenient_service/service/plugins/has_negated_result.rb +4 -0
- data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/middleware.rb +1 -0
- 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 +10 -3
- data/lib/convenient_service/specification.rb +28 -0
- data/lib/convenient_service/support/backtrace_cleaner.rb +6 -1
- data/lib/convenient_service/support/cache/entities/caches/base.rb +3 -0
- data/lib/convenient_service/support/counter.rb +2 -0
- data/lib/convenient_service/support/method_parameters.rb +121 -0
- data/lib/convenient_service/support/middleware/stack_builder.rb +37 -0
- data/lib/convenient_service/support/never_reach_here.rb +21 -0
- data/lib/convenient_service/support/thread_safe_counter.rb +1 -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 +3 -3
- data/lib/convenient_service/utils/array/find_last.rb +8 -3
- data/lib/convenient_service/utils/object/get_own_method.rb +54 -0
- data/lib/convenient_service/utils/object/instance_variable_delete.rb +1 -1
- data/lib/convenient_service/utils/object/safe_send.rb +84 -0
- data/lib/convenient_service/utils/object.rb +24 -0
- data/lib/convenient_service/utils/string/enclose.rb +52 -0
- data/lib/convenient_service/utils/string.rb +5 -0
- data/lib/convenient_service/version.rb +1 -1
- data/lib/convenient_service.rb +85 -0
- metadata +256 -322
- 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 -504
- 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 -233
- 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/common/plugins/normalizes_env/middleware.rb +0 -31
- data/lib/convenient_service/common/plugins/normalizes_env.rb +0 -3
- 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 -49
- 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/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 -49
- 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 -82
- 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/can_have_steps/entities/step/plugins/can_have_fallbacks/result.rb +0 -3
- 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/services.rb +0 -4
- data/lib/convenient_service/support/gems/active_model.rb +0 -36
- data/lib/convenient_service/support/gems/logger.rb +0 -37
- data/lib/convenient_service/support/gems/paint.rb +0 -37
- data/lib/convenient_service/support/gems/rspec.rb +0 -58
- data/lib/convenient_service/support/ruby.rb +0 -53
- data/lib/convenient_service/support/version/null_version.rb +0 -85
- data/lib/convenient_service/support/version.rb +0 -75
- data/logo.png +0 -0
- data/minitest.rb +0 -30
- data/yard/yard-convenient_service_concern.rb +0 -45
- /data/lib/convenient_service/{support → dependencies/queries}/gems.rb +0 -0
- /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
@@ -0,0 +1,503 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module Service
|
5
|
+
module Plugins
|
6
|
+
module CanHaveConnectedSteps
|
7
|
+
module Concern
|
8
|
+
include Support::Concern
|
9
|
+
|
10
|
+
class_methods do
|
11
|
+
##
|
12
|
+
# @api public
|
13
|
+
#
|
14
|
+
# Registers a step (step definition).
|
15
|
+
#
|
16
|
+
# @param args [Array<Object>]
|
17
|
+
# @param kwargs [Hash{Symbol => Object}]
|
18
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
19
|
+
#
|
20
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
21
|
+
#
|
22
|
+
def step(*args, **kwargs)
|
23
|
+
previous_expression = steps.expression
|
24
|
+
|
25
|
+
new_step = steps.create(*args, **kwargs)
|
26
|
+
|
27
|
+
steps.expression =
|
28
|
+
if previous_expression.empty?
|
29
|
+
Entities::Expressions::Scalar.new(new_step)
|
30
|
+
else
|
31
|
+
Entities::Expressions::And.new(
|
32
|
+
previous_expression,
|
33
|
+
Entities::Expressions::Scalar.new(new_step)
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
##
|
39
|
+
# @api public
|
40
|
+
#
|
41
|
+
# Registers a negated step (step definition).
|
42
|
+
#
|
43
|
+
# @param args [Array<Object>]
|
44
|
+
# @param kwargs [Hash{Symbol => Object}]
|
45
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
46
|
+
#
|
47
|
+
# @note `not` from `not_step` has a similar precedence as Ruby's `!`.
|
48
|
+
# @note `not_step` is a rought equivalent of `!step`.
|
49
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
50
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
51
|
+
#
|
52
|
+
def not_step(*args, **kwargs)
|
53
|
+
previous_expression = steps.expression
|
54
|
+
|
55
|
+
new_step = steps.create(*args, **kwargs)
|
56
|
+
|
57
|
+
steps.expression =
|
58
|
+
if previous_expression.empty?
|
59
|
+
Entities::Expressions::Not.new(
|
60
|
+
Entities::Expressions::Scalar.new(new_step)
|
61
|
+
)
|
62
|
+
else
|
63
|
+
Entities::Expressions::And.new(
|
64
|
+
previous_expression,
|
65
|
+
Entities::Expressions::Not.new(
|
66
|
+
Entities::Expressions::Scalar.new(new_step)
|
67
|
+
)
|
68
|
+
)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
##
|
73
|
+
# @api public
|
74
|
+
#
|
75
|
+
# Registers a step (step definition).
|
76
|
+
#
|
77
|
+
# @param args [Array<Object>]
|
78
|
+
# @param kwargs [Hash{Symbol => Object}]
|
79
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
80
|
+
#
|
81
|
+
# @note `and` from `and_step` has a similar precedence as Ruby's `&&`.
|
82
|
+
# @note `and_step` is a rought equivalent of `&& step`.
|
83
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
84
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
85
|
+
#
|
86
|
+
def and_step(*args, **kwargs)
|
87
|
+
previous_expression = steps.expression
|
88
|
+
|
89
|
+
::ConvenientService.raise Exceptions::FirstStepIsNotSet.new(container: self) if previous_expression.empty?
|
90
|
+
|
91
|
+
new_step = steps.create(*args, **kwargs)
|
92
|
+
|
93
|
+
steps.expression =
|
94
|
+
Entities::Expressions::And.new(
|
95
|
+
previous_expression,
|
96
|
+
Entities::Expressions::Scalar.new(new_step)
|
97
|
+
)
|
98
|
+
end
|
99
|
+
|
100
|
+
##
|
101
|
+
# @api public
|
102
|
+
#
|
103
|
+
# Registers a negated step (step definition).
|
104
|
+
#
|
105
|
+
# @param args [Array<Object>]
|
106
|
+
# @param kwargs [Hash{Symbol => Object}]
|
107
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
108
|
+
#
|
109
|
+
# @note `and` from `and_step` has a similar precedence as Ruby's `&&`.
|
110
|
+
# @note `not` from `and_not_step` has a similar precedence as Ruby's `!`.
|
111
|
+
# @note `and_not_step` is a rought equivalent of `&& !step`.
|
112
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
113
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
114
|
+
#
|
115
|
+
def and_not_step(*args, **kwargs)
|
116
|
+
previous_expression = steps.expression
|
117
|
+
|
118
|
+
::ConvenientService.raise Exceptions::FirstStepIsNotSet.new(container: self) if previous_expression.empty?
|
119
|
+
|
120
|
+
new_step = steps.create(*args, **kwargs)
|
121
|
+
|
122
|
+
steps.expression =
|
123
|
+
Entities::Expressions::And.new(
|
124
|
+
previous_expression,
|
125
|
+
Entities::Expressions::Not.new(
|
126
|
+
Entities::Expressions::Scalar.new(new_step)
|
127
|
+
)
|
128
|
+
)
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# @api public
|
133
|
+
#
|
134
|
+
# Registers an alternative step (step definition).
|
135
|
+
#
|
136
|
+
# @param args [Array<Object>]
|
137
|
+
# @param kwargs [Hash{Symbol => Object}]
|
138
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
139
|
+
#
|
140
|
+
# @note `or` from `or_step` has a similar precedence as Ruby's `||`.
|
141
|
+
# @note `or_step` is a rought equivalent of `|| step`.
|
142
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
143
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
144
|
+
#
|
145
|
+
# @internal
|
146
|
+
# NOTE: Decomposing of the `and` expression is needed to make its priority higher.
|
147
|
+
#
|
148
|
+
def or_step(*args, **kwargs)
|
149
|
+
previous_expression = steps.expression
|
150
|
+
|
151
|
+
::ConvenientService.raise Exceptions::FirstStepIsNotSet.new(container: self) if previous_expression.empty?
|
152
|
+
|
153
|
+
new_step = steps.create(*args, **kwargs)
|
154
|
+
|
155
|
+
steps.expression =
|
156
|
+
if previous_expression.and?
|
157
|
+
Entities::Expressions::And.new(
|
158
|
+
previous_expression.left_expression,
|
159
|
+
Entities::Expressions::Or.new(
|
160
|
+
previous_expression.right_expression,
|
161
|
+
Entities::Expressions::Scalar.new(new_step)
|
162
|
+
)
|
163
|
+
)
|
164
|
+
else
|
165
|
+
Entities::Expressions::Or.new(
|
166
|
+
previous_expression,
|
167
|
+
Entities::Expressions::Scalar.new(new_step)
|
168
|
+
)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
##
|
173
|
+
# @api public
|
174
|
+
#
|
175
|
+
# Registers a negated alternative step (step definition).
|
176
|
+
#
|
177
|
+
# @param args [Array<Object>]
|
178
|
+
# @param kwargs [Hash{Symbol => Object}]
|
179
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
180
|
+
#
|
181
|
+
# @note `or` from `or_not_step` has a similar precedence as Ruby's `||`.
|
182
|
+
# @note `not` from `or_not_step` has a similar precedence as Ruby's `!`.
|
183
|
+
# @note `or_not_step` is a rought equivalent of `|| !step`.
|
184
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
185
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
186
|
+
#
|
187
|
+
# @internal
|
188
|
+
# NOTE: Decomposing of the `and` expression is needed to make its priority higher.
|
189
|
+
#
|
190
|
+
def or_not_step(*args, **kwargs)
|
191
|
+
previous_expression = steps.expression
|
192
|
+
|
193
|
+
::ConvenientService.raise Exceptions::FirstStepIsNotSet.new(container: self) if previous_expression.empty?
|
194
|
+
|
195
|
+
new_step = steps.create(*args, **kwargs)
|
196
|
+
|
197
|
+
steps.expression =
|
198
|
+
if previous_expression.and?
|
199
|
+
Entities::Expressions::And.new(
|
200
|
+
previous_expression.left_expression,
|
201
|
+
Entities::Expressions::Or.new(
|
202
|
+
previous_expression.right_expression,
|
203
|
+
Entities::Expressions::Not.new(
|
204
|
+
Entities::Expressions::Scalar.new(new_step)
|
205
|
+
)
|
206
|
+
)
|
207
|
+
)
|
208
|
+
else
|
209
|
+
Entities::Expressions::Or.new(
|
210
|
+
previous_expression,
|
211
|
+
Entities::Expressions::Not.new(
|
212
|
+
Entities::Expressions::Scalar.new(new_step)
|
213
|
+
)
|
214
|
+
)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
##
|
219
|
+
# @api public
|
220
|
+
#
|
221
|
+
# @param block [Proc, nil]
|
222
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
223
|
+
#
|
224
|
+
# @note `group` has a similar precedence as Ruby's `()`.
|
225
|
+
# @note `group` is a rought equivalent of `()`.
|
226
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
227
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
228
|
+
#
|
229
|
+
def group(&block)
|
230
|
+
previous_expression = steps.expression
|
231
|
+
|
232
|
+
steps.expression = Entities::Expressions::Empty.new
|
233
|
+
|
234
|
+
block&.call
|
235
|
+
|
236
|
+
current_expression = steps.expression
|
237
|
+
|
238
|
+
::ConvenientService.raise Exceptions::FirstGroupStepIsNotSet.new(container: self, method: __method__) if current_expression.empty?
|
239
|
+
|
240
|
+
steps.expression =
|
241
|
+
if previous_expression.empty?
|
242
|
+
Entities::Expressions::Group.new(current_expression)
|
243
|
+
else
|
244
|
+
Entities::Expressions::And.new(
|
245
|
+
previous_expression,
|
246
|
+
Entities::Expressions::Group.new(current_expression)
|
247
|
+
)
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
##
|
252
|
+
# @api public
|
253
|
+
#
|
254
|
+
# @param block [Proc, nil]
|
255
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
256
|
+
#
|
257
|
+
# @note `not` from `not_group` has a similar precedence as Ruby's `!`.
|
258
|
+
# @note `group` from `not_group` has a similar precedence as Ruby's `()`.
|
259
|
+
# @note `not_group` is a rought equivalent of `!()`.
|
260
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
261
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
262
|
+
#
|
263
|
+
def not_group(&block)
|
264
|
+
previous_expression = steps.expression
|
265
|
+
|
266
|
+
steps.expression = Entities::Expressions::Empty.new
|
267
|
+
|
268
|
+
block&.call
|
269
|
+
|
270
|
+
current_expression = steps.expression
|
271
|
+
|
272
|
+
::ConvenientService.raise Exceptions::FirstGroupStepIsNotSet.new(container: self, method: __method__) if current_expression.empty?
|
273
|
+
|
274
|
+
steps.expression =
|
275
|
+
if previous_expression.empty?
|
276
|
+
Entities::Expressions::Not.new(
|
277
|
+
Entities::Expressions::Group.new(current_expression)
|
278
|
+
)
|
279
|
+
else
|
280
|
+
Entities::Expressions::And.new(
|
281
|
+
previous_expression,
|
282
|
+
Entities::Expressions::Not.new(
|
283
|
+
Entities::Expressions::Group.new(current_expression)
|
284
|
+
)
|
285
|
+
)
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
##
|
290
|
+
# @api public
|
291
|
+
#
|
292
|
+
# @param block [Proc, nil]
|
293
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
294
|
+
#
|
295
|
+
# @note `and` from `and_group` has a similar precedence as Ruby's `&&`.
|
296
|
+
# @note `group` from `and_group` has a similar precedence as Ruby's `()`.
|
297
|
+
# @note `not_group` is a rought equivalent of `&& ()`.
|
298
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
299
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
300
|
+
#
|
301
|
+
def and_group(&block)
|
302
|
+
previous_expression = steps.expression
|
303
|
+
|
304
|
+
::ConvenientService.raise Exceptions::FirstStepIsNotSet.new(container: self) if previous_expression.empty?
|
305
|
+
|
306
|
+
steps.expression = Entities::Expressions::Empty.new
|
307
|
+
|
308
|
+
block&.call
|
309
|
+
|
310
|
+
current_expression = steps.expression
|
311
|
+
|
312
|
+
::ConvenientService.raise Exceptions::FirstGroupStepIsNotSet.new(container: self, method: __method__) if current_expression.empty?
|
313
|
+
|
314
|
+
steps.expression =
|
315
|
+
Entities::Expressions::And.new(
|
316
|
+
previous_expression,
|
317
|
+
Entities::Expressions::Group.new(current_expression)
|
318
|
+
)
|
319
|
+
end
|
320
|
+
|
321
|
+
##
|
322
|
+
# @api public
|
323
|
+
#
|
324
|
+
# @param block [Proc, nil]
|
325
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
326
|
+
#
|
327
|
+
# @note `and` from `and_not_group` has a similar precedence as Ruby's `&&`.
|
328
|
+
# @note `not` from `and_not_group` has a similar precedence as Ruby's `!`.
|
329
|
+
# @note `group` from `and_not_group` has a similar precedence as Ruby's `()`.
|
330
|
+
# @note `and_not_group` is a rought equivalent of `&& !()`.
|
331
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
332
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
333
|
+
#
|
334
|
+
def and_not_group(&block)
|
335
|
+
previous_expression = steps.expression
|
336
|
+
|
337
|
+
::ConvenientService.raise Exceptions::FirstStepIsNotSet.new(container: self) if previous_expression.empty?
|
338
|
+
|
339
|
+
steps.expression = Entities::Expressions::Empty.new
|
340
|
+
|
341
|
+
block&.call
|
342
|
+
|
343
|
+
current_expression = steps.expression
|
344
|
+
|
345
|
+
::ConvenientService.raise Exceptions::FirstGroupStepIsNotSet.new(container: self, method: __method__) if current_expression.empty?
|
346
|
+
|
347
|
+
steps.expression =
|
348
|
+
Entities::Expressions::And.new(
|
349
|
+
previous_expression,
|
350
|
+
Entities::Expressions::Not.new(
|
351
|
+
Entities::Expressions::Group.new(current_expression)
|
352
|
+
)
|
353
|
+
)
|
354
|
+
end
|
355
|
+
|
356
|
+
##
|
357
|
+
# @api public
|
358
|
+
#
|
359
|
+
# @param block [Proc, nil]
|
360
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
361
|
+
#
|
362
|
+
# @note `or` from `or_group` has a similar precedence as Ruby's `||`.
|
363
|
+
# @note `group` from `or_group` has a similar precedence as Ruby's `()`.
|
364
|
+
# @note `or_group` is a rought equivalent of `|| ()`
|
365
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
366
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
367
|
+
#
|
368
|
+
# @internal
|
369
|
+
# NOTE: Decomposing of the `and` expression is needed to make its priority higher.
|
370
|
+
#
|
371
|
+
def or_group(&block)
|
372
|
+
previous_expression = steps.expression
|
373
|
+
|
374
|
+
::ConvenientService.raise Exceptions::FirstStepIsNotSet.new(container: self) if previous_expression.empty?
|
375
|
+
|
376
|
+
steps.expression = Entities::Expressions::Empty.new
|
377
|
+
|
378
|
+
block&.call
|
379
|
+
|
380
|
+
current_expression = steps.expression
|
381
|
+
|
382
|
+
::ConvenientService.raise Exceptions::FirstGroupStepIsNotSet.new(container: self, method: __method__) if current_expression.empty?
|
383
|
+
|
384
|
+
steps.expression =
|
385
|
+
if previous_expression.and?
|
386
|
+
Entities::Expressions::And.new(
|
387
|
+
previous_expression.left_expression,
|
388
|
+
Entities::Expressions::Or.new(
|
389
|
+
previous_expression.right_expression,
|
390
|
+
Entities::Expressions::Group.new(current_expression)
|
391
|
+
)
|
392
|
+
)
|
393
|
+
else
|
394
|
+
Entities::Expressions::Or.new(
|
395
|
+
previous_expression,
|
396
|
+
Entities::Expressions::Group.new(current_expression)
|
397
|
+
)
|
398
|
+
end
|
399
|
+
end
|
400
|
+
|
401
|
+
##
|
402
|
+
# @api public
|
403
|
+
#
|
404
|
+
# @param block [Proc, nil]
|
405
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
406
|
+
#
|
407
|
+
# @note `or` from `or_not_group` has a similar precedence as Ruby's `||`.
|
408
|
+
# @note `not` from `or_not_group` has a similar precedence as Ruby's `!`.
|
409
|
+
# @note `group` from `or_not_group` has a similar precedence as Ruby's `()`.
|
410
|
+
# @note `or_not_group` is a rought equivalent of `|| !()`
|
411
|
+
# @note It is NOT recommended to rely on the return value of this method, since it may differ across different `step` related plugins.
|
412
|
+
# @see https://ruby-doc.org/core-2.7.1/doc/syntax/precedence_rdoc.html
|
413
|
+
#
|
414
|
+
# @internal
|
415
|
+
# NOTE: Decomposing of the `and` expression is needed to make its priority higher.
|
416
|
+
#
|
417
|
+
def or_not_group(&block)
|
418
|
+
previous_expression = steps.expression
|
419
|
+
|
420
|
+
::ConvenientService.raise Exceptions::FirstStepIsNotSet.new(container: self) if previous_expression.empty?
|
421
|
+
|
422
|
+
steps.expression = Entities::Expressions::Empty.new
|
423
|
+
|
424
|
+
block&.call
|
425
|
+
|
426
|
+
current_expression = steps.expression
|
427
|
+
|
428
|
+
::ConvenientService.raise Exceptions::FirstGroupStepIsNotSet.new(container: self, method: __method__) if current_expression.empty?
|
429
|
+
|
430
|
+
steps.expression =
|
431
|
+
if previous_expression.and?
|
432
|
+
Entities::Expressions::And.new(
|
433
|
+
previous_expression.left_expression,
|
434
|
+
Entities::Expressions::Or.new(
|
435
|
+
previous_expression.right_expression,
|
436
|
+
Entities::Expressions::Not.new(
|
437
|
+
Entities::Expressions::Group.new(current_expression)
|
438
|
+
)
|
439
|
+
)
|
440
|
+
)
|
441
|
+
else
|
442
|
+
Entities::Expressions::Or.new(
|
443
|
+
previous_expression,
|
444
|
+
Entities::Expressions::Not.new(
|
445
|
+
Entities::Expressions::Group.new(current_expression)
|
446
|
+
)
|
447
|
+
)
|
448
|
+
end
|
449
|
+
end
|
450
|
+
|
451
|
+
##
|
452
|
+
# @api private
|
453
|
+
#
|
454
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::StepCollection]
|
455
|
+
#
|
456
|
+
def steps
|
457
|
+
internals_class.cache.fetch(:steps) { Entities::StepCollection.new(container: self) }
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
461
|
+
instance_methods do
|
462
|
+
##
|
463
|
+
# @api public
|
464
|
+
#
|
465
|
+
# @note May be useful for debugging purposes.
|
466
|
+
# @see https://userdocs.convenientservice.org/guides/how_to_debug_services_via_callbacks
|
467
|
+
#
|
468
|
+
# @note `steps` are frozen.
|
469
|
+
# @see https://userdocs.convenientservice.org/faq#is-it-possible-to-modify-the-step-collection-from-a-callback
|
470
|
+
#
|
471
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::StepCollection]
|
472
|
+
#
|
473
|
+
def steps
|
474
|
+
internals.cache.fetch(:steps) do
|
475
|
+
self.class
|
476
|
+
.steps
|
477
|
+
.tap(&:commit!)
|
478
|
+
.with_organizer(self)
|
479
|
+
.tap(&:commit!)
|
480
|
+
end
|
481
|
+
end
|
482
|
+
|
483
|
+
##
|
484
|
+
# @api private
|
485
|
+
#
|
486
|
+
# Returns step by index.
|
487
|
+
# Returns `nil` when index is out of range.
|
488
|
+
#
|
489
|
+
# @param index [Integer]
|
490
|
+
# @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
|
491
|
+
#
|
492
|
+
# @note This method was initially designed as a hook (callback trigger).
|
493
|
+
# @see ConvenientService::Service::Plugins::CanHaveConnectedSteps::Middleware#next
|
494
|
+
#
|
495
|
+
def step(index)
|
496
|
+
steps[index]
|
497
|
+
end
|
498
|
+
end
|
499
|
+
end
|
500
|
+
end
|
501
|
+
end
|
502
|
+
end
|
503
|
+
end
|
data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module Service
|
5
|
+
module Plugins
|
6
|
+
module CanHaveConnectedSteps
|
7
|
+
module Entities
|
8
|
+
module Expressions
|
9
|
+
class And < Entities::Expressions::Base
|
10
|
+
##
|
11
|
+
# @!attribute [r] left_expression
|
12
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
13
|
+
#
|
14
|
+
attr_reader :left_expression
|
15
|
+
|
16
|
+
##
|
17
|
+
# @!attribute [r] right_expression
|
18
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
19
|
+
#
|
20
|
+
attr_reader :right_expression
|
21
|
+
|
22
|
+
##
|
23
|
+
# @param left_expression [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
24
|
+
# @param right_expression [[ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
25
|
+
# @return [void]
|
26
|
+
#
|
27
|
+
def initialize(left_expression, right_expression)
|
28
|
+
@left_expression = left_expression
|
29
|
+
@right_expression = right_expression
|
30
|
+
end
|
31
|
+
|
32
|
+
##
|
33
|
+
# @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
|
34
|
+
#
|
35
|
+
def result
|
36
|
+
left_expression.success? ? right_expression.result : left_expression.result
|
37
|
+
end
|
38
|
+
|
39
|
+
##
|
40
|
+
# @return [Boolean]
|
41
|
+
#
|
42
|
+
def success?
|
43
|
+
left_expression.success? && right_expression.success?
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# @return [Boolean]
|
48
|
+
#
|
49
|
+
def failure?
|
50
|
+
return true if left_expression.failure?
|
51
|
+
return false if left_expression.error?
|
52
|
+
|
53
|
+
right_expression.failure?
|
54
|
+
end
|
55
|
+
|
56
|
+
##
|
57
|
+
# @return [Boolean]
|
58
|
+
#
|
59
|
+
def error?
|
60
|
+
return false if left_expression.failure?
|
61
|
+
return true if left_expression.error?
|
62
|
+
|
63
|
+
right_expression.error?
|
64
|
+
end
|
65
|
+
|
66
|
+
##
|
67
|
+
# @param block [Proc]
|
68
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
69
|
+
#
|
70
|
+
def each_step(&block)
|
71
|
+
left_expression.each_step(&block)
|
72
|
+
right_expression.each_step(&block)
|
73
|
+
|
74
|
+
self
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# @param block [Proc]
|
79
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base]
|
80
|
+
#
|
81
|
+
def each_evaluated_step(&block)
|
82
|
+
left_expression.each_evaluated_step(&block)
|
83
|
+
|
84
|
+
right_expression.each_evaluated_step(&block) if left_expression.success?
|
85
|
+
|
86
|
+
self
|
87
|
+
end
|
88
|
+
|
89
|
+
##
|
90
|
+
# @param organizer [ConvenientService::Service]
|
91
|
+
# @return [ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Not]
|
92
|
+
#
|
93
|
+
def with_organizer(organizer)
|
94
|
+
copy(overrides: {args: {0 => left_expression.with_organizer(organizer), 1 => right_expression.with_organizer(organizer)}})
|
95
|
+
end
|
96
|
+
|
97
|
+
##
|
98
|
+
# @return [String]
|
99
|
+
#
|
100
|
+
def inspect
|
101
|
+
"#{left_expression.inspect} && #{right_expression.inspect}"
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# @return [Boolean]
|
106
|
+
#
|
107
|
+
def and?
|
108
|
+
true
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# @param other [Object] Can be any type.
|
113
|
+
# @return [Boolean]
|
114
|
+
#
|
115
|
+
def ==(other)
|
116
|
+
return unless other.instance_of?(self.class)
|
117
|
+
|
118
|
+
return false if left_expression != other.left_expression
|
119
|
+
return false if right_expression != other.right_expression
|
120
|
+
|
121
|
+
true
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# @return [ConvenientService::Support::Arguments]
|
126
|
+
#
|
127
|
+
def to_arguments
|
128
|
+
Support::Arguments.new(left_expression, right_expression)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|