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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1943fd64d61a41a18701985f5a7296b7cf3337ab0562c1912ee7765668dd6f3a
|
4
|
+
data.tar.gz: 02e2d46311210cd922b606848f36c82db136a7f2ca2013fba269c6c5eb3adc3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74cded446d90f5b06675c5c19f7647792e195b47178504b14dbf650640186f33679e8bf8c17ad73e214ff5f1b38d233c7919c361f3f90c569435fc14e4c5d999
|
7
|
+
data.tar.gz: a7773a495b1805778221b006427562bd25acd7420c243aab192abaf0460d661d905259aed97a2c489ccd9e77bac349da1516f9dd8ec8d7b573115b5872229b92
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
<!-- stand_with_ukraine:end -->
|
8
8
|
|
9
9
|
<!-- header:start -->
|
10
|
-
<!-- TODO: Remove html to display in YARD with
|
10
|
+
<!-- TODO: Remove html to display in YARD with common mark -->
|
11
11
|
<h1 align="center">
|
12
12
|
Convenient Service
|
13
13
|
</h1>
|
@@ -23,11 +23,11 @@
|
|
23
23
|
[![Gem Version](https://badge.fury.io/rb/convenient_service.svg)](https://rubygems.org/gems/convenient_service) [![Gem Downloads](https://img.shields.io/gem/dt/convenient_service.svg)](https://rubygems.org/gems/convenient_service) ![visitors](https://visitor-badge.glitch.me/badge?page_id=marian13/convenient_service) ![GitHub repo size](https://img.shields.io/github/repo-size/marian13/convenient_service) [![GitHub Actions CI](https://github.com/marian13/convenient_service/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/marian13/convenient_service/actions/workflows/ci.yml) [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard) [![Coverage Status](https://coveralls.io/repos/github/marian13/convenient_service/badge.svg)](https://coveralls.io/github/marian13/convenient_service?branch=main) [![inline docs](http://inch-ci.org/github/marian13/convenient_service.svg?branch=main)](http://inch-ci.org/github/marian13/convenient_service) [![yard docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://marian13.github.io/convenient_service/)
|
24
24
|
[![Convenient Service on stackoverflow](https://img.shields.io/badge/stackoverflow-community-orange.svg?logo=stackoverflow)](https://stackoverflow.com/tags/convenient-service)
|
25
25
|
[![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/user?u=31435716&fan_landing=true)
|
26
|
-
[![License:
|
26
|
+
[![License: LGPL-3.0](https://img.shields.io/badge/license-LGPL--3.0-yellow.svg)](https://www.gnu.org/licenses/lgpl-3.0.html)
|
27
27
|
<!-- badges:end -->
|
28
28
|
|
29
29
|
<!-- logo:start -->
|
30
|
-
<!-- TODO: Remove html to display in YARD with
|
30
|
+
<!-- TODO: Remove html to display in YARD with common mark -->
|
31
31
|
<p align="center">
|
32
32
|
<img src="https://raw.githubusercontent.com/marian13/convenient_service/main/logo.png" width="300">
|
33
33
|
</p>
|
@@ -40,8 +40,7 @@ Yet another approach to revisit the service object pattern, but this time focusi
|
|
40
40
|
<!-- warning:start -->
|
41
41
|
## ❗❗❗ WARNING ❗❗❗
|
42
42
|
|
43
|
-
This library is under heavy development.
|
44
|
-
<!-- features:end -->
|
43
|
+
This library is under heavy development. Most of the public API is polished, but it still may be subject to change. It has already been successfully used in production environments for more than a year, but the first major version is planned for the second quarter of 2025. Use the current version at your own risk. Ruby 2.7+, JRuby 9.4+ (TruffleRuby support is planned as well). Thanks.
|
45
44
|
<!-- warning:end -->
|
46
45
|
|
47
46
|
<!-- links:start -->
|
@@ -51,7 +50,7 @@ This library is under heavy development. Public API may be subject to change. Th
|
|
51
50
|
|
52
51
|
- Check out [Convenient Service Official User Docs](https://userdocs.convenientservice.org/) for installation, requirements, and usage guides.
|
53
52
|
|
54
|
-
- Read [the API docs](https://
|
53
|
+
- Read [the API docs](https://apidocs.convenientservice.org/) to get familiar with the newest functionality that is not documented yet.
|
55
54
|
|
56
55
|
- Create [an issue](https://github.com/marian13/convenient_service/issues) if you are going to report a bug.
|
57
56
|
|
@@ -63,6 +62,8 @@ This library is under heavy development. Public API may be subject to change. Th
|
|
63
62
|
|
64
63
|
- [Static Content](https://github.com/marian13/static_content/tree/main/convenient_service) repo.
|
65
64
|
|
65
|
+
- [Convenient Service Integration](https://github.com/marian13/convenient_service_integration) machinery.
|
66
|
+
|
66
67
|
- Have a look at [Convenient Service Development Wiki](https://github.com/marian13/convenient_service/wiki) for the contribution tutorials.
|
67
68
|
|
68
69
|
<!-- links:end -->
|
@@ -70,5 +71,5 @@ This library is under heavy development. Public API may be subject to change. Th
|
|
70
71
|
---
|
71
72
|
|
72
73
|
<!-- author:start -->
|
73
|
-
Copyright (c) 2022-
|
74
|
+
Copyright (c) 2022-2024 Marian Kostyk.
|
74
75
|
<!-- author:end -->
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module Commands
|
5
|
+
class IsService < Support::Command
|
6
|
+
##
|
7
|
+
# @!attribute [r] service
|
8
|
+
# @return [Object] Can be any type.
|
9
|
+
#
|
10
|
+
attr_reader :service
|
11
|
+
|
12
|
+
##
|
13
|
+
# @param service [Object] Can be any type.
|
14
|
+
# @return [void]
|
15
|
+
#
|
16
|
+
def initialize(service:)
|
17
|
+
@service = service
|
18
|
+
end
|
19
|
+
|
20
|
+
##
|
21
|
+
# @return [Boolean]
|
22
|
+
#
|
23
|
+
def call
|
24
|
+
Commands::IsServiceClass[service_class: service.class]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module Commands
|
5
|
+
class IsServiceClass < Support::Command
|
6
|
+
##
|
7
|
+
# @!attribute [r] service_class
|
8
|
+
# @return [Object] Can be any type.
|
9
|
+
#
|
10
|
+
attr_reader :service_class
|
11
|
+
|
12
|
+
##
|
13
|
+
# @param service_class [Object] Can be any type.
|
14
|
+
# @return [void]
|
15
|
+
#
|
16
|
+
def initialize(service_class:)
|
17
|
+
@service_class = service_class
|
18
|
+
end
|
19
|
+
|
20
|
+
##
|
21
|
+
# @return [Boolean]
|
22
|
+
#
|
23
|
+
def call
|
24
|
+
return unless service_class.instance_of?(::Class)
|
25
|
+
|
26
|
+
service_class.include?(Service::Configs::Essential)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module Common
|
5
|
+
module Plugins
|
6
|
+
module EnsuresNegatedJSendResult
|
7
|
+
class Middleware < MethodChainMiddleware
|
8
|
+
intended_for :negated_result, entity: any_entity
|
9
|
+
|
10
|
+
##
|
11
|
+
# @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
|
12
|
+
#
|
13
|
+
def next(...)
|
14
|
+
result = chain.next(...)
|
15
|
+
|
16
|
+
result.negated? ? result : result.copy(overrides: {kwargs: {negated: true}})
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -8,8 +8,15 @@ module ConvenientService
|
|
8
8
|
include Support::Concern
|
9
9
|
|
10
10
|
class_methods do
|
11
|
+
##
|
12
|
+
# @api public
|
13
|
+
#
|
14
|
+
# @param type [Symbol]
|
15
|
+
# @param block [Proc]
|
16
|
+
# @return [ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback]
|
17
|
+
#
|
11
18
|
def around(type, &block)
|
12
|
-
|
19
|
+
callbacks.create(types: [:around, type], block: block)
|
13
20
|
end
|
14
21
|
end
|
15
22
|
end
|
@@ -5,16 +5,28 @@ module ConvenientService
|
|
5
5
|
module Plugins
|
6
6
|
module HasAroundCallbacks
|
7
7
|
class Middleware < MethodChainMiddleware
|
8
|
+
include Support::Delegate
|
9
|
+
|
8
10
|
##
|
9
11
|
# @internal
|
10
|
-
# TODO:
|
12
|
+
# TODO: Support of callbacks for class methods.
|
11
13
|
#
|
12
|
-
|
14
|
+
intended_for any_method, entity: any_entity
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
##
|
17
|
+
# @return [Class<ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback>]
|
18
|
+
#
|
19
|
+
delegate :callback_class, to: :callbacks
|
17
20
|
|
21
|
+
##
|
22
|
+
# @param args [Array<Object>]
|
23
|
+
# @param kwargs [Hash{Symbol => Object}]
|
24
|
+
# @param block [Proc, nil]
|
25
|
+
# @return [Object] Can be any type.
|
26
|
+
#
|
27
|
+
# @internal
|
28
|
+
# TODO: Move to command.
|
29
|
+
#
|
18
30
|
def next(*args, **kwargs, &block)
|
19
31
|
##
|
20
32
|
# A variable that stores return value of middleware `chain.next` aka `original_value`.
|
@@ -41,12 +53,12 @@ module ConvenientService
|
|
41
53
|
# end
|
42
54
|
# end
|
43
55
|
#
|
44
|
-
around_callbacks =
|
56
|
+
around_callbacks = callbacks.for([:around, method])
|
45
57
|
|
46
58
|
##
|
47
59
|
#
|
48
60
|
#
|
49
|
-
initial_around_callback =
|
61
|
+
initial_around_callback = callback_class.new(
|
50
62
|
types: [:around, method],
|
51
63
|
block: proc { original_value = chain.next(*args, **kwargs, &block) }
|
52
64
|
)
|
@@ -132,6 +144,15 @@ module ConvenientService
|
|
132
144
|
|
133
145
|
original_value
|
134
146
|
end
|
147
|
+
|
148
|
+
private
|
149
|
+
|
150
|
+
##
|
151
|
+
# @return [ConvenientService::Common::Plugins::HasCallbacks::Entities::CallbackCollection]
|
152
|
+
#
|
153
|
+
def callbacks
|
154
|
+
entity.class.callbacks
|
155
|
+
end
|
135
156
|
end
|
136
157
|
end
|
137
158
|
end
|
@@ -7,26 +7,36 @@ module ConvenientService
|
|
7
7
|
module Concern
|
8
8
|
include Support::Concern
|
9
9
|
|
10
|
-
instance_methods do
|
11
|
-
include Support::Delegate
|
12
|
-
|
13
|
-
delegate :callbacks, to: :class
|
14
|
-
end
|
15
|
-
|
16
10
|
class_methods do
|
17
11
|
##
|
18
12
|
# @api private
|
19
13
|
#
|
14
|
+
# @return [ConvenientService::Common::Plugins::HasCallbacks::Entities::CallbackCollection]
|
15
|
+
#
|
20
16
|
def callbacks
|
21
|
-
|
17
|
+
internals_class.cache.fetch(:callbacks) { Entities::CallbackCollection.new }
|
22
18
|
end
|
23
19
|
|
20
|
+
##
|
21
|
+
# @api public
|
22
|
+
#
|
23
|
+
# @param type [Symbol]
|
24
|
+
# @param block [Proc]
|
25
|
+
# @return [ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback]
|
26
|
+
#
|
24
27
|
def before(type, &block)
|
25
|
-
|
28
|
+
callbacks.create(types: [:before, type], block: block)
|
26
29
|
end
|
27
30
|
|
31
|
+
##
|
32
|
+
# @api public
|
33
|
+
#
|
34
|
+
# @param type [Symbol]
|
35
|
+
# @param block [Proc]
|
36
|
+
# @return [ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback]
|
37
|
+
#
|
28
38
|
def after(type, &block)
|
29
|
-
|
39
|
+
callbacks.create(types: [:after, type], block: block)
|
30
40
|
end
|
31
41
|
end
|
32
42
|
end
|
@@ -6,20 +6,68 @@ module ConvenientService
|
|
6
6
|
module HasCallbacks
|
7
7
|
module Entities
|
8
8
|
class CallbackCollection
|
9
|
+
include ::Enumerable
|
10
|
+
|
9
11
|
include Support::Delegate
|
10
12
|
|
13
|
+
##
|
14
|
+
# @api private
|
15
|
+
#
|
16
|
+
# @!attribute [r] types
|
17
|
+
# @return [ConvenientService::Common::Plugins::HasCallbacks::Entities::TypeCollection]
|
18
|
+
#
|
11
19
|
attr_reader :callbacks
|
12
20
|
|
13
|
-
|
21
|
+
##
|
22
|
+
# @api private
|
23
|
+
#
|
24
|
+
# @return [Array<ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback>]
|
25
|
+
#
|
26
|
+
delegate :each, to: :callbacks
|
14
27
|
|
28
|
+
##
|
29
|
+
# @api private
|
30
|
+
#
|
31
|
+
# @return [void]
|
32
|
+
#
|
15
33
|
def initialize
|
16
34
|
@callbacks = []
|
17
35
|
end
|
18
36
|
|
37
|
+
##
|
38
|
+
# @return [Class<ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback>]
|
39
|
+
#
|
40
|
+
def callback_class
|
41
|
+
Entities::Callback
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# @api private
|
46
|
+
#
|
47
|
+
# @param types [Array<Symbol>]
|
48
|
+
# @return [Array<ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback>]
|
49
|
+
#
|
19
50
|
def for(types)
|
20
51
|
callbacks.select { |callback| callback.types.contain_exactly?(types) }
|
21
52
|
end
|
22
53
|
|
54
|
+
##
|
55
|
+
# @api private
|
56
|
+
#
|
57
|
+
# @param kwargs [Hash{Symbol => Object}]
|
58
|
+
# @return [ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback]
|
59
|
+
#
|
60
|
+
def create(**kwargs)
|
61
|
+
Entities::Callback.new(**kwargs)
|
62
|
+
.tap { |callback| callbacks << callback }
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# @api private
|
67
|
+
#
|
68
|
+
# @param other [Object] Can be any type.
|
69
|
+
# @return [Boolean]
|
70
|
+
#
|
23
71
|
def ==(other)
|
24
72
|
return unless other.instance_of?(self.class)
|
25
73
|
|
@@ -5,9 +5,18 @@ module ConvenientService
|
|
5
5
|
module Plugins
|
6
6
|
module HasCallbacks
|
7
7
|
class Middleware < MethodChainMiddleware
|
8
|
-
|
8
|
+
##
|
9
|
+
# @internal
|
10
|
+
# TODO: Support of callbacks for class methods.
|
11
|
+
#
|
12
|
+
intended_for any_method, entity: any_entity
|
9
13
|
|
10
14
|
##
|
15
|
+
# @param args [Array<Object>]
|
16
|
+
# @param kwargs [Hash{Symbol => Object}]
|
17
|
+
# @param block [Proc, nil]
|
18
|
+
# @return [Object] Can be any type.
|
19
|
+
#
|
11
20
|
# @internal
|
12
21
|
# TODO: Move to command.
|
13
22
|
#
|
@@ -21,7 +30,7 @@ module ConvenientService
|
|
21
30
|
# end
|
22
31
|
# end
|
23
32
|
#
|
24
|
-
|
33
|
+
callbacks.for([:before, method]).each { |callback| callback.call_in_context_with_arguments(entity, *args, **kwargs, &block) }
|
25
34
|
|
26
35
|
original_value = chain.next(*args, **kwargs, &block)
|
27
36
|
|
@@ -37,10 +46,19 @@ module ConvenientService
|
|
37
46
|
# end
|
38
47
|
# end
|
39
48
|
#
|
40
|
-
|
49
|
+
callbacks.for([:after, method]).reverse_each { |callback| callback.call_in_context_with_value_and_arguments(entity, original_value, *args, **kwargs, &block) }
|
41
50
|
|
42
51
|
original_value
|
43
52
|
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
##
|
57
|
+
# @return [ConvenientService::Common::Plugins::HasCallbacks::Entities::CallbackCollection]
|
58
|
+
#
|
59
|
+
def callbacks
|
60
|
+
entity.class.callbacks
|
61
|
+
end
|
44
62
|
end
|
45
63
|
end
|
46
64
|
end
|
@@ -15,6 +15,18 @@ module ConvenientService
|
|
15
15
|
module Concern
|
16
16
|
include Support::Concern
|
17
17
|
|
18
|
+
class_methods do
|
19
|
+
##
|
20
|
+
# @return [ConvenientService::Support::Cache]
|
21
|
+
#
|
22
|
+
# @internal
|
23
|
+
# TODO: `Support::Cache.create(backend: :thread_safe_hash)`.
|
24
|
+
#
|
25
|
+
def cache
|
26
|
+
@cache ||= Support::Cache.create(backend: :hash)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
18
30
|
instance_methods do
|
19
31
|
##
|
20
32
|
# @return [ConvenientService::Support::Cache]
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
##
|
4
|
-
#
|
4
|
+
# @internal
|
5
|
+
# NOTE: Some plugins are order-dependent.
|
5
6
|
#
|
6
|
-
require_relative "plugins/normalizes_env"
|
7
|
-
|
8
7
|
require_relative "plugins/caches_constructor_arguments"
|
9
8
|
require_relative "plugins/caches_return_value"
|
10
9
|
require_relative "plugins/can_be_copied"
|
11
10
|
require_relative "plugins/can_have_user_provided_entity"
|
11
|
+
require_relative "plugins/ensures_negated_j_send_result"
|
12
12
|
require_relative "plugins/has_callbacks"
|
13
13
|
require_relative "plugins/has_around_callbacks"
|
14
14
|
require_relative "plugins/has_constructor"
|
@@ -117,6 +117,9 @@ module ConvenientService
|
|
117
117
|
# - `lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/commands/define_method_middlewares_caller.rb`
|
118
118
|
# - https://gist.github.com/marian13/9c25041f835564e945d978839097d419
|
119
119
|
#
|
120
|
+
# IMPORTANT: Psych has a monkey-patch `y` in IRB. That is why calling `Service.y` raise `private method called` instead of `undefined method`.
|
121
|
+
# - https://github.com/ruby/psych/blob/v5.1.2/lib/psych/y.rb#L5
|
122
|
+
#
|
120
123
|
def method_missing(method, *args, **kwargs, &block)
|
121
124
|
commit_config!(trigger: Constants::Triggers::CLASS_METHOD_MISSING)
|
122
125
|
|
@@ -48,6 +48,23 @@ module ConvenientService
|
|
48
48
|
plain_stack.call(env)
|
49
49
|
end
|
50
50
|
|
51
|
+
##
|
52
|
+
# @param concern [ConvenientService::Support::Concern, Module]
|
53
|
+
# @param args [Array<Object>]
|
54
|
+
# @param block [Proc, nil]
|
55
|
+
# @return [ConvenientService::Core::Entities::Config::Entities::Concerns::Entities::Stack]
|
56
|
+
#
|
57
|
+
def unshift(concern, *args, &block)
|
58
|
+
plain_stack.unshift(cast(concern), *args, &block)
|
59
|
+
|
60
|
+
self
|
61
|
+
end
|
62
|
+
|
63
|
+
##
|
64
|
+
# @return [ConvenientService::Core::Entities::Config::Entities::Concerns::Entities::Stack]
|
65
|
+
#
|
66
|
+
alias_method :prepend, :unshift
|
67
|
+
|
51
68
|
##
|
52
69
|
# @param index_or_concern [Integer, ConvenientService::Support::Concern, Module]
|
53
70
|
# @param concern [ConvenientService::Support::Concern, Module]
|
@@ -137,6 +154,11 @@ module ConvenientService
|
|
137
154
|
self
|
138
155
|
end
|
139
156
|
|
157
|
+
##
|
158
|
+
# @return [ConvenientService::Core::Entities::Config::Entities::Concerns::Entities::Stack]
|
159
|
+
#
|
160
|
+
alias_method :remove, :delete
|
161
|
+
|
140
162
|
##
|
141
163
|
# @param concern [ConvenientService::Support::Concern, Module]
|
142
164
|
# @param args [Array<Object>]
|
@@ -78,7 +78,7 @@ module ConvenientService
|
|
78
78
|
# # [Service::ClassMethodsMiddlewaresCallers, #<Class:Service>, ConvenientService::Core::ClassMethods, #<Class:Object>, #<Class:BasicObject>, Class, Module, Object, Kernel, BasicObject]
|
79
79
|
#
|
80
80
|
# ancestors_greater_than_methods_middlewares_callers # For the entity defined above.
|
81
|
-
# # [#<Class:Service>, ConvenientService::Core::ClassMethods, #<Class:Object>, #<Class:BasicObject>, Class, Module, Object, Kernel, BasicObject]
|
81
|
+
# # [#<Class:Service>, ConvenientService::Core::ClassMethods, #<Class:Object>, #<Class:BasicObject>, Class, Module, Object, Kernel, BasicObject]
|
82
82
|
#
|
83
83
|
# @note Returns empty array when `methods_middlewares_callers` are NOT prepended.
|
84
84
|
# @note If you expect to receive not empty array, make sure the config is committed.
|
@@ -8,11 +8,16 @@ module ConvenientService
|
|
8
8
|
class MethodMiddlewares
|
9
9
|
module Entities
|
10
10
|
module MiddlewareCreators
|
11
|
+
##
|
12
|
+
# NOTE: `observer` is NOT a part of Ruby stdlib starting from Ruby 3.4. That is why a custom observer is implemented.
|
13
|
+
#
|
14
|
+
# @internal
|
15
|
+
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/observer/rdoc/Observable.html
|
16
|
+
# - https://github.com/ruby/observer
|
17
|
+
#
|
11
18
|
class Observable < MiddlewareCreators::Base
|
12
19
|
module Entities
|
13
20
|
class Event
|
14
|
-
include ::Observable
|
15
|
-
|
16
21
|
##
|
17
22
|
# @!attribute [r] type
|
18
23
|
# @return [Symbol]
|
@@ -41,7 +46,7 @@ module ConvenientService
|
|
41
46
|
# @see https://ruby-doc.org/stdlib-2.7.0/libdoc/observer/rdoc/Observable.html#method-i-add_observer
|
42
47
|
#
|
43
48
|
def add_observer(observer, func = default_handler_name)
|
44
|
-
|
49
|
+
observers[observer] = func
|
45
50
|
end
|
46
51
|
|
47
52
|
##
|
@@ -50,10 +55,8 @@ module ConvenientService
|
|
50
55
|
# @see https://ruby-doc.org/stdlib-2.7.0/libdoc/observer/rdoc/Observable.html#method-i-changed
|
51
56
|
# @see https://ruby-doc.org/stdlib-2.7.0/libdoc/observer/rdoc/Observable.html#method-i-notify_observers
|
52
57
|
#
|
53
|
-
def notify_observers(
|
54
|
-
|
55
|
-
|
56
|
-
super
|
58
|
+
def notify_observers(*args, **kwargs, &block)
|
59
|
+
observers.each { |observer, method| observer.__send__(method, *args, **kwargs, &block) }
|
57
60
|
end
|
58
61
|
|
59
62
|
##
|
@@ -64,7 +67,7 @@ module ConvenientService
|
|
64
67
|
return unless other.instance_of?(self.class)
|
65
68
|
|
66
69
|
return false if type != other.type
|
67
|
-
return false if
|
70
|
+
return false if observers != other.observers
|
68
71
|
|
69
72
|
true
|
70
73
|
end
|
@@ -74,13 +77,8 @@ module ConvenientService
|
|
74
77
|
##
|
75
78
|
# @return [Hash]
|
76
79
|
#
|
77
|
-
|
78
|
-
|
79
|
-
# @internal
|
80
|
-
# IMPORTANT: This method is using inherited private instance varaible. Ruby may change its name without any warning.
|
81
|
-
#
|
82
|
-
def observer_peers
|
83
|
-
@observer_peers if defined? @observer_peers
|
80
|
+
def observers
|
81
|
+
@observers ||= {}
|
84
82
|
end
|
85
83
|
end
|
86
84
|
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module Core
|
5
|
+
module Entities
|
6
|
+
class Config
|
7
|
+
module Entities
|
8
|
+
class MethodMiddlewares
|
9
|
+
module Entities
|
10
|
+
module Middlewares
|
11
|
+
class Chain < Middlewares::Base
|
12
|
+
module Commands
|
13
|
+
##
|
14
|
+
# - Single splat `*` converts `nil` to empty array.
|
15
|
+
# - Double splat `**` raises on `nil`.
|
16
|
+
# - Umpersand `&` converts `nil` to `nil`.
|
17
|
+
#
|
18
|
+
# The following middleware converts `env[:kwargs]` to a hash.
|
19
|
+
# This way `__send__(:next, *env[:args], **env[:kwargs], &env[:block])` won't fail even if a user passes `nil` as `kwargs`.
|
20
|
+
#
|
21
|
+
# Check the following link for more details:
|
22
|
+
# - https://bugs.ruby-lang.org/issues/8507
|
23
|
+
#
|
24
|
+
class NormalizeEnv < Support::Command
|
25
|
+
##
|
26
|
+
# @!attribute [r] env
|
27
|
+
# @return [Hash, nil]
|
28
|
+
#
|
29
|
+
attr_reader :env
|
30
|
+
|
31
|
+
##
|
32
|
+
# @param env [Hash, nil]
|
33
|
+
# @return [void]
|
34
|
+
#
|
35
|
+
def initialize(env:)
|
36
|
+
@env = env.to_h
|
37
|
+
end
|
38
|
+
|
39
|
+
##
|
40
|
+
# @return [Hash]
|
41
|
+
#
|
42
|
+
def call
|
43
|
+
env.merge(args: env[:args].to_a, kwargs: env[:kwargs].to_h, block: env[:block])
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|