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
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "dependencies/built_in"
|
4
4
|
require_relative "dependencies/extractions"
|
5
|
+
require_relative "dependencies/queries"
|
5
6
|
|
6
7
|
##
|
7
8
|
# `ConvenientService::Dependencies` can dynamically require plugins/extensions that have external dependencies.
|
@@ -11,435 +12,6 @@ require_relative "dependencies/extractions"
|
|
11
12
|
#
|
12
13
|
module ConvenientService
|
13
14
|
module Dependencies
|
14
|
-
|
15
|
-
##
|
16
|
-
# @api private
|
17
|
-
#
|
18
|
-
# @return [Boolean]
|
19
|
-
# @see ConvenientService.Dependencies.require_has_j_send_result_params_validations_using_active_model_validations
|
20
|
-
#
|
21
|
-
def support_has_j_send_result_params_validations_using_active_model_validations?
|
22
|
-
return false unless active_model.loaded?
|
23
|
-
return false if ruby.version >= 3.0 && active_model.version < 6.0
|
24
|
-
|
25
|
-
true
|
26
|
-
end
|
27
|
-
|
28
|
-
##
|
29
|
-
# @api private
|
30
|
-
#
|
31
|
-
# @return [Boolean]
|
32
|
-
#
|
33
|
-
# @see https://github.com/ruby/logger/commit/74690b87b15244e19dd91cd06ae295251e1e5781
|
34
|
-
#
|
35
|
-
def support_logger_non_integer_levels?
|
36
|
-
logger.version >= "1.3.0"
|
37
|
-
end
|
38
|
-
|
39
|
-
##
|
40
|
-
# @api public
|
41
|
-
#
|
42
|
-
# @return [Boolean]
|
43
|
-
# @note Expected to be called from app entry points like `initializers` in Rails.
|
44
|
-
#
|
45
|
-
def require_alias
|
46
|
-
require_relative "alias"
|
47
|
-
end
|
48
|
-
|
49
|
-
##
|
50
|
-
# @api public
|
51
|
-
#
|
52
|
-
# @return [Boolean]
|
53
|
-
# @note Expected to be called from app entry points like `initializers` in Rails.
|
54
|
-
#
|
55
|
-
def require_assigns_attributes_in_constructor_using_active_model_attribute_assignment
|
56
|
-
##
|
57
|
-
# - https://edgeguides.rubyonrails.org/active_model_basics.html
|
58
|
-
# - https://api.rubyonrails.org/classes/ActiveModel.html
|
59
|
-
# - https://github.com/rails/rails/tree/main/activemodel
|
60
|
-
#
|
61
|
-
require "active_model"
|
62
|
-
|
63
|
-
require_relative "common/plugins/assigns_attributes_in_constructor/using_active_model_attribute_assignment"
|
64
|
-
end
|
65
|
-
|
66
|
-
##
|
67
|
-
# @api public
|
68
|
-
#
|
69
|
-
# @return [Boolean]
|
70
|
-
# @note Expected to be called from app entry points like `initializers` in Rails.
|
71
|
-
#
|
72
|
-
def require_assigns_attributes_in_constructor_using_dry_initializer
|
73
|
-
##
|
74
|
-
# - https://dry-rb.org/gems/dry-initializer/main
|
75
|
-
# - https://github.com/dry-rb/dry-initializer
|
76
|
-
#
|
77
|
-
require "dry-initializer"
|
78
|
-
|
79
|
-
require_relative "common/plugins/assigns_attributes_in_constructor/using_dry_initializer"
|
80
|
-
end
|
81
|
-
|
82
|
-
##
|
83
|
-
# @api public
|
84
|
-
#
|
85
|
-
# @return [Boolean]
|
86
|
-
# @note Expected to be called from app entry points like `initializers` in Rails.
|
87
|
-
#
|
88
|
-
def require_can_utilize_finite_loop
|
89
|
-
require_relative "common/plugins/can_utilize_finite_loop"
|
90
|
-
end
|
91
|
-
|
92
|
-
##
|
93
|
-
# @api public
|
94
|
-
#
|
95
|
-
# @return [Boolean]
|
96
|
-
# @note Expected to be called from app entry points like `initializers` in Rails.
|
97
|
-
#
|
98
|
-
def require_has_attributes_using_active_model_attributes
|
99
|
-
##
|
100
|
-
# - https://edgeguides.rubyonrails.org/active_model_basics.html
|
101
|
-
# - https://api.rubyonrails.org/classes/ActiveModel.html
|
102
|
-
# - https://github.com/rails/rails/tree/main/activemodel
|
103
|
-
#
|
104
|
-
require "active_model"
|
105
|
-
|
106
|
-
require_relative "common/plugins/has_attributes/using_active_model_attributes"
|
107
|
-
end
|
108
|
-
|
109
|
-
##
|
110
|
-
# @api public
|
111
|
-
#
|
112
|
-
# @return [Boolean]
|
113
|
-
# @note Expected to be called from app entry points like `initializers` in Rails.
|
114
|
-
#
|
115
|
-
def require_awesome_print_inspect
|
116
|
-
##
|
117
|
-
# - https://github.com/awesome-print/awesome_print
|
118
|
-
#
|
119
|
-
require "awesome_print"
|
120
|
-
|
121
|
-
require_relative "service/plugins/has_awesome_print_inspect"
|
122
|
-
require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect"
|
123
|
-
require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_awesome_print_inspect"
|
124
|
-
require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_awesome_print_inspect"
|
125
|
-
require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_awesome_print_inspect"
|
126
|
-
require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_awesome_print_inspect"
|
127
|
-
require_relative "service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect"
|
128
|
-
require_relative "service/configs/awesome_print_inspect"
|
129
|
-
require_relative "service/configs/awesome_print_inspect/aliases"
|
130
|
-
end
|
131
|
-
|
132
|
-
##
|
133
|
-
# @api public
|
134
|
-
#
|
135
|
-
# @return [Boolean]
|
136
|
-
# @note Expected to be called from app entry points like `initializers` in Rails.
|
137
|
-
#
|
138
|
-
# @see https://userdocs.convenientservice.org/troubleshooting/i18n_translate_wrong_number_of_arguments
|
139
|
-
#
|
140
|
-
def require_has_j_send_result_params_validations_using_active_model_validations
|
141
|
-
##
|
142
|
-
# - https://edgeguides.rubyonrails.org/active_model_basics.html
|
143
|
-
# - https://api.rubyonrails.org/classes/ActiveModel.html
|
144
|
-
# - https://github.com/rails/rails/tree/main/activemodel
|
145
|
-
#
|
146
|
-
require "active_model"
|
147
|
-
|
148
|
-
require_relative "service/plugins/has_j_send_result_params_validations/using_active_model_validations"
|
149
|
-
end
|
150
|
-
|
151
|
-
##
|
152
|
-
# @api public
|
153
|
-
#
|
154
|
-
# @return [Boolean]
|
155
|
-
# @note Expected to be called from app entry points like `initializers` in Rails.
|
156
|
-
#
|
157
|
-
def require_has_j_send_result_params_validations_using_dry_validation
|
158
|
-
##
|
159
|
-
# - https://dry-rb.org/gems/dry-validation/main/
|
160
|
-
# - https://github.com/dry-rb/dry-validation
|
161
|
-
#
|
162
|
-
require "dry-validation"
|
163
|
-
|
164
|
-
require_relative "service/plugins/has_j_send_result_params_validations/using_dry_validation"
|
165
|
-
end
|
166
|
-
|
167
|
-
##
|
168
|
-
# @api public
|
169
|
-
#
|
170
|
-
# @return [Boolean]
|
171
|
-
# @note Expected to be called from app entry points like `initializers` in Rails.
|
172
|
-
#
|
173
|
-
def require_rescues_result_unhandled_exceptions
|
174
|
-
require_relative "service/plugins/rescues_result_unhandled_exceptions"
|
175
|
-
end
|
176
|
-
|
177
|
-
##
|
178
|
-
# @api public
|
179
|
-
#
|
180
|
-
# @return [Boolean]
|
181
|
-
# @note Expected to be called from app entry points like `initializers` in Rails.
|
182
|
-
#
|
183
|
-
def require_cleans_exception_backtrace
|
184
|
-
require_relative "dependencies/extractions/active_support_backtrace_cleaner"
|
185
|
-
end
|
186
|
-
|
187
|
-
##
|
188
|
-
# @api private
|
189
|
-
#
|
190
|
-
# @return [Boolean]
|
191
|
-
# @note Expected to be called from `irb`, `pry`, `spec_helper.rb`, etc.
|
192
|
-
#
|
193
|
-
# @internal
|
194
|
-
# NOTE: `byebug` has C extensions, that is why it is NOT supported in JRuby.
|
195
|
-
# - https://github.com/deivid-rodriguez/byebug/tree/master/ext/byebug
|
196
|
-
# - https://github.com/deivid-rodriguez/byebug/issues/179#issuecomment-152727003
|
197
|
-
#
|
198
|
-
def require_development_tools
|
199
|
-
##
|
200
|
-
# - https://github.com/awesome-print/awesome_print
|
201
|
-
#
|
202
|
-
require "awesome_print"
|
203
|
-
|
204
|
-
##
|
205
|
-
# - https://github.com/gsamokovarov/break
|
206
|
-
#
|
207
|
-
require "break"
|
208
|
-
|
209
|
-
##
|
210
|
-
# - https://github.com/deivid-rodriguez/byebug
|
211
|
-
#
|
212
|
-
require "byebug" unless ruby.jruby?
|
213
|
-
|
214
|
-
##
|
215
|
-
# - https://github.com/ruby/debug
|
216
|
-
#
|
217
|
-
require "debug" unless ruby.jruby?
|
218
|
-
|
219
|
-
##
|
220
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/ostruct/rdoc/OpenStruct.html
|
221
|
-
# - https://github.com/ruby/ostruct
|
222
|
-
#
|
223
|
-
require "ostruct"
|
224
|
-
|
225
|
-
##
|
226
|
-
# - https://github.com/janlelis/paint
|
227
|
-
#
|
228
|
-
require "paint"
|
229
|
-
|
230
|
-
##
|
231
|
-
# - https://github.com/rouge-ruby/rouge
|
232
|
-
#
|
233
|
-
require "rouge"
|
234
|
-
|
235
|
-
##
|
236
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/tempfile/rdoc/Tempfile.html
|
237
|
-
# - https://github.com/ruby/tempfile
|
238
|
-
#
|
239
|
-
require "tempfile"
|
240
|
-
|
241
|
-
##
|
242
|
-
# - https://gist.github.com/marian13/5dade20a431d7254db30e543167058ce
|
243
|
-
#
|
244
|
-
require_relative "dependencies/extractions/byebug_syntax_highlighting" unless ruby.jruby?
|
245
|
-
|
246
|
-
require_relative "dependencies/extractions/b" unless ruby.jruby?
|
247
|
-
|
248
|
-
##
|
249
|
-
#
|
250
|
-
#
|
251
|
-
require_relative "dependencies/extractions/ce"
|
252
|
-
end
|
253
|
-
|
254
|
-
##
|
255
|
-
# @api private
|
256
|
-
#
|
257
|
-
# @return [Boolean]
|
258
|
-
# @note Expected to be called from `spec_helper.rb`.
|
259
|
-
#
|
260
|
-
def require_test_tools
|
261
|
-
##
|
262
|
-
# - https://github.com/faker-ruby/faker
|
263
|
-
#
|
264
|
-
require "faker"
|
265
|
-
|
266
|
-
##
|
267
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/ostruct/rdoc/OpenStruct.html
|
268
|
-
# - https://github.com/ruby/ostruct
|
269
|
-
#
|
270
|
-
require "ostruct"
|
271
|
-
|
272
|
-
##
|
273
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/tempfile/rdoc/Tempfile.html
|
274
|
-
# - https://github.com/ruby/tempfile
|
275
|
-
#
|
276
|
-
require "tempfile"
|
277
|
-
end
|
278
|
-
|
279
|
-
##
|
280
|
-
# @api public
|
281
|
-
#
|
282
|
-
# Loads RSpec extensions like `be_success` matcher, `stub_service` helper, etc.
|
283
|
-
#
|
284
|
-
# @return [Boolean]
|
285
|
-
# @note Expected to be called from `spec_helper.rb`.
|
286
|
-
#
|
287
|
-
def require_rspec_extentions
|
288
|
-
require "rspec/expectations"
|
289
|
-
require "rspec/matchers"
|
290
|
-
require "rspec/mocks"
|
291
|
-
|
292
|
-
require_relative "rspec"
|
293
|
-
end
|
294
|
-
|
295
|
-
##
|
296
|
-
# @api private
|
297
|
-
#
|
298
|
-
# Loads standard config examples.
|
299
|
-
#
|
300
|
-
# @param version [String]
|
301
|
-
# @return [Boolean]
|
302
|
-
#
|
303
|
-
def require_standard_examples(version: "")
|
304
|
-
##
|
305
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/date/rdoc/Date.html
|
306
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/date/rdoc/DateTime.html
|
307
|
-
# - https://github.com/ruby/date
|
308
|
-
#
|
309
|
-
require "date"
|
310
|
-
|
311
|
-
##
|
312
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html
|
313
|
-
# - https://github.com/flori/json
|
314
|
-
#
|
315
|
-
require "json"
|
316
|
-
|
317
|
-
##
|
318
|
-
# - https://github.com/jfelchner/ruby-progressbar
|
319
|
-
#
|
320
|
-
require "progressbar"
|
321
|
-
|
322
|
-
##
|
323
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/webrick/rdoc/WEBrick.html
|
324
|
-
# - https://github.com/ruby/webrick
|
325
|
-
#
|
326
|
-
require "webrick"
|
327
|
-
|
328
|
-
##
|
329
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/uri/rdoc/URI.html
|
330
|
-
# - https://github.com/ruby/uri
|
331
|
-
#
|
332
|
-
require "uri"
|
333
|
-
|
334
|
-
require_relative ::File.join("examples", "standard", version, "cowsay")
|
335
|
-
require_relative ::File.join("examples", "standard", version, "date_time")
|
336
|
-
require_relative ::File.join("examples", "standard", version, "factorial")
|
337
|
-
require_relative ::File.join("examples", "standard", version, "gemfile")
|
338
|
-
require_relative ::File.join("examples", "standard", version, "request_params")
|
339
|
-
end
|
340
|
-
|
341
|
-
##
|
342
|
-
# @api private
|
343
|
-
#
|
344
|
-
# Loads rails config examples.
|
345
|
-
#
|
346
|
-
# @param version [String]
|
347
|
-
# @return [Boolean]
|
348
|
-
#
|
349
|
-
def require_rails_examples(version: "")
|
350
|
-
##
|
351
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html
|
352
|
-
# - https://github.com/flori/json
|
353
|
-
#
|
354
|
-
require "json"
|
355
|
-
|
356
|
-
##
|
357
|
-
# - https://github.com/jfelchner/ruby-progressbar
|
358
|
-
#
|
359
|
-
require "progressbar"
|
360
|
-
|
361
|
-
##
|
362
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/webrick/rdoc/WEBrick.html
|
363
|
-
# - https://github.com/ruby/webrick
|
364
|
-
#
|
365
|
-
require "webrick"
|
366
|
-
|
367
|
-
require_relative ::File.join("examples", "rails", version, "gemfile")
|
368
|
-
end
|
369
|
-
|
370
|
-
##
|
371
|
-
# @api private
|
372
|
-
#
|
373
|
-
# Loads dry config examples.
|
374
|
-
#
|
375
|
-
# @param version [String]
|
376
|
-
# @return [Boolean]
|
377
|
-
#
|
378
|
-
def require_dry_examples(version: "")
|
379
|
-
##
|
380
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html
|
381
|
-
# - https://github.com/flori/json
|
382
|
-
#
|
383
|
-
require "json"
|
384
|
-
|
385
|
-
##
|
386
|
-
# - https://github.com/jfelchner/ruby-progressbar
|
387
|
-
#
|
388
|
-
require "progressbar"
|
389
|
-
|
390
|
-
##
|
391
|
-
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/webrick/rdoc/WEBrick.html
|
392
|
-
# - https://github.com/ruby/webrick
|
393
|
-
#
|
394
|
-
require "webrick"
|
395
|
-
|
396
|
-
require_relative ::File.join("examples", "dry", version, "gemfile")
|
397
|
-
end
|
398
|
-
|
399
|
-
##
|
400
|
-
# @api private
|
401
|
-
#
|
402
|
-
# @return [ConvenientService::Support::Ruby]
|
403
|
-
#
|
404
|
-
def ruby
|
405
|
-
Support::Ruby
|
406
|
-
end
|
407
|
-
|
408
|
-
##
|
409
|
-
# @api private
|
410
|
-
#
|
411
|
-
# @return [ConvenientService::Support::RSpec]
|
412
|
-
#
|
413
|
-
def rspec
|
414
|
-
Support::Gems::RSpec
|
415
|
-
end
|
416
|
-
|
417
|
-
##
|
418
|
-
# @api private
|
419
|
-
#
|
420
|
-
# @return [ConvenientService::Support::Gems::ActiveModel]
|
421
|
-
#
|
422
|
-
def active_model
|
423
|
-
Support::Gems::ActiveModel
|
424
|
-
end
|
425
|
-
|
426
|
-
##
|
427
|
-
# @api private
|
428
|
-
#
|
429
|
-
# @return [ConvenientService::Support::Gems::Logger]
|
430
|
-
#
|
431
|
-
def logger
|
432
|
-
Support::Gems::Logger
|
433
|
-
end
|
434
|
-
|
435
|
-
##
|
436
|
-
# @api private
|
437
|
-
#
|
438
|
-
# @return [ConvenientService::Support::Gems::Paint]
|
439
|
-
#
|
440
|
-
def paint
|
441
|
-
Support::Gems::Paint
|
442
|
-
end
|
443
|
-
end
|
15
|
+
extend Queries
|
444
16
|
end
|
445
17
|
end
|
@@ -36,11 +36,19 @@ module ConvenientService
|
|
36
36
|
# - https://github.com/ruby/logger/blob/v1.5.3/lib/logger.rb#L397
|
37
37
|
#
|
38
38
|
# TODO: Specs for `super(::STDOUT)`.
|
39
|
+
# TODO: Warning and fallback when `CONVENIENT_SERVICE_LOGGER_LEVEL` is NOT valid.
|
39
40
|
#
|
40
41
|
# rubocop:disable Style/GlobalStdStream
|
41
42
|
def new
|
42
43
|
super(::STDOUT).tap do |logger|
|
43
|
-
logger.level =
|
44
|
+
logger.level =
|
45
|
+
if ::ENV["CONVENIENT_SERVICE_DEBUG"] == "true"
|
46
|
+
::Logger::DEBUG
|
47
|
+
elsif ::ENV["CONVENIENT_SERVICE_LOGGER_LEVEL"]
|
48
|
+
::ENV["CONVENIENT_SERVICE_LOGGER_LEVEL"]
|
49
|
+
else
|
50
|
+
::Logger::INFO
|
51
|
+
end
|
44
52
|
|
45
53
|
logger.formatter = (::ENV["CONVENIENT_SERVICE_LOGGER_ENABLE_COLORS"] == "true") ? colored_formatter : original_formatter
|
46
54
|
end
|
@@ -11,6 +11,13 @@ module ConvenientService
|
|
11
11
|
# .with_arguments(*args, **kwargs, &block)
|
12
12
|
# .and_return_its_value
|
13
13
|
#
|
14
|
+
# @internal
|
15
|
+
# TODO:
|
16
|
+
# expect { method.call }
|
17
|
+
# .to call_chain_next.on(method)
|
18
|
+
# .with_arguments(*args, **kwargs, &block)
|
19
|
+
# .and_return { |chain_value| chain_value.copy(kwargs: {overrides: {foo: :bar}})}
|
20
|
+
#
|
14
21
|
class CallChainNext
|
15
22
|
include ::RSpec::Expectations
|
16
23
|
include ::RSpec::Matchers
|
@@ -45,6 +52,10 @@ module ConvenientService
|
|
45
52
|
expect(value).to eq(method.chain_value)
|
46
53
|
end
|
47
54
|
|
55
|
+
if used_and_return?
|
56
|
+
expect(value).to eq(return_block.call(method.chain_value))
|
57
|
+
end
|
58
|
+
|
48
59
|
true
|
49
60
|
end
|
50
61
|
|
@@ -88,6 +99,10 @@ module ConvenientService
|
|
88
99
|
expect(value).not_to eq(method.chain_value)
|
89
100
|
end
|
90
101
|
|
102
|
+
if used_and_return?
|
103
|
+
expect(value).not_to eq(return_block.call(method.chain_value))
|
104
|
+
end
|
105
|
+
|
91
106
|
true
|
92
107
|
end
|
93
108
|
|
@@ -170,6 +185,18 @@ module ConvenientService
|
|
170
185
|
self
|
171
186
|
end
|
172
187
|
|
188
|
+
##
|
189
|
+
# @param args [Array<Object>]
|
190
|
+
# @param block [Proc, nil]
|
191
|
+
#
|
192
|
+
# @return [ConvenientService::RSpec::Matchers::Classes::CallChainNext]
|
193
|
+
#
|
194
|
+
def and_return(*args, &block)
|
195
|
+
chain[:and_return] = args.any? ? proc { args.first } : block
|
196
|
+
|
197
|
+
self
|
198
|
+
end
|
199
|
+
|
173
200
|
private
|
174
201
|
|
175
202
|
##
|
@@ -192,6 +219,13 @@ module ConvenientService
|
|
192
219
|
chain.key?(:and_return_its_value)
|
193
220
|
end
|
194
221
|
|
222
|
+
##
|
223
|
+
# @return [Boolean]
|
224
|
+
#
|
225
|
+
def used_and_return?
|
226
|
+
chain.key?(:and_return)
|
227
|
+
end
|
228
|
+
|
195
229
|
##
|
196
230
|
# @return [Hash{Symbol => Object}]
|
197
231
|
#
|
@@ -242,6 +276,13 @@ module ConvenientService
|
|
242
276
|
@block = chain.dig(:with_arguments, :block)
|
243
277
|
end
|
244
278
|
|
279
|
+
##
|
280
|
+
# @return [Proc]
|
281
|
+
#
|
282
|
+
def return_block
|
283
|
+
@return_block ||= chain[:and_return]
|
284
|
+
end
|
285
|
+
|
245
286
|
##
|
246
287
|
# @return [Proc, nil]
|
247
288
|
#
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module RSpec
|
5
|
+
module PrimitiveMatchers
|
6
|
+
module Classes
|
7
|
+
class DelegateTo
|
8
|
+
module Commands
|
9
|
+
class GeneratePrintableMethod < Support::Command
|
10
|
+
##
|
11
|
+
# @!attribute [r] object
|
12
|
+
# @return [Object] Can be any type.
|
13
|
+
#
|
14
|
+
attr_reader :object
|
15
|
+
|
16
|
+
##
|
17
|
+
# @!attribute [r] method
|
18
|
+
# @return [Symbol, String]
|
19
|
+
#
|
20
|
+
attr_reader :method
|
21
|
+
|
22
|
+
##
|
23
|
+
# @param object [Object] Can by any type.
|
24
|
+
# @param method [Symbol, String]
|
25
|
+
# @return [void]
|
26
|
+
#
|
27
|
+
def initialize(object:, method:)
|
28
|
+
@object = object
|
29
|
+
@method = method
|
30
|
+
end
|
31
|
+
|
32
|
+
def call
|
33
|
+
case Utils::Object.resolve_type(object)
|
34
|
+
when "class", "module"
|
35
|
+
"#{object}.#{method}"
|
36
|
+
when "instance"
|
37
|
+
"#{object.class}##{method}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/delegation.rb
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module RSpec
|
5
|
+
module PrimitiveMatchers
|
6
|
+
module Classes
|
7
|
+
class DelegateTo
|
8
|
+
module Entities
|
9
|
+
class Delegation
|
10
|
+
##
|
11
|
+
# @api private
|
12
|
+
#
|
13
|
+
# @!attribute [r] arguments
|
14
|
+
# @return [ConvenientService::RSpec::PrimitiveMatchers::Classes::DelegateTo::Entities::Delegation]
|
15
|
+
#
|
16
|
+
attr_reader :arguments
|
17
|
+
|
18
|
+
##
|
19
|
+
# @api private
|
20
|
+
#
|
21
|
+
# @!attribute [r] method
|
22
|
+
# @return [Symbol]
|
23
|
+
#
|
24
|
+
attr_reader :method
|
25
|
+
|
26
|
+
##
|
27
|
+
# @api private
|
28
|
+
#
|
29
|
+
# @!attribute [r] object
|
30
|
+
# @return [Object] Can be any type.
|
31
|
+
#
|
32
|
+
attr_reader :object
|
33
|
+
|
34
|
+
##
|
35
|
+
# @api private
|
36
|
+
#
|
37
|
+
# @param object [Object] Can be any type.
|
38
|
+
# @param method [Symbol]
|
39
|
+
# @param args [Array<Object>]
|
40
|
+
# @param kwargs [Hash{Symbol => Object}]
|
41
|
+
# @param block [Proc, nil]
|
42
|
+
# @return [void]
|
43
|
+
#
|
44
|
+
def initialize(object:, method:, args:, kwargs:, block:)
|
45
|
+
@object = object
|
46
|
+
@method = method
|
47
|
+
@arguments = Support::Arguments.new(*args, **kwargs, &block)
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# @api private
|
52
|
+
#
|
53
|
+
# @return [Booleam]
|
54
|
+
#
|
55
|
+
def with_arguments?
|
56
|
+
arguments.any?
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# @api private
|
61
|
+
#
|
62
|
+
# @return [Boolean]
|
63
|
+
#
|
64
|
+
def without_arguments?
|
65
|
+
!with_arguments?
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# @api private
|
70
|
+
#
|
71
|
+
# @param other [Object]
|
72
|
+
# @return [Boolean]
|
73
|
+
#
|
74
|
+
def ==(other)
|
75
|
+
return unless other.instance_of?(self.class)
|
76
|
+
|
77
|
+
return false if object != other.object
|
78
|
+
return false if method != other.method
|
79
|
+
return false if arguments != other.arguments
|
80
|
+
|
81
|
+
true
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|