convenient_service 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dev/.tmuxinator.yml +4 -0
- data/.github/workflows/ci.yml +2 -0
- data/.gitignore +18 -0
- data/.vscode/CacheItsValue.code-snippets +15 -0
- data/.vscode/DelegateTo.code-snippets +15 -0
- data/.vscode/cache_its_value.code-snippets +17 -0
- data/.vscode/comparison.code-snippets +41 -0
- data/.vscode/delegate_to.code-snippets +20 -0
- data/Appraisals +24 -2
- data/CHANGELOG.md +138 -0
- data/Gemfile +11 -6
- data/README.md +11 -3
- data/ROADMAP.md +5 -1
- data/Taskfile.yml +260 -55
- data/benchmark/commit_config/ips.rb +18 -0
- data/benchmark/commit_config/profile.rb +30 -0
- data/benchmark/empty_service/ips.rb +123 -0
- data/benchmark/has_committed_config/ips.rb +78 -0
- data/benchmark/has_committed_config/profile.rb +30 -0
- data/convenient_service.gemspec +125 -4
- data/gemfiles/.gitkeep +0 -0
- data/lib/convenient_service/alias.rb +3 -0
- data/lib/convenient_service/aliases.rb +0 -4
- data/lib/convenient_service/common/plugins/assigns_attributes_in_constructor/using_active_model_attribute_assignment/middleware.rb +3 -1
- data/lib/convenient_service/common/plugins/caches_constructor_arguments/concern.rb +22 -0
- data/lib/convenient_service/common/plugins/caches_constructor_arguments/middleware.rb +22 -0
- data/lib/convenient_service/common/plugins/caches_constructor_arguments.rb +4 -0
- data/lib/convenient_service/common/plugins/caches_return_value/middleware.rb +12 -8
- data/lib/convenient_service/common/plugins/can_be_copied/concern.rb +22 -5
- data/lib/convenient_service/common/plugins/can_have_user_provided_entity/commands/find_or_create_entity.rb +9 -7
- data/lib/convenient_service/common/plugins/can_have_user_provided_entity/{errors.rb → exceptions.rb} +4 -4
- data/lib/convenient_service/common/plugins/can_have_user_provided_entity.rb +1 -1
- data/lib/convenient_service/common/plugins/can_utilize_finite_loop/concern.rb +40 -0
- data/lib/convenient_service/common/plugins/can_utilize_finite_loop/constants.rb +21 -0
- data/lib/convenient_service/common/plugins/can_utilize_finite_loop.rb +4 -0
- data/lib/convenient_service/common/plugins/has_around_callbacks/{errors.rb → exceptions.rb} +2 -2
- data/lib/convenient_service/common/plugins/has_around_callbacks/middleware.rb +9 -3
- data/lib/convenient_service/common/plugins/has_around_callbacks.rb +1 -1
- data/lib/convenient_service/common/plugins/has_callbacks/entities/callback.rb +1 -1
- data/lib/convenient_service/common/plugins/has_callbacks/middleware.rb +7 -1
- data/lib/convenient_service/common/plugins/has_constructor/concern.rb +3 -4
- data/lib/convenient_service/common/plugins/has_constructor_without_initialize/concern.rb +1 -9
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/has_cache/concern.rb +1 -1
- data/lib/convenient_service/common/plugins/has_j_send_result_duck_short_syntax/concern.rb +68 -0
- data/lib/convenient_service/common/plugins/has_j_send_result_duck_short_syntax.rb +3 -0
- data/lib/convenient_service/common/plugins/normalizes_env/middleware.rb +3 -1
- data/lib/convenient_service/common/plugins.rb +2 -1
- data/lib/convenient_service/configs/awesome_print_inspect/aliases.rb +7 -0
- data/lib/convenient_service/configs/awesome_print_inspect.rb +59 -0
- data/lib/convenient_service/configs/minimal.rb +67 -5
- data/lib/convenient_service/configs/standard.rb +92 -30
- data/lib/convenient_service/core/aliases.rb +4 -5
- data/lib/convenient_service/core/concern/class_methods.rb +129 -0
- data/lib/convenient_service/core/concern/instance_methods.rb +76 -0
- data/lib/convenient_service/core/concern.rb +25 -0
- data/lib/convenient_service/core/entities/config/commands/track_method_missing_commit_trigger.rb +2 -2
- data/lib/convenient_service/core/entities/config/entities/concerns/entities/middleware/commands/cast_middleware.rb +2 -2
- data/lib/convenient_service/core/entities/config/entities/concerns/entities/middleware.rb +1 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/commands/cast_caller.rb +2 -2
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/concern/instance_methods.rb +9 -2
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/constants.rb +26 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller.rb +1 -3
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/concern/instance_methods.rb +10 -3
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/base.rb +95 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable/entities/event.rb +95 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable/entities.rb +3 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable.rb +42 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/with.rb +50 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators.rb +6 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/commands/create_observable_middleware.rb +104 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/commands.rb +3 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/concern/class_methods.rb +115 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/concern/instance_methods.rb +70 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/concern.rb +32 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/constants.rb +36 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/structs/intended_method.rb +23 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/structs.rb +3 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base.rb +26 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands/create_observable_middleware.rb +90 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands.rb +3 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/class_methods.rb +37 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/instance_methods.rb +115 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern.rb +32 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/entities/method_chain.rb +86 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/entities.rb +3 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain.rb +34 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/classic.rb +42 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares.rb +6 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/stack.rb +46 -11
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities.rb +2 -3
- data/lib/convenient_service/core/entities/config/entities/method_middlewares.rb +1 -1
- data/lib/convenient_service/core/entities/config/{errors.rb → exceptions.rb} +3 -3
- data/lib/convenient_service/core/entities/config.rb +19 -6
- data/lib/convenient_service/core/entities.rb +0 -1
- data/lib/convenient_service/core.rb +7 -5
- data/lib/convenient_service/dependencies/built_in.rb +11 -4
- data/lib/convenient_service/dependencies/extractions/active_support_backtrace_cleaner/backtrace_cleaner.rb +149 -0
- data/lib/convenient_service/dependencies/extractions/active_support_backtrace_cleaner.rb +15 -0
- data/lib/convenient_service/dependencies/extractions/active_support_concern/concern.rb +4 -3
- data/lib/convenient_service/dependencies/extractions/active_support_concern.rb +4 -3
- data/lib/convenient_service/dependencies.rb +256 -18
- data/lib/convenient_service/examples/dry/gemfile/dry_service/config.rb +19 -21
- data/lib/convenient_service/examples/dry/gemfile/services/assert_file_exists.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/assert_file_not_empty.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/assert_node_available.rb +2 -2
- data/lib/convenient_service/examples/dry/gemfile/services/assert_npm_package_available.rb +2 -2
- data/lib/convenient_service/examples/dry/gemfile/services/assert_valid_ruby_syntax.rb +2 -2
- data/lib/convenient_service/examples/dry/gemfile/services/format.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/format_body.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/format_gems_with_envs.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/format_gems_without_envs.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/format_header.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/parse_content.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb +11 -4
- data/lib/convenient_service/examples/dry/gemfile/services/read_file_content.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/{run_shell.rb → run_shell_command.rb} +10 -5
- data/lib/convenient_service/examples/dry/gemfile/services/strip_comments.rb +2 -2
- data/lib/convenient_service/examples/dry/gemfile/services.rb +3 -2
- data/lib/convenient_service/examples/dry/gemfile.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile/rails_service/config.rb +28 -30
- data/lib/convenient_service/examples/rails/gemfile/services/assert_file_exists.rb +2 -2
- data/lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb +2 -2
- data/lib/convenient_service/examples/rails/gemfile/services/assert_node_available.rb +2 -2
- data/lib/convenient_service/examples/rails/gemfile/services/assert_npm_package_available.rb +3 -3
- data/lib/convenient_service/examples/rails/gemfile/services/assert_valid_ruby_syntax.rb +2 -2
- data/lib/convenient_service/examples/rails/gemfile/services/format.rb +2 -2
- data/lib/convenient_service/examples/rails/gemfile/services/format_body.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile/services/format_gems_with_envs.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile/services/format_gems_without_envs.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile/services/format_header.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile/services/merge_sections.rb +3 -3
- data/lib/convenient_service/examples/rails/gemfile/services/parse_content.rb +2 -2
- data/lib/convenient_service/examples/rails/gemfile/services/print_shell_command.rb +11 -4
- data/lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb +2 -2
- data/lib/convenient_service/examples/rails/gemfile/services/replace_file_content.rb +3 -3
- data/lib/convenient_service/examples/rails/gemfile/services/{run_shell.rb → run_shell_command.rb} +11 -6
- data/lib/convenient_service/examples/rails/gemfile/services/strip_comments.rb +3 -3
- data/lib/convenient_service/examples/rails/gemfile/services.rb +2 -2
- data/lib/convenient_service/examples/rails/gemfile.rb +1 -1
- data/lib/convenient_service/examples/standard/cowsay/services/build_cloud.rb +1 -1
- data/lib/convenient_service/examples/standard/cowsay/services/build_cow.rb +1 -1
- data/lib/convenient_service/examples/standard/cowsay/services/print.rb +1 -1
- data/lib/convenient_service/examples/standard/cowsay.rb +1 -1
- data/lib/convenient_service/examples/standard/date_time/services/safe_parse.rb +31 -0
- data/lib/convenient_service/examples/standard/date_time/services.rb +3 -0
- data/lib/convenient_service/examples/standard/date_time.rb +23 -0
- data/lib/convenient_service/examples/standard/factorial/services/calculate.rb +49 -0
- data/lib/convenient_service/examples/standard/factorial/services.rb +3 -0
- data/lib/convenient_service/examples/standard/factorial/utils/timeout/with_timeout.rb +50 -0
- data/lib/convenient_service/examples/standard/factorial/utils/timeout.rb +21 -0
- data/lib/convenient_service/examples/standard/factorial/utils.rb +3 -0
- data/lib/convenient_service/examples/standard/factorial.rb +24 -0
- data/lib/convenient_service/examples/standard/gemfile/services/assert_file_exists.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/assert_node_available.rb +2 -2
- data/lib/convenient_service/examples/standard/gemfile/services/assert_npm_package_available.rb +2 -2
- data/lib/convenient_service/examples/standard/gemfile/services/assert_valid_ruby_syntax.rb +2 -2
- data/lib/convenient_service/examples/standard/gemfile/services/format.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/format_body.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/format_gems_with_envs.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/format_gems_without_envs.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/format_header.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/merge_sections.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/parse_content.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/print_shell_command.rb +15 -8
- data/lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb +2 -2
- data/lib/convenient_service/examples/standard/gemfile/services/replace_file_content.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/{run_shell.rb → run_shell_command.rb} +22 -5
- data/lib/convenient_service/examples/standard/gemfile/services/strip_comments.rb +2 -2
- data/lib/convenient_service/examples/standard/gemfile/services.rb +2 -2
- data/lib/convenient_service/examples/standard/gemfile.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/constants.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/entities/description.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/entities/format.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/entities/id.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/entities/logger.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/entities/request.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/entities/source.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/entities/tag.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/entities/title.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/services/apply_default_param_values.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/services/cast_params.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_body.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/services/extract_params_from_path.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/services/filter_out_unpermitted_params.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/services/log_request_params.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/services/merge_params.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/services/prepare.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/services/validate_casted_params.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/services/validate_uncasted_params.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/utils/array/wrap.rb +2 -2
- data/lib/convenient_service/examples/standard/request_params/utils/array.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/utils/http/request/parse_body.rb +2 -2
- data/lib/convenient_service/examples/standard/request_params/utils/http/request/parse_path.rb +2 -2
- data/lib/convenient_service/examples/standard/request_params/utils/http/request.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/utils/integer/safe_parse.rb +2 -2
- data/lib/convenient_service/examples/standard/request_params/utils/integer.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/utils/json/safe_parse.rb +2 -2
- data/lib/convenient_service/examples/standard/request_params/utils/json.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/utils/object/blank.rb +2 -2
- data/lib/convenient_service/examples/standard/request_params/utils/object/present.rb +2 -2
- data/lib/convenient_service/examples/standard/request_params/utils/object.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params/utils/url/valid.rb +47 -0
- data/lib/convenient_service/examples/standard/request_params/utils/url.rb +21 -0
- data/lib/convenient_service/examples/standard/request_params/utils.rb +1 -0
- data/lib/convenient_service/examples/standard/request_params.rb +1 -1
- data/lib/convenient_service/exception.rb +16 -0
- data/lib/convenient_service/feature.rb +0 -1
- data/lib/convenient_service/logger.rb +69 -24
- data/lib/convenient_service/rspec/helpers/custom/ignoring_exception/exceptions.rb +27 -0
- data/lib/convenient_service/rspec/helpers/custom/ignoring_exception.rb +51 -0
- data/lib/convenient_service/rspec/helpers/custom/stub_service/entities/result_spec.rb +2 -2
- data/lib/convenient_service/rspec/helpers/custom/stub_service/entities/stubbed_service.rb +20 -16
- data/lib/convenient_service/rspec/helpers/custom/wrap_method/entities/wrapped_method.rb +110 -53
- data/lib/convenient_service/rspec/helpers/custom/wrap_method/{errors.rb → exceptions.rb} +2 -2
- data/lib/convenient_service/rspec/helpers/custom/wrap_method.rb +31 -7
- data/lib/convenient_service/rspec/helpers/custom.rb +1 -1
- data/lib/convenient_service/rspec/helpers/{ignoring_error.rb → ignoring_exception.rb} +3 -3
- data/lib/convenient_service/rspec/helpers.rb +2 -2
- data/lib/convenient_service/rspec/matchers/custom/be_descendant_of.rb +1 -1
- data/lib/convenient_service/rspec/matchers/custom/cache_its_value.rb +20 -0
- data/lib/convenient_service/rspec/matchers/custom/call_chain_next.rb +103 -2
- data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings/sub_matchers/return_its_value.rb +3 -0
- data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_concrete_arguments.rb +1 -1
- data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings_collection/{errors.rb → exceptions.rb} +4 -4
- data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings_collection.rb +11 -11
- data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher.rb +5 -5
- data/lib/convenient_service/rspec/matchers/custom/delegate_to.rb +13 -3
- data/lib/convenient_service/rspec/matchers/custom/export.rb +9 -9
- data/lib/convenient_service/rspec/matchers/custom/have_abstract_method.rb +1 -1
- data/lib/convenient_service/rspec/matchers/custom/have_alias_method.rb +3 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/constants.rb +9 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/chain.rb +226 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_code_part.rb +61 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_data_part.rb +61 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_message_part.rb +61 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_parts.rb +121 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_service_part.rb +61 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_status_part.rb +68 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_expected_step_part.rb +61 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_got_parts.rb +98 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_got_service_part.rb +68 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands/generate_got_step_part.rb +68 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base/commands.rb +13 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/base.rb +207 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/error/commands/generate_got_jsend_attributes_part.rb +120 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/error/commands.rb +3 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/error.rb +34 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/failure/commands/generate_got_jsend_attributes_part.rb +121 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/failure/commands.rb +3 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/failure.rb +34 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/null.rb +147 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb +96 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/success/commands.rb +3 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers/success.rb +34 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/printers.rb +46 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result.rb +121 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_code.rb +97 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_data.rb +97 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_message.rb +97 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_service.rb +81 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_status.rb +92 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_step.rb +127 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands/validate_result_type.rb +89 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator/commands.rb +10 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities/validator.rb +123 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/entities.rb +5 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/{errors.rb → exceptions.rb} +8 -2
- data/lib/convenient_service/rspec/matchers/custom/results/base.rb +112 -149
- data/lib/convenient_service/rspec/matchers/custom/results/be_error.rb +6 -1
- data/lib/convenient_service/rspec/matchers/custom/results/be_failure.rb +6 -1
- data/lib/convenient_service/rspec/matchers/custom/results/be_not_error.rb +7 -2
- data/lib/convenient_service/rspec/matchers/custom/results/be_not_failure.rb +7 -2
- data/lib/convenient_service/rspec/matchers/custom/results/be_not_success.rb +7 -2
- data/lib/convenient_service/rspec/matchers/custom/results/be_success.rb +6 -1
- data/lib/convenient_service/rspec/matchers/results/be_error.rb +3 -0
- data/lib/convenient_service/rspec/matchers/results/be_failure.rb +3 -0
- data/lib/convenient_service/rspec/matchers/results/be_not_error.rb +3 -0
- data/lib/convenient_service/rspec/matchers/results/be_not_failure.rb +3 -0
- data/lib/convenient_service/rspec/matchers/results/be_not_success.rb +3 -0
- data/lib/convenient_service/rspec/matchers/results/be_success.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_fallback/concern.rb +93 -0
- data/lib/convenient_service/service/plugins/can_have_fallback/exceptions.rb +36 -0
- data/lib/convenient_service/service/plugins/can_have_fallback/middleware.rb +30 -0
- data/lib/convenient_service/service/plugins/can_have_fallback.rb +5 -0
- data/lib/convenient_service/service/plugins/can_have_method_steps/middleware.rb +5 -24
- data/lib/convenient_service/service/plugins/can_have_steps/concern.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method.rb +5 -5
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method_factory.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb +2 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb +96 -26
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/alias.rb +2 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/base.rb +49 -7
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/proc.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/raw.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/reassignment.rb +2 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/usual.rb +2 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/base.rb +27 -4
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/input.rb +2 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/output.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/base.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb +31 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/name.rb +31 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/{errors.rb → exceptions.rb} +81 -15
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/class_methods.rb +46 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb +64 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/service/concern.rb +28 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/service.rb +7 -30
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb +39 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/extract_params.rb +2 -4
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb +229 -64
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/{errors.rb → exceptions.rb} +3 -3
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_completed/concern.rb +44 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_completed.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed/middleware.rb +36 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_printed/middleware.rb +32 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_printed.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/concern.rb +37 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step.rb +6 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed/exceptions.rb +38 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed/middleware.rb +72 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed.rb +4 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/concern.rb +30 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step.rb +5 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback/concern.rb +53 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback/middleware.rb +34 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback/result.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback.rb +4 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_parent_result/middleware.rb +4 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect/concern.rb +45 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_inspect/concern.rb +5 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins.rb +4 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/structs/params.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/middleware.rb +38 -9
- data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/fetch_all_services_stubbed_results_cache.rb +30 -0
- data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/fetch_service_stubbed_results_cache.rb +43 -0
- data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/get_service_stubbed_result.rb +58 -0
- data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/set_service_stubbed_result.rb +66 -0
- data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands.rb +6 -0
- data/lib/convenient_service/service/plugins/can_have_stubbed_results/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/can_have_stubbed_results/container.rb +17 -0
- data/lib/convenient_service/service/plugins/can_have_stubbed_results/middleware.rb +65 -0
- data/lib/convenient_service/service/plugins/can_have_stubbed_results.rb +6 -0
- data/lib/convenient_service/service/plugins/can_recalculate_result/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/collects_services_in_exception/commands/extract_service_details.rb +64 -0
- data/lib/convenient_service/service/plugins/collects_services_in_exception/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/collects_services_in_exception/constants.rb +16 -0
- data/lib/convenient_service/service/plugins/collects_services_in_exception/middleware.rb +50 -0
- data/lib/convenient_service/service/plugins/collects_services_in_exception.rb +5 -0
- data/lib/convenient_service/service/plugins/counts_stubbed_results_invocations/middleware.rb +24 -0
- data/lib/convenient_service/service/plugins/counts_stubbed_results_invocations.rb +3 -0
- data/lib/convenient_service/service/plugins/has_awesome_print_inspect/concern.rb +39 -0
- data/lib/convenient_service/service/plugins/has_awesome_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_inspect/concern.rb +8 -1
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/commands/create_result_class.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/commands/is_result.rb +34 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/commands.rb +2 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/concern/class_methods.rb +21 -18
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/concern/instance_methods.rb +13 -12
- data/lib/convenient_service/service/plugins/has_j_send_result/concern.rb +22 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/constants.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/container.rb +21 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/aliases.rb +7 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_own_result/concern.rb +142 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_own_result.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_stubbed_result/concern.rb +30 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_stubbed_result.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status/concern.rb +30 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status/middleware.rb +43 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_checked_status.rb +4 -0
- data/lib/convenient_service/service/plugins/{has_result/entities/result/plugins/has_step → has_j_send_result/entities/result/plugins/can_have_fallback}/concern.rb +7 -4
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_fallback.rb +3 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_have_parent_result/concern.rb +8 -5
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_have_parent_result/constants.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_have_parent_result.rb +0 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_step/concern.rb +30 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_step.rb +3 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_recalculate_result/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect/concern.rb +38 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_inspect/concern.rb +2 -3
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/commands/cast_j_send_attributes.rb +99 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/commands/create_code_class.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/commands/create_data_class.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/commands/create_message_class.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/commands/create_status_class.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/concern/class_methods.rb +125 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/concern/instance_methods.rb +58 -14
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/commands/is_code.rb +49 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/class_methods.rb +14 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb +123 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/aliases.rb +7 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_awesome_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_awesome_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_inspect/concern.rb +38 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins.rb +5 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/code.rb +3 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/commands/is_data.rb +49 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/class_methods.rb +14 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/instance_methods.rb +183 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/aliases.rb +7 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_awesome_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_awesome_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_inspect/commands/generate_inspect_output.rb +77 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_inspect/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_inspect/concern.rb +41 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_inspect.rb +4 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins.rb +5 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/data.rb +3 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/commands/is_message.rb +49 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/class_methods.rb +14 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb +116 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/aliases.rb +7 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_awesome_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_awesome_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_inspect/concern.rb +38 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins.rb +5 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/message.rb +3 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/commands/is_status.rb +49 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/class_methods.rb +14 -2
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb +31 -6
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/aliases.rb +7 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_awesome_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_awesome_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_inspect/concern.rb +38 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins.rb +5 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities/status.rb +3 -1
- data/lib/convenient_service/service/plugins/{has_result/entities/result/plugins/has_j_send_status_and_attributes/errors.rb → has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/exceptions.rb} +3 -3
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/middleware.rb +5 -3
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/structs/j_send_attributes.rb +2 -2
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter/concern.rb +30 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter/middleware.rb +38 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter.rb +4 -0
- data/lib/convenient_service/service/plugins/{has_result/entities/result/plugins/raises_on_not_checked_result_status/errors.rb → has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/exceptions.rb} +3 -3
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +47 -0
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/raises_on_not_checked_result_status.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins.rb +6 -3
- data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/exceptions.rb +21 -0
- data/lib/convenient_service/service/plugins/has_j_send_result.rb +8 -0
- data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_active_model_validations/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_active_model_validations/middleware.rb +4 -2
- data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_dry_validation/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_dry_validation/middleware.rb +5 -3
- data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error/commands/assert_args_count_lower_than_three.rb +2 -2
- data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error/commands/assert_either_args_or_kwargs_are_passed.rb +2 -2
- data/lib/convenient_service/service/plugins/{has_result_short_syntax/error/errors.rb → has_j_send_result_short_syntax/error/exceptions.rb} +4 -4
- data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error/middleware.rb +5 -3
- data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/commands/assert_kwargs_contain_only_j_send_keys.rb +53 -0
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/exceptions.rb +29 -0
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/middleware.rb +23 -0
- data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/failure.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/success/commands/refute_kwargs_contain_data_and_extra_keys.rb +2 -2
- data/lib/convenient_service/service/plugins/{has_result_short_syntax/success/errors.rb → has_j_send_result_short_syntax/success/exceptions.rb} +3 -3
- data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/success/middleware.rb +5 -3
- data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/success.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax.rb +6 -0
- data/lib/convenient_service/service/plugins/{has_result_status_check_short_syntax → has_j_send_result_status_check_short_syntax}/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result_status_check_short_syntax.rb +3 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/concern.rb +24 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_lines.rb +94 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_method_step_lines.rb +115 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_result_lines.rb +105 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_service_lines.rb +88 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_service_step_lines.rb +127 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands.rb +7 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb +90 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb +144 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/template.rb +85 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities.rb +5 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/templates/flowchart.html.erb +95 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart.rb +108 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/entities.rb +3 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart.rb +4 -0
- data/lib/convenient_service/service/plugins/has_result/concern.rb +17 -6
- data/lib/convenient_service/service/plugins/has_result/exceptions.rb +21 -0
- data/lib/convenient_service/service/plugins/has_result.rb +1 -5
- data/lib/convenient_service/service/plugins/raises_on_double_result/{errors.rb → exceptions.rb} +2 -2
- data/lib/convenient_service/service/plugins/raises_on_double_result/middleware.rb +11 -9
- data/lib/convenient_service/service/plugins/raises_on_double_result.rb +1 -1
- data/lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb +24 -0
- data/lib/convenient_service/service/plugins/raises_on_not_result_return_value/middleware.rb +25 -0
- data/lib/convenient_service/service/plugins/raises_on_not_result_return_value.rb +4 -0
- data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/middleware.rb +38 -4
- data/lib/convenient_service/service/plugins/sets_parent_to_foreign_result/middleware.rb +56 -0
- data/lib/convenient_service/service/plugins/sets_parent_to_foreign_result.rb +3 -0
- data/lib/convenient_service/service/plugins/wraps_result_in_db_transaction/middleware.rb +3 -1
- data/lib/convenient_service/service/plugins.rb +14 -6
- data/lib/convenient_service/support/abstract_method/{errors.rb → exceptions.rb} +2 -2
- data/lib/convenient_service/support/abstract_method.rb +2 -2
- data/lib/convenient_service/support/cache/constants.rb +36 -0
- data/lib/convenient_service/support/cache/entities/caches/array/entities/pair.rb +52 -0
- data/lib/convenient_service/support/cache/entities/caches/array/entities.rb +3 -0
- data/lib/convenient_service/support/cache/entities/caches/array.rb +135 -0
- data/lib/convenient_service/support/cache/entities/caches/base.rb +112 -0
- data/lib/convenient_service/support/cache/entities/caches/hash.rb +113 -0
- data/lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb +89 -0
- data/lib/convenient_service/support/cache/entities/caches.rb +8 -0
- data/lib/convenient_service/support/cache/entities/key.rb +102 -0
- data/lib/convenient_service/support/cache/entities.rb +4 -0
- data/lib/convenient_service/support/cache/exceptions.rb +34 -0
- data/lib/convenient_service/support/cache.rb +16 -143
- data/lib/convenient_service/support/castable/{errors.rb → exceptions.rb} +3 -3
- data/lib/convenient_service/support/castable.rb +2 -2
- data/lib/convenient_service/support/command.rb +42 -3
- data/lib/convenient_service/support/copyable.rb +7 -23
- data/lib/convenient_service/support/counter.rb +7 -8
- data/lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb +2 -2
- data/lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb +8 -8
- data/lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb +2 -2
- data/lib/convenient_service/support/dependency_container/entities/method.rb +49 -12
- data/lib/convenient_service/support/dependency_container/entities/method_collection.rb +3 -3
- data/lib/convenient_service/support/dependency_container/{errors.rb → exceptions.rb} +5 -5
- data/lib/convenient_service/support/dependency_container/export.rb +4 -4
- data/lib/convenient_service/support/dependency_container/import.rb +7 -4
- data/lib/convenient_service/support/dependency_container.rb +1 -1
- data/lib/convenient_service/support/finite_loop.rb +8 -8
- data/lib/convenient_service/support/gems/logger.rb +37 -0
- data/lib/convenient_service/support/gems/paint.rb +37 -0
- data/lib/convenient_service/support/gems.rb +2 -0
- data/lib/convenient_service/support/safe_method.rb +1 -1
- data/lib/convenient_service/support/thread_safe_counter.rb +9 -0
- data/lib/convenient_service/support.rb +1 -0
- data/lib/convenient_service/utils/array/contain_exactly.rb +1 -5
- data/lib/convenient_service/utils/array/{errors.rb → exceptions.rb} +2 -2
- data/lib/convenient_service/utils/array/limited_push.rb +54 -0
- data/lib/convenient_service/utils/array/merge.rb +3 -3
- data/lib/convenient_service/utils/array.rb +6 -1
- data/lib/convenient_service/utils/class/display_name.rb +49 -0
- data/lib/convenient_service/utils/class.rb +20 -0
- data/lib/convenient_service/utils/hash/assert_valid_keys.rb +50 -0
- data/lib/convenient_service/utils/hash/except.rb +1 -1
- data/lib/convenient_service/utils/hash/triple_equality_compare.rb +51 -0
- data/lib/convenient_service/utils/hash.rb +10 -0
- data/lib/convenient_service/utils/method/defined.rb +50 -6
- data/lib/convenient_service/utils/module/class_method_defined.rb +22 -2
- data/lib/convenient_service/utils/module/get_own_instance_method.rb +3 -0
- data/lib/convenient_service/utils/module/instance_method_defined.rb +22 -2
- data/lib/convenient_service/utils/object/clamp_class.rb +77 -0
- data/lib/convenient_service/utils/object/duck_class.rb +112 -0
- data/lib/convenient_service/utils/object/memoize_including_falsy_values.rb +1 -1
- data/lib/convenient_service/utils/object.rb +19 -10
- data/lib/convenient_service/utils/string/truncate.rb +69 -0
- data/lib/convenient_service/utils/string.rb +5 -0
- data/lib/convenient_service/utils.rb +21 -0
- data/lib/convenient_service/version.rb +1 -1
- data/lib/convenient_service.rb +14 -7
- data/minitest.rb +30 -0
- metadata +575 -153
- data/lib/convenient_service/common/plugins/caches_constructor_params/concern.rb +0 -22
- data/lib/convenient_service/common/plugins/caches_constructor_params/entities/constructor_params.rb +0 -34
- data/lib/convenient_service/common/plugins/caches_constructor_params/entities.rb +0 -3
- data/lib/convenient_service/common/plugins/caches_constructor_params/middleware.rb +0 -17
- data/lib/convenient_service/common/plugins/caches_constructor_params.rb +0 -5
- data/lib/convenient_service/core/class_methods.rb +0 -96
- data/lib/convenient_service/core/entities/classic_middleware.rb +0 -32
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/chain.rb +0 -71
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware.rb +0 -131
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creator.rb +0 -62
- data/lib/convenient_service/core/instance_methods.rb +0 -56
- data/lib/convenient_service/error.rb +0 -16
- data/lib/convenient_service/rspec/helpers/custom/ignoring_error.rb +0 -32
- data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_method_step.rb +0 -74
- data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_result_method_step.rb +0 -66
- data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb +0 -48
- data/lib/convenient_service/rspec/matchers/custom/results/base/commands/generate_expected_step_part.rb +0 -42
- data/lib/convenient_service/rspec/matchers/custom/results/base/commands/generate_got_step_part.rb +0 -42
- data/lib/convenient_service/rspec/matchers/custom/results/base/commands/match_result_step.rb +0 -89
- data/lib/convenient_service/rspec/matchers/custom/results/base/commands.rb +0 -10
- data/lib/convenient_service/service/plugins/can_have_result_step/middleware.rb +0 -43
- data/lib/convenient_service/service/plugins/can_have_result_step.rb +0 -3
- data/lib/convenient_service/service/plugins/can_have_steps/entities/service/class_methods.rb +0 -32
- data/lib/convenient_service/service/plugins/can_have_stubbed_result/concern.rb +0 -59
- data/lib/convenient_service/service/plugins/can_have_stubbed_result/middleware.rb +0 -36
- data/lib/convenient_service/service/plugins/can_have_stubbed_result.rb +0 -4
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/aliases.rb +0 -7
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/initialize/middleware.rb +0 -27
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/initialize.rb +0 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/to_kwargs/middleware.rb +0 -25
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/to_kwargs.rb +0 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands/cast_j_send_attributes.rb +0 -37
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/concern/class_methods.rb +0 -69
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb +0 -65
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/instance_methods.rb +0 -94
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb +0 -58
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax/concern.rb +0 -62
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax.rb +0 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/initialize/middleware.rb +0 -27
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/initialize.rb +0 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/to_kwargs/middleware.rb +0 -25
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step/to_kwargs.rb +0 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_step.rb +0 -5
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/marks_result_status_as_checked/middleware.rb +0 -25
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/marks_result_status_as_checked.rb +0 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +0 -33
- data/lib/convenient_service/service/plugins/has_result/errors.rb +0 -34
- data/lib/convenient_service/service/plugins/has_result/middleware.rb +0 -19
- data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/commands/refute_kwargs_contain_data_and_extra_keys.rb +0 -29
- data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/errors.rb +0 -28
- data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/middleware.rb +0 -19
- data/lib/convenient_service/service/plugins/has_result_short_syntax/success/commands.rb +0 -3
- data/lib/convenient_service/service/plugins/has_result_short_syntax.rb +0 -6
- data/lib/convenient_service/service/plugins/has_result_status_check_short_syntax.rb +0 -3
- data/lib/convenient_service/services/run_method_in_organizer.rb +0 -28
- data/lib/convenient_service/services/run_own_method_in_organizer.rb +0 -64
- data/lib/convenient_service/support/cache/key.rb +0 -100
- data/lib/convenient_service/utils/object/resolve_class.rb +0 -56
- /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/can_recalculate_result.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_inspect.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/commands.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/entities.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities/result/plugins/has_j_send_status_and_attributes/structs.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result → has_j_send_result}/entities.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_active_model_validations.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_params_validations → has_j_send_result_params_validations}/using_dry_validation.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_short_syntax → has_j_send_result_short_syntax}/error/commands.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_short_syntax/failure → has_j_send_result_short_syntax/success}/commands.rb +0 -0
data/Taskfile.yml
CHANGED
@@ -15,7 +15,96 @@ version: '3'
|
|
15
15
|
tasks:
|
16
16
|
default:
|
17
17
|
cmds:
|
18
|
-
- task:
|
18
|
+
- task: test
|
19
|
+
|
20
|
+
##
|
21
|
+
# NOTE: `task console` is also aliased as `task playground`.
|
22
|
+
#
|
23
|
+
console:
|
24
|
+
cmds:
|
25
|
+
- bundle exec rake playground
|
26
|
+
interactive: true
|
27
|
+
|
28
|
+
##
|
29
|
+
# NOTE: `task console:all` is also aliased as `task playground:all`.
|
30
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
31
|
+
#
|
32
|
+
console:all:
|
33
|
+
cmds:
|
34
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
35
|
+
vars:
|
36
|
+
APPRAISAL_NAME:
|
37
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "all"].join("_")'
|
38
|
+
interactive: true
|
39
|
+
|
40
|
+
##
|
41
|
+
# NOTE: `task console:dry` is also aliased as `task playground:dry`.
|
42
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
43
|
+
#
|
44
|
+
console:dry:
|
45
|
+
cmds:
|
46
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
47
|
+
vars:
|
48
|
+
APPRAISAL_NAME:
|
49
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "dry"].join("_")'
|
50
|
+
interactive: true
|
51
|
+
|
52
|
+
##
|
53
|
+
# NOTE: `task console:rails_5.2` is also aliased as `task playground:rails_5.2`.
|
54
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
55
|
+
#
|
56
|
+
console:rails_5.2:
|
57
|
+
cmds:
|
58
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
59
|
+
vars:
|
60
|
+
APPRAISAL_NAME:
|
61
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_5.2"].join("_")'
|
62
|
+
interactive: true
|
63
|
+
|
64
|
+
##
|
65
|
+
# NOTE: `task console:rails_6.0` is also aliased as `task playground:rails_6.0`.
|
66
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
67
|
+
#
|
68
|
+
console:rails_6.0:
|
69
|
+
cmds:
|
70
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
71
|
+
vars:
|
72
|
+
APPRAISAL_NAME:
|
73
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.0"].join("_")'
|
74
|
+
interactive: true
|
75
|
+
|
76
|
+
##
|
77
|
+
# NOTE: `task console:rails_6.1` is also aliased as `task playground:rails_6.1`.
|
78
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
79
|
+
#
|
80
|
+
console:rails_6.1:
|
81
|
+
cmds:
|
82
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
83
|
+
vars:
|
84
|
+
APPRAISAL_NAME:
|
85
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.1"].join("_")'
|
86
|
+
interactive: true
|
87
|
+
|
88
|
+
##
|
89
|
+
# NOTE: `task console:rails_7.0` is also aliased as `task playground:rails_7.0`.
|
90
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
91
|
+
#
|
92
|
+
console:rails_7.0:
|
93
|
+
cmds:
|
94
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
95
|
+
vars:
|
96
|
+
APPRAISAL_NAME:
|
97
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_7.0"].join("_")'
|
98
|
+
interactive: true
|
99
|
+
|
100
|
+
##
|
101
|
+
# NOTE: `task console:standard` is also aliased as `task playground:standard`.
|
102
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
103
|
+
#
|
104
|
+
console:standard:
|
105
|
+
cmds:
|
106
|
+
- bundle exec rake playground
|
107
|
+
interactive: true
|
19
108
|
|
20
109
|
coverage:lcov:merge:
|
21
110
|
cmds:
|
@@ -32,6 +121,9 @@ tasks:
|
|
32
121
|
cmds:
|
33
122
|
- task: deps:install
|
34
123
|
|
124
|
+
##
|
125
|
+
# NOTE: `task deps:install` is also aliased as `task install`.
|
126
|
+
#
|
35
127
|
deps:install:
|
36
128
|
cmds:
|
37
129
|
- bundle install
|
@@ -43,6 +135,18 @@ tasks:
|
|
43
135
|
- rm Gemfile*.lock
|
44
136
|
- rm -rf gemfiles
|
45
137
|
|
138
|
+
##
|
139
|
+
# NOTE: JRuby 9.4 aims CRuby 3.1 compatibility.
|
140
|
+
# - https://www.jruby.org/download
|
141
|
+
#
|
142
|
+
docker:bash:jruby_9.4:
|
143
|
+
cmds:
|
144
|
+
- docker run --rm -it -v $(pwd):/gem convenient_service:jruby-9.4 bash
|
145
|
+
interactive: true
|
146
|
+
preconditions:
|
147
|
+
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
|
148
|
+
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
|
149
|
+
|
46
150
|
docker:bash:ruby_2.7:
|
47
151
|
cmds:
|
48
152
|
- docker run --rm -it -v $(pwd):/gem convenient_service:2.7 bash
|
@@ -75,18 +179,6 @@ tasks:
|
|
75
179
|
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
|
76
180
|
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
|
77
181
|
|
78
|
-
##
|
79
|
-
# NOTE: JRuby 9.4 aims CRuby 3.1 compatibility.
|
80
|
-
# - https://www.jruby.org/download
|
81
|
-
#
|
82
|
-
docker:bash:jruby_9.4:
|
83
|
-
cmds:
|
84
|
-
- docker run --rm -it -v $(pwd):/gem convenient_service:jruby-9.4 bash
|
85
|
-
interactive: true
|
86
|
-
preconditions:
|
87
|
-
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
|
88
|
-
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
|
89
|
-
|
90
182
|
##
|
91
183
|
# NOTE: TruffleRuby 22.3 aims CRuby 3.1 compatibility.
|
92
184
|
# - https://github.com/oracle/truffleruby/blob/master/doc/user/compatibility.md
|
@@ -111,6 +203,27 @@ tasks:
|
|
111
203
|
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
|
112
204
|
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
|
113
205
|
|
206
|
+
##
|
207
|
+
# NOTE: JRuby 9.4 aims CRuby 3.1 compatibility.
|
208
|
+
# - https://www.jruby.org/download
|
209
|
+
#
|
210
|
+
docker:build:jruby_9.4:
|
211
|
+
cmds:
|
212
|
+
##
|
213
|
+
# NOTE: Meaning of `|| 2> /dev/null`.
|
214
|
+
# https://stackoverflow.com/a/10250395/12201472
|
215
|
+
#
|
216
|
+
# NOTE: Meaning of `|| true`.
|
217
|
+
# https://superuser.com/a/887349/1180656
|
218
|
+
#
|
219
|
+
- rm Gemfile.jruby-9.4 2> /dev/null || true
|
220
|
+
- rm Gemfile.jruby-9.4.lock 2> /dev/null || true
|
221
|
+
- cp Gemfile Gemfile.jruby-9.4
|
222
|
+
- docker build . -f docker/jruby-9.4/Dockerfile -t convenient_service:jruby-9.4
|
223
|
+
preconditions:
|
224
|
+
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
|
225
|
+
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
|
226
|
+
|
114
227
|
docker:build:ruby_2.7:
|
115
228
|
cmds:
|
116
229
|
##
|
@@ -179,27 +292,6 @@ tasks:
|
|
179
292
|
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
|
180
293
|
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
|
181
294
|
|
182
|
-
##
|
183
|
-
# NOTE: JRuby 9.4 aims CRuby 3.1 compatibility.
|
184
|
-
# - https://www.jruby.org/download
|
185
|
-
#
|
186
|
-
docker:build:jruby_9.4:
|
187
|
-
cmds:
|
188
|
-
##
|
189
|
-
# NOTE: Meaning of `|| 2> /dev/null`.
|
190
|
-
# https://stackoverflow.com/a/10250395/12201472
|
191
|
-
#
|
192
|
-
# NOTE: Meaning of `|| true`.
|
193
|
-
# https://superuser.com/a/887349/1180656
|
194
|
-
#
|
195
|
-
- rm Gemfile.jruby-9.4 2> /dev/null || true
|
196
|
-
- rm Gemfile.jruby-9.4.lock 2> /dev/null || true
|
197
|
-
- cp Gemfile Gemfile.jruby-9.4
|
198
|
-
- docker build . -f docker/jruby-9.4/Dockerfile -t convenient_service:jruby-9.4
|
199
|
-
preconditions:
|
200
|
-
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
|
201
|
-
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
|
202
|
-
|
203
295
|
##
|
204
296
|
# NOTE: TruffleRuby 22.3 aims CRuby 3.1 compatibility.
|
205
297
|
# - https://github.com/oracle/truffleruby/blob/master/doc/user/compatibility.md
|
@@ -229,13 +321,6 @@ tasks:
|
|
229
321
|
cmds:
|
230
322
|
- open -a Docker
|
231
323
|
|
232
|
-
##
|
233
|
-
# NOTE: Dev only command.
|
234
|
-
#
|
235
|
-
editor:open:
|
236
|
-
cmds:
|
237
|
-
- code .
|
238
|
-
|
239
324
|
##
|
240
325
|
# NOTE: `sdoc` (wrapper for `rdoc`) is replaced by `yard`, since you have a feeling like every time is a first time with `rdoc`.
|
241
326
|
# - https://kapeli.com/cheat_sheets/Yard.docset/Contents/Resources/Documents/index
|
@@ -263,8 +348,7 @@ tasks:
|
|
263
348
|
|
264
349
|
docs:lint:
|
265
350
|
cmds:
|
266
|
-
-
|
267
|
-
- bundle exec yard-junk --text --html docs/junk-yard.html
|
351
|
+
- task: yard_junk
|
268
352
|
|
269
353
|
docs:missed:
|
270
354
|
cmds:
|
@@ -280,6 +364,13 @@ tasks:
|
|
280
364
|
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
|
281
365
|
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
|
282
366
|
|
367
|
+
##
|
368
|
+
# NOTE: Dev only command.
|
369
|
+
#
|
370
|
+
editor:open:
|
371
|
+
cmds:
|
372
|
+
- code .
|
373
|
+
|
283
374
|
##
|
284
375
|
# NOTE: A trailing "/**" matches everything inside.
|
285
376
|
# https://git-scm.com/docs/gitignore
|
@@ -296,46 +387,120 @@ tasks:
|
|
296
387
|
cmds:
|
297
388
|
- open -na "Google Chrome" --args --new-window --incognito "https://github.com/marian13/convenient_service"
|
298
389
|
|
390
|
+
##
|
391
|
+
# NOTE: `task install` is also aliased as `task deps:install`.
|
392
|
+
#
|
393
|
+
install:
|
394
|
+
cmds:
|
395
|
+
- task: deps:install
|
396
|
+
|
299
397
|
lint:
|
300
398
|
cmds:
|
301
399
|
- task: rubocop
|
302
400
|
- task: docs:lint
|
303
401
|
|
402
|
+
lint:autocorrect:
|
403
|
+
cmds:
|
404
|
+
- task: rubocop:autocorrect
|
405
|
+
|
406
|
+
##
|
407
|
+
# TODO: Add to CI.
|
408
|
+
#
|
409
|
+
minitest:
|
410
|
+
cmds:
|
411
|
+
- bundle exec ruby minitest.rb
|
412
|
+
|
413
|
+
##
|
414
|
+
# - https://github.com/mbj/mutant/blob/main/docs/mutant-rspec.md#run-through-example
|
415
|
+
#
|
416
|
+
mutant:
|
417
|
+
cmds:
|
418
|
+
- bundle exec mutant run --include lib --require convenient_service --integration rspec -- 'ConvenientService*'
|
419
|
+
|
420
|
+
##
|
421
|
+
# NOTE: `task playground` is also aliased as `task console`.
|
422
|
+
#
|
304
423
|
playground:
|
305
424
|
cmds:
|
306
425
|
- bundle exec rake playground
|
307
426
|
interactive: true
|
308
427
|
|
428
|
+
##
|
429
|
+
# NOTE: `task playground:all` is also aliased as `task console:all`.
|
430
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
431
|
+
#
|
309
432
|
playground:all:
|
310
433
|
cmds:
|
311
|
-
- bundle exec appraisal
|
434
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
435
|
+
vars:
|
436
|
+
APPRAISAL_NAME:
|
437
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "all"].join("_")'
|
312
438
|
interactive: true
|
313
439
|
|
440
|
+
##
|
441
|
+
# NOTE: `task playground:dry` is also aliased as `task console:dry`.
|
442
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
443
|
+
#
|
314
444
|
playground:dry:
|
315
445
|
cmds:
|
316
|
-
- bundle exec appraisal
|
446
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
447
|
+
vars:
|
448
|
+
APPRAISAL_NAME:
|
449
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "dry"].join("_")'
|
317
450
|
interactive: true
|
318
451
|
|
452
|
+
##
|
453
|
+
# NOTE: `task playground:rails_5.2` is also aliased as `task console:rails_5.2`.
|
454
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
455
|
+
#
|
319
456
|
playground:rails_5.2:
|
320
457
|
cmds:
|
321
|
-
- bundle exec appraisal
|
458
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
459
|
+
vars:
|
460
|
+
APPRAISAL_NAME:
|
461
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_5.2"].join("_")'
|
322
462
|
interactive: true
|
323
463
|
|
464
|
+
##
|
465
|
+
# NOTE: `task playground:rails_6.0` is also aliased as `task console:rails_6.0`.
|
466
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
467
|
+
#
|
324
468
|
playground:rails_6.0:
|
325
469
|
cmds:
|
326
|
-
- bundle exec appraisal
|
470
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
471
|
+
vars:
|
472
|
+
APPRAISAL_NAME:
|
473
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.0"].join("_")'
|
327
474
|
interactive: true
|
328
475
|
|
476
|
+
##
|
477
|
+
# NOTE: `task playground:rails_6.1` is also aliased as `task console:rails_6.1`.
|
478
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
479
|
+
#
|
329
480
|
playground:rails_6.1:
|
330
481
|
cmds:
|
331
|
-
- bundle exec appraisal
|
482
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
483
|
+
vars:
|
484
|
+
APPRAISAL_NAME:
|
485
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.1"].join("_")'
|
332
486
|
interactive: true
|
333
487
|
|
488
|
+
##
|
489
|
+
# NOTE: `task playground:rails_7.0` is also aliased as `task console:rails_7.0`.
|
490
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
491
|
+
#
|
334
492
|
playground:rails_7.0:
|
335
493
|
cmds:
|
336
|
-
- bundle exec appraisal
|
494
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
|
495
|
+
vars:
|
496
|
+
APPRAISAL_NAME:
|
497
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_7.0"].join("_")'
|
337
498
|
interactive: true
|
338
499
|
|
500
|
+
##
|
501
|
+
# NOTE: `task playground:standard` is also aliased as `task console:standard`.
|
502
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
503
|
+
#
|
339
504
|
playground:standard:
|
340
505
|
cmds:
|
341
506
|
- bundle exec rake playground
|
@@ -367,9 +532,15 @@ tasks:
|
|
367
532
|
- task: rspec:rails_7.0:staged
|
368
533
|
- task: rspec:dry:staged
|
369
534
|
|
535
|
+
##
|
536
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
537
|
+
#
|
370
538
|
rspec:dry:
|
371
539
|
cmds:
|
372
|
-
- bundle exec appraisal
|
540
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rspec --format progress --require dry_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
|
541
|
+
vars:
|
542
|
+
APPRAISAL_NAME:
|
543
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "dry"].join("_")'
|
373
544
|
|
374
545
|
rspec:dry:staged:
|
375
546
|
- task: rspec:dry
|
@@ -380,9 +551,15 @@ tasks:
|
|
380
551
|
#
|
381
552
|
sh: task git:staged:specs --silent
|
382
553
|
|
554
|
+
##
|
555
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
556
|
+
#
|
383
557
|
rspec:rails_5.2:
|
384
558
|
cmds:
|
385
|
-
- bundle exec appraisal
|
559
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
|
560
|
+
vars:
|
561
|
+
APPRAISAL_NAME:
|
562
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_5.2"].join("_")'
|
386
563
|
|
387
564
|
rspec:rails_5.2:staged:
|
388
565
|
- task: rspec:rails_5.2
|
@@ -393,9 +570,15 @@ tasks:
|
|
393
570
|
#
|
394
571
|
sh: task git:staged:specs --silent
|
395
572
|
|
573
|
+
##
|
574
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
575
|
+
#
|
396
576
|
rspec:rails_6.0:
|
397
577
|
cmds:
|
398
|
-
- bundle exec appraisal
|
578
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
|
579
|
+
vars:
|
580
|
+
APPRAISAL_NAME:
|
581
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.0"].join("_")'
|
399
582
|
|
400
583
|
rspec:rails_6.0:staged:
|
401
584
|
- task: rspec:rails_6.0
|
@@ -406,9 +589,15 @@ tasks:
|
|
406
589
|
#
|
407
590
|
sh: task git:staged:specs --silent
|
408
591
|
|
592
|
+
##
|
593
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
594
|
+
#
|
409
595
|
rspec:rails_6.1:
|
410
596
|
cmds:
|
411
|
-
- bundle exec appraisal
|
597
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
|
598
|
+
vars:
|
599
|
+
APPRAISAL_NAME:
|
600
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.1"].join("_")'
|
412
601
|
|
413
602
|
rspec:rails_6.1:staged:
|
414
603
|
- task: rspec:rails_6.1
|
@@ -419,9 +608,15 @@ tasks:
|
|
419
608
|
#
|
420
609
|
sh: task git:staged:specs --silent
|
421
610
|
|
611
|
+
##
|
612
|
+
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
|
613
|
+
#
|
422
614
|
rspec:rails_7.0:
|
423
615
|
cmds:
|
424
|
-
- bundle exec appraisal
|
616
|
+
- bundle exec appraisal {{.APPRAISAL_NAME}} rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
|
617
|
+
vars:
|
618
|
+
APPRAISAL_NAME:
|
619
|
+
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_7.0"].join("_")'
|
425
620
|
|
426
621
|
rspec:rails_7.0:staged:
|
427
622
|
- task: rspec:rails_7.0
|
@@ -450,13 +645,23 @@ tasks:
|
|
450
645
|
cmds:
|
451
646
|
- bundle exec rubocop --config .rubocop.yml {{.CLI_ARGS}}
|
452
647
|
|
453
|
-
rubocop:
|
648
|
+
rubocop:autocorrect:
|
454
649
|
cmds:
|
455
650
|
- bundle exec rubocop --config .rubocop.yml -A {{.CLI_ARGS}}
|
456
651
|
|
652
|
+
test:
|
653
|
+
cmds:
|
654
|
+
- task: rspec
|
655
|
+
- task: minitest
|
656
|
+
|
457
657
|
##
|
458
658
|
# NOTE: Dev only command.
|
459
659
|
#
|
460
660
|
tmuxinator:start:
|
461
661
|
cmds:
|
462
662
|
- tmuxinator start convenient_service --project-config=.dev/.tmuxinator.yml
|
663
|
+
|
664
|
+
yard_junk:
|
665
|
+
cmds:
|
666
|
+
- mkdir -p docs
|
667
|
+
- bundle exec yard-junk --text --html docs/junk-yard.html
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "convenient_service"
|
5
|
+
require "benchmark/ips"
|
6
|
+
|
7
|
+
class Service
|
8
|
+
include ConvenientService::Standard::Config
|
9
|
+
end
|
10
|
+
|
11
|
+
Service.commit_config! # Warmup.
|
12
|
+
|
13
|
+
Benchmark.ips do |x|
|
14
|
+
x.time = 10 # Seconds.
|
15
|
+
x.warmup = 0 # No additional warmup required. It is already performed outside.
|
16
|
+
|
17
|
+
x.report("`.commit_config?`") { Service.commit_config! }
|
18
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "convenient_service"
|
5
|
+
require "stackprof"
|
6
|
+
|
7
|
+
class Service
|
8
|
+
include ConvenientService::Standard::Config
|
9
|
+
end
|
10
|
+
|
11
|
+
Service.commit_config!
|
12
|
+
|
13
|
+
##
|
14
|
+
# Quotes:
|
15
|
+
# - stackprof will tell you what is impeding your progress.
|
16
|
+
# - The assumption is the more times something shows up in the sample the more time it is taking.
|
17
|
+
#
|
18
|
+
# Docs:
|
19
|
+
# - https://www.johnnunemaker.com/how-to-benchmark-your-ruby-gem
|
20
|
+
# - https://github.com/tmm1/stackprof
|
21
|
+
#
|
22
|
+
profile = StackProf.run(mode: :wall, interval: 1_000) do
|
23
|
+
2_000_000.times { Service.commit_config! }
|
24
|
+
end
|
25
|
+
|
26
|
+
result = StackProf::Report.new(profile)
|
27
|
+
puts
|
28
|
+
result.print_text
|
29
|
+
puts "\n\n\n"
|
30
|
+
result.print_method(/commit_config!/)
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "service_actor"
|
5
|
+
require "interactor"
|
6
|
+
require "trailblazer/operation"
|
7
|
+
require "active_interaction"
|
8
|
+
require "light-service"
|
9
|
+
require "mutations"
|
10
|
+
require "convenient_service"
|
11
|
+
require "benchmark/ips"
|
12
|
+
|
13
|
+
##
|
14
|
+
# Imaginary no gem service. Used as unattainable standard.
|
15
|
+
#
|
16
|
+
class NoGemService
|
17
|
+
Result = Struct.new(:success?, :data)
|
18
|
+
|
19
|
+
def self.result(**kwargs)
|
20
|
+
new(**kwargs).result
|
21
|
+
end
|
22
|
+
|
23
|
+
def result
|
24
|
+
Result.new
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def success(**kwargs)
|
30
|
+
Result.new(success?: true, data: kwargs)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# ServiceActor - Composable Ruby service objects.
|
36
|
+
# - https://github.com/sunny/actor
|
37
|
+
#
|
38
|
+
class ActorService < Actor
|
39
|
+
def call
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Interactor - Interactor provides a common interface for performing complex user interactions.
|
45
|
+
# - https://github.com/collectiveidea/interactor
|
46
|
+
#
|
47
|
+
class InteractorService
|
48
|
+
include Interactor
|
49
|
+
|
50
|
+
def call
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Trailblazer-operation - Trailblazer's Operation implementation.
|
56
|
+
# - https://trailblazer.to/2.1/docs/operation.html#operation-overview
|
57
|
+
# - https://github.com/trailblazer/trailblazer-operation
|
58
|
+
#
|
59
|
+
class TrailblazerService < Trailblazer::Operation
|
60
|
+
step :result
|
61
|
+
|
62
|
+
def result(options, *)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
##
|
67
|
+
# ActiveInteraction - Manage application specific business logic.
|
68
|
+
# - https://github.com/AaronLasseigne/active_interaction
|
69
|
+
#
|
70
|
+
class ActiveInteractionService < ActiveInteraction::Base
|
71
|
+
def execute
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# LightService - Series of Actions with an emphasis on simplicity.
|
77
|
+
# - https://github.com/adomokos/light-service
|
78
|
+
#
|
79
|
+
class LightServiceService
|
80
|
+
extend ::LightService::Action
|
81
|
+
|
82
|
+
executed do |context|
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Mutations - Compose your business logic into commands that sanitize and validate input.
|
88
|
+
# - https://github.com/cypriss/mutations
|
89
|
+
#
|
90
|
+
class MutationsService < Mutations::Command
|
91
|
+
def execute
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Convenient Service - Service object pattern implementation in Ruby.
|
97
|
+
# - https://github.com/marian13/convenient_service
|
98
|
+
#
|
99
|
+
class ConvenientServiceService
|
100
|
+
include ConvenientService::Standard::Config
|
101
|
+
|
102
|
+
def result
|
103
|
+
success
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
ConvenientServiceService.commit_config! # Warmup.
|
108
|
+
|
109
|
+
Benchmark.ips do |x|
|
110
|
+
x.time = 10 # Seconds.
|
111
|
+
x.warmup = 0 # No additional warmup required. It is already performed outside.
|
112
|
+
|
113
|
+
x.report("Empty service - Without any gem") { NoGemService.result }
|
114
|
+
x.report("Empty service - With Actor") { ActorService.call }
|
115
|
+
x.report("Empty service - With Interactor") { InteractorService.call }
|
116
|
+
x.report("Empty service - With Trailblazer Operation") { TrailblazerService.call }
|
117
|
+
x.report("Empty service - With ActiveInteraction") { ActiveInteractionService.run! }
|
118
|
+
x.report("Empty service - With LightService") { LightServiceService.execute }
|
119
|
+
x.report("Empty service - With Mutations") { MutationsService.run }
|
120
|
+
x.report("Empty service - With Convenient Service") { ConvenientServiceService.result }
|
121
|
+
|
122
|
+
x.compare!(order: :baseline)
|
123
|
+
end
|