convenient_service 0.10.1 → 0.12.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 +2 -1
- data/.github/workflows/ci.yml +21 -1
- data/CHANGELOG.md +90 -0
- data/Gemfile +6 -0
- data/README.md +4 -2
- data/Taskfile.yml +94 -0
- data/convenient_service.gemspec +40 -2
- data/docker/2.7/Dockerfile +3 -3
- data/docker/3.0/Dockerfile +2 -2
- data/docker/3.1/Dockerfile +2 -2
- data/docker/3.2/Dockerfile +73 -0
- data/docker/jruby-9.4/Dockerfile +88 -0
- data/docker/truffleruby-22.3/Dockerfile +91 -0
- data/lib/convenient_service/common/plugins/aliases.rb +0 -1
- data/lib/convenient_service/common/plugins/assigns_attributes_in_constructor/using_active_model_attribute_assignment/middleware.rb +12 -8
- data/lib/convenient_service/common/plugins/caches_return_value/middleware.rb +3 -3
- data/lib/convenient_service/common/plugins/can_have_user_provided_entity/errors.rb +2 -2
- data/lib/convenient_service/common/plugins/has_around_callbacks/errors.rb +1 -1
- data/lib/convenient_service/common/plugins/has_callbacks/entities/callback.rb +7 -7
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/aliases.rb +7 -0
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins.rb +2 -0
- data/lib/convenient_service/configs/minimal.rb +23 -4
- data/lib/convenient_service/configs/standard.rb +0 -4
- data/lib/convenient_service/core/class_methods.rb +24 -9
- data/lib/convenient_service/core/constants.rb +36 -0
- data/lib/convenient_service/core/entities/config/commands/track_method_missing_commit_trigger.rb +69 -0
- data/lib/convenient_service/core/entities/config/commands.rb +3 -0
- data/lib/convenient_service/core/entities/config/entities/concerns/entities/stack.rb +10 -10
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/chain.rb +3 -3
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware.rb +18 -1
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creator.rb +62 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/stack.rb +12 -12
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities.rb +1 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares.rb +1 -1
- data/lib/convenient_service/core/entities/config/errors.rb +38 -1
- data/lib/convenient_service/core/entities/config.rb +14 -4
- data/lib/convenient_service/core/instance_methods.rb +6 -4
- data/lib/convenient_service/core.rb +1 -0
- data/lib/convenient_service/dependencies/built_in.rb +7 -0
- data/lib/convenient_service/dependencies/extractions/active_support_concern/concern.rb +18 -2
- data/lib/convenient_service/dependencies/extractions/active_support_concern.rb +4 -0
- data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/builder.rb +7 -1
- data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/logger.rb +7 -1
- data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/runner.rb +15 -1
- data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware.rb +8 -1
- data/lib/convenient_service/dependencies/extractions/ruby_middleware.rb +3 -2
- data/lib/convenient_service/dependencies.rb +16 -15
- data/lib/convenient_service/examples/dry/gemfile.rb +4 -4
- data/lib/convenient_service/examples/rails/gemfile.rb +4 -4
- data/lib/convenient_service/examples/standard/cowsay.rb +4 -4
- 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 +0 -9
- data/lib/convenient_service/examples/standard/gemfile.rb +4 -4
- data/lib/convenient_service/examples/standard/request_params.rb +4 -4
- data/lib/convenient_service/feature.rb +12 -0
- data/lib/convenient_service/logger.rb +6 -5
- data/lib/convenient_service/rspec/helpers/custom/in_threads.rb +74 -0
- data/lib/convenient_service/rspec/helpers/custom/stub_service/constants.rb +20 -0
- data/lib/convenient_service/rspec/helpers/custom/stub_service/entities/stubbed_service.rb +4 -4
- data/lib/convenient_service/rspec/helpers/custom/stub_service.rb +1 -0
- data/lib/convenient_service/rspec/helpers/custom/wrap_method/entities/wrapped_method.rb +3 -3
- data/lib/convenient_service/rspec/helpers/custom/wrap_method/errors.rb +1 -1
- data/lib/convenient_service/rspec/helpers/custom.rb +1 -0
- data/lib/convenient_service/rspec/helpers/in_threads.rb +13 -0
- data/lib/convenient_service/rspec/helpers.rb +2 -0
- data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/chainings_collection/errors.rb +3 -3
- data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher/entities/delegation.rb +3 -3
- data/lib/convenient_service/rspec/matchers/custom/delegate_to/entities/matcher.rb +2 -2
- data/lib/convenient_service/rspec/matchers/custom/export.rb +82 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_method_step.rb +4 -4
- data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_result_method_step.rb +4 -4
- data/lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb +1 -1
- data/lib/convenient_service/rspec/matchers/custom/results/base/constants.rb +22 -0
- data/lib/convenient_service/rspec/matchers/custom/results/base/errors.rb +1 -1
- data/lib/convenient_service/rspec/matchers/custom/results/base.rb +2 -1
- data/lib/convenient_service/rspec/matchers/custom.rb +1 -0
- data/lib/convenient_service/rspec/matchers/export.rb +13 -0
- data/lib/convenient_service/rspec/matchers.rb +2 -0
- data/lib/convenient_service/service/plugins/aliases.rb +0 -2
- data/lib/convenient_service/service/plugins/{has_result_method_steps → can_have_method_steps}/middleware.rb +12 -2
- data/lib/convenient_service/service/plugins/can_have_method_steps.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_result_step/middleware.rb +43 -0
- data/lib/convenient_service/service/plugins/can_have_result_step.rb +3 -0
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/commands/create_step_class.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/concern.rb +10 -10
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method.rb +92 -0
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/commands/cast_method_direction.rb +30 -3
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/cast_method_factory.rb +113 -0
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/commands/define_method_in_container.rb +3 -3
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/commands.rb +1 -3
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/concern/class_methods.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/concern/instance_methods.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/callers/alias.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/callers/base.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/callers/proc.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/callers/raw.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/callers/reassignment/commands/define_method_in_container.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/callers/reassignment.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/callers/usual.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/directions/base.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/directions/input.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/directions/output.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/base.rb +62 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/base.rb +35 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/proc_value.rb +42 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/raw_value.rb +42 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/reassignment_value.rb +42 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/string_value.rb +42 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash/symbol_value.rb +42 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/hash.rb +8 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/method.rb +40 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/reassignment.rb +40 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/string.rb +40 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories/symbol.rb +40 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/factories.rb +8 -0
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/key.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/name.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/values/reassignment.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities.rb +1 -0
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/errors.rb +8 -8
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/service/class_methods.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/service.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/commands/cast_params.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/commands/extract_params.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/concern/instance_methods.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/errors.rb +27 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/aliases.rb +7 -0
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/plugins/can_have_parent_result/middleware.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/plugins/has_inspect/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/plugins.rb +2 -0
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/structs/params.rb +1 -1
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step_collection.rb +106 -0
- data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/middleware.rb +4 -4
- data/lib/convenient_service/service/plugins/can_have_steps.rb +6 -0
- data/lib/convenient_service/service/plugins/can_have_stubbed_result/concern.rb +19 -11
- data/lib/convenient_service/service/plugins/can_have_stubbed_result/middleware.rb +3 -3
- data/lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb +3 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/aliases.rb +7 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result/concern.rb +12 -5
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes/concern/class_methods.rb → can_have_parent_result/constants.rb} +3 -4
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_have_parent_result.rb +1 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb → has_j_send_status_and_attributes/commands/cast_j_send_attributes.rb} +1 -1
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands/create_code_class.rb +49 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands/create_data_class.rb +49 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands/create_message_class.rb +49 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands/create_status_class.rb +49 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/commands.rb +7 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/concern/class_methods.rb +69 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/concern/instance_methods.rb +9 -9
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/entities/code/concern/class_methods.rb +2 -2
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/entities/code/concern/instance_methods.rb +3 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/entities/code/concern.rb +1 -1
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/entities/code.rb +1 -1
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/class_methods.rb +38 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/instance_methods.rb +94 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern.rb +36 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data.rb +25 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/class_methods.rb +40 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb +58 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern.rb +36 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message.rb +25 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/class_methods.rb +40 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb +115 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern.rb +36 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status.rb +25 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/errors.rb +6 -2
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/middleware.rb +4 -4
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes/structs/jsend_attributes.rb → has_j_send_status_and_attributes/structs/j_send_attributes.rb} +1 -1
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes/structs.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_j_send_status_and_attributes.rb +8 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax/concern.rb +3 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/raises_on_not_checked_result_status/errors.rb +1 -1
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins.rb +3 -1
- data/lib/convenient_service/service/plugins/has_result/errors.rb +2 -2
- data/lib/convenient_service/service/plugins/has_result_status_check_short_syntax/concern.rb +16 -0
- data/lib/convenient_service/service/plugins/raises_on_double_result/errors.rb +1 -1
- data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_backtrace.rb +1 -1
- data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_exception.rb +11 -10
- data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/middleware.rb +14 -7
- data/lib/convenient_service/service/plugins.rb +3 -2
- data/lib/convenient_service/services/run_own_method_in_organizer.rb +1 -1
- data/lib/convenient_service/support/abstract_method/errors.rb +1 -1
- data/lib/convenient_service/support/arguments.rb +3 -3
- data/lib/convenient_service/support/cache/key.rb +3 -3
- data/lib/convenient_service/support/cache.rb +1 -1
- data/lib/convenient_service/support/castable/errors.rb +2 -2
- data/lib/convenient_service/support/counter.rb +212 -0
- data/lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb +33 -0
- data/lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb +58 -0
- data/lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb +4 -3
- data/lib/convenient_service/support/dependency_container/commands/define_entry.rb +49 -0
- data/lib/convenient_service/support/dependency_container/commands.rb +3 -0
- data/lib/convenient_service/support/dependency_container/container.rb +23 -0
- data/lib/convenient_service/support/dependency_container/entry.rb +22 -0
- data/lib/convenient_service/support/dependency_container/errors.rb +5 -5
- data/lib/convenient_service/support/dependency_container/import.rb +3 -3
- data/lib/convenient_service/support/dependency_container.rb +3 -0
- data/lib/convenient_service/support/finite_loop.rb +37 -2
- data/lib/convenient_service/support/middleware/stack_builder.rb +1 -1
- data/lib/convenient_service/support/not_passed.rb +4 -3
- data/lib/convenient_service/support/ruby.rb +31 -0
- data/lib/convenient_service/support/safe_method.rb +65 -0
- data/lib/convenient_service/support/thread_safe_counter.rb +119 -0
- data/lib/convenient_service/support/undefined.rb +4 -3
- data/lib/convenient_service/support/unique_value.rb +69 -0
- data/lib/convenient_service/support.rb +4 -0
- data/lib/convenient_service/utils/array/errors.rb +1 -1
- data/lib/convenient_service/utils/array/find_last.rb +1 -1
- data/lib/convenient_service/utils/array/find_yield.rb +1 -1
- data/lib/convenient_service/utils/object/resolve_class.rb +56 -0
- data/lib/convenient_service/utils/object.rb +9 -0
- data/lib/convenient_service/version.rb +1 -1
- data/lib/convenient_service.rb +6 -0
- metadata +129 -86
- data/lib/convenient_service/factories/arguments.rb +0 -43
- data/lib/convenient_service/factories/results.rb +0 -214
- data/lib/convenient_service/factories/services.rb +0 -189
- data/lib/convenient_service/factories/step/instance.rb +0 -32
- data/lib/convenient_service/factories/step.rb +0 -3
- data/lib/convenient_service/factories/steps.rb +0 -126
- data/lib/convenient_service/factories.rb +0 -22
- data/lib/convenient_service/factory.rb +0 -21
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands.rb +0 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/data/class_methods.rb +0 -32
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/data.rb +0 -74
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/message/class_methods.rb +0 -34
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/message.rb +0 -45
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/status/class_methods.rb +0 -34
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/status.rb +0 -77
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/structs.rb +0 -3
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes.rb +0 -8
- data/lib/convenient_service/service/plugins/has_result_method_steps.rb +0 -3
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method.rb +0 -57
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method_caller.rb +0 -74
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method_key.rb +0 -78
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method_name.rb +0 -78
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step/errors.rb +0 -23
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step_collection.rb +0 -77
- data/lib/convenient_service/service/plugins/has_result_steps.rb +0 -6
- /data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/commands.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/callers/reassignment/commands.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/callers.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/directions.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/method/entities/values.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/commands.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/plugins/can_have_parent_result.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/plugins/has_inspect.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities/step/structs.rb +0 -0
- /data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities.rb +0 -0
- /data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/{has_jsend_status_and_attributes → has_j_send_status_and_attributes}/entities.rb +0 -0
@@ -1,8 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "has_jsend_status_and_attributes/commands"
|
4
|
-
require_relative "has_jsend_status_and_attributes/concern"
|
5
|
-
require_relative "has_jsend_status_and_attributes/entities"
|
6
|
-
require_relative "has_jsend_status_and_attributes/errors"
|
7
|
-
require_relative "has_jsend_status_and_attributes/middleware"
|
8
|
-
require_relative "has_jsend_status_and_attributes/structs"
|
data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ConvenientService
|
4
|
-
module Service
|
5
|
-
module Plugins
|
6
|
-
module HasResultSteps
|
7
|
-
module Entities
|
8
|
-
class Method
|
9
|
-
module Commands
|
10
|
-
##
|
11
|
-
# TODO: Abstract factory.
|
12
|
-
#
|
13
|
-
class CastMethod < Support::Command
|
14
|
-
attr_reader :other, :options
|
15
|
-
|
16
|
-
def initialize(other:, options:)
|
17
|
-
@other = other
|
18
|
-
@options = options
|
19
|
-
end
|
20
|
-
|
21
|
-
def call
|
22
|
-
return unless key
|
23
|
-
return unless name
|
24
|
-
return unless caller
|
25
|
-
return unless direction
|
26
|
-
|
27
|
-
##
|
28
|
-
# https://en.wikipedia.org/wiki/Composition_over_inheritance
|
29
|
-
#
|
30
|
-
Method.new(key: key, name: name, caller: caller, direction: direction)
|
31
|
-
end
|
32
|
-
|
33
|
-
private
|
34
|
-
|
35
|
-
def key
|
36
|
-
@key ||= Commands::CastMethodKey.call(other: other, options: options)
|
37
|
-
end
|
38
|
-
|
39
|
-
def name
|
40
|
-
@name ||= Commands::CastMethodName.call(other: other, options: options)
|
41
|
-
end
|
42
|
-
|
43
|
-
def caller
|
44
|
-
@caller ||= Commands::CastMethodCaller.call(other: other, options: options)
|
45
|
-
end
|
46
|
-
|
47
|
-
def direction
|
48
|
-
@direction ||= Commands::CastMethodDirection.call(other: other, options: options)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,74 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ConvenientService
|
4
|
-
module Service
|
5
|
-
module Plugins
|
6
|
-
module HasResultSteps
|
7
|
-
module Entities
|
8
|
-
class Method
|
9
|
-
module Commands
|
10
|
-
##
|
11
|
-
# TODO: Abstract factory.
|
12
|
-
#
|
13
|
-
class CastMethodCaller < Support::Command
|
14
|
-
attr_reader :other, :options
|
15
|
-
|
16
|
-
def initialize(other:, options:)
|
17
|
-
@other = other
|
18
|
-
@options = options
|
19
|
-
end
|
20
|
-
|
21
|
-
def call
|
22
|
-
case other
|
23
|
-
when ::Symbol then cast_symbol
|
24
|
-
when ::String then cast_string
|
25
|
-
when ::Hash then cast_hash
|
26
|
-
when Entities::Values::Reassignment then cast_reassignment
|
27
|
-
when Method then cast_method
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
def cast_symbol
|
34
|
-
Entities::Callers::Usual.new(other)
|
35
|
-
end
|
36
|
-
|
37
|
-
def cast_string
|
38
|
-
Entities::Callers::Usual.new(other)
|
39
|
-
end
|
40
|
-
|
41
|
-
def cast_reassignment
|
42
|
-
Entities::Callers::Reassignment.new(other)
|
43
|
-
end
|
44
|
-
|
45
|
-
def cast_hash
|
46
|
-
return unless other.keys.one?
|
47
|
-
|
48
|
-
value = other.values.first
|
49
|
-
|
50
|
-
case value
|
51
|
-
when ::Symbol
|
52
|
-
Entities::Callers::Alias.new(value)
|
53
|
-
when ::String
|
54
|
-
Entities::Callers::Alias.new(value)
|
55
|
-
when ::Proc
|
56
|
-
Entities::Callers::Proc.new(value)
|
57
|
-
when Support::RawValue
|
58
|
-
Entities::Callers::Raw.new(value)
|
59
|
-
when Entities::Values::Reassignment
|
60
|
-
Entities::Callers::Reassignment.new(value)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
def cast_method
|
65
|
-
other.caller.copy
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
@@ -1,78 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ConvenientService
|
4
|
-
module Service
|
5
|
-
module Plugins
|
6
|
-
module HasResultSteps
|
7
|
-
module Entities
|
8
|
-
class Method
|
9
|
-
module Commands
|
10
|
-
##
|
11
|
-
# TODO: Abstract factory.
|
12
|
-
#
|
13
|
-
class CastMethodKey < Support::Command
|
14
|
-
attr_reader :other, :options
|
15
|
-
|
16
|
-
def initialize(other:, options:)
|
17
|
-
@other = other
|
18
|
-
@options = options
|
19
|
-
end
|
20
|
-
|
21
|
-
def call
|
22
|
-
##
|
23
|
-
# TODO: Use pattern matcher when Ruby 2.7.
|
24
|
-
#
|
25
|
-
case other
|
26
|
-
when ::Symbol then cast_symbol
|
27
|
-
when ::String then cast_string
|
28
|
-
when ::Hash then cast_hash
|
29
|
-
when Entities::Values::Reassignment then cast_reassignment
|
30
|
-
when Method then cast_method
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
def cast_symbol
|
37
|
-
Entities::Key.new(other)
|
38
|
-
end
|
39
|
-
|
40
|
-
def cast_string
|
41
|
-
Entities::Key.new(other)
|
42
|
-
end
|
43
|
-
|
44
|
-
def cast_reassignment
|
45
|
-
Entities::Key.new(other.to_sym)
|
46
|
-
end
|
47
|
-
|
48
|
-
def cast_hash
|
49
|
-
return unless other.keys.one?
|
50
|
-
|
51
|
-
key = other.keys.first
|
52
|
-
value = other.values.first
|
53
|
-
|
54
|
-
case value
|
55
|
-
when ::Symbol
|
56
|
-
Entities::Key.new(key)
|
57
|
-
when ::String
|
58
|
-
Entities::Key.new(key)
|
59
|
-
when ::Proc
|
60
|
-
Entities::Key.new(key)
|
61
|
-
when Support::RawValue
|
62
|
-
Entities::Key.new(key)
|
63
|
-
when Entities::Values::Reassignment
|
64
|
-
Entities::Key.new(key)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def cast_method
|
69
|
-
other.key.copy
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
@@ -1,78 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ConvenientService
|
4
|
-
module Service
|
5
|
-
module Plugins
|
6
|
-
module HasResultSteps
|
7
|
-
module Entities
|
8
|
-
class Method
|
9
|
-
module Commands
|
10
|
-
#
|
11
|
-
# TODO: Abstract factory.
|
12
|
-
#
|
13
|
-
class CastMethodName < Support::Command
|
14
|
-
attr_reader :other, :options
|
15
|
-
|
16
|
-
def initialize(other:, options:)
|
17
|
-
@other = other
|
18
|
-
@options = options
|
19
|
-
end
|
20
|
-
|
21
|
-
def call
|
22
|
-
##
|
23
|
-
# TODO: Use pattern matcher when Ruby 2.7.
|
24
|
-
#
|
25
|
-
case other
|
26
|
-
when ::Symbol then cast_symbol
|
27
|
-
when ::String then cast_string
|
28
|
-
when ::Hash then cast_hash
|
29
|
-
when Entities::Values::Reassignment then cast_reassignment
|
30
|
-
when Method then cast_method
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
def cast_symbol
|
37
|
-
Entities::Name.new(other)
|
38
|
-
end
|
39
|
-
|
40
|
-
def cast_string
|
41
|
-
Entities::Name.new(other)
|
42
|
-
end
|
43
|
-
|
44
|
-
def cast_reassignment
|
45
|
-
Entities::Name.new(other.to_sym)
|
46
|
-
end
|
47
|
-
|
48
|
-
def cast_hash
|
49
|
-
return unless other.keys.one?
|
50
|
-
|
51
|
-
key = other.keys.first
|
52
|
-
value = other.values.first
|
53
|
-
|
54
|
-
case value
|
55
|
-
when ::Symbol
|
56
|
-
Entities::Name.new(value)
|
57
|
-
when ::String
|
58
|
-
Entities::Name.new(value)
|
59
|
-
when ::Proc
|
60
|
-
Entities::Name.new(key)
|
61
|
-
when Support::RawValue
|
62
|
-
Entities::Name.new(key)
|
63
|
-
when Entities::Values::Reassignment
|
64
|
-
Entities::Name.new(value.to_sym)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def cast_method
|
69
|
-
other.name.copy
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ConvenientService
|
4
|
-
module Service
|
5
|
-
module Plugins
|
6
|
-
module HasResultSteps
|
7
|
-
module Errors
|
8
|
-
class StepHasNoOrganizer < ConvenientService::Error
|
9
|
-
def initialize(step:)
|
10
|
-
message = <<~TEXT
|
11
|
-
Step `#{step.service}` has not assigned organizer.
|
12
|
-
|
13
|
-
Did you forget to set it?
|
14
|
-
TEXT
|
15
|
-
|
16
|
-
super(message)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,77 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ConvenientService
|
4
|
-
module Service
|
5
|
-
module Plugins
|
6
|
-
module HasResultSteps
|
7
|
-
module Entities
|
8
|
-
class StepCollection
|
9
|
-
include ::Enumerable
|
10
|
-
|
11
|
-
attr_reader :steps
|
12
|
-
|
13
|
-
def initialize
|
14
|
-
@steps = []
|
15
|
-
end
|
16
|
-
|
17
|
-
##
|
18
|
-
# TODO: Specs.
|
19
|
-
#
|
20
|
-
def commit!
|
21
|
-
return false if committed?
|
22
|
-
|
23
|
-
##
|
24
|
-
# IMPORTANT: Temporarily removed `step.validate!` since it is neither thread-safe nor idempotent.
|
25
|
-
#
|
26
|
-
steps.each { |step| step.define! }.freeze
|
27
|
-
|
28
|
-
true
|
29
|
-
end
|
30
|
-
|
31
|
-
##
|
32
|
-
# TODO: Specs.
|
33
|
-
#
|
34
|
-
def committed?
|
35
|
-
steps.frozen?
|
36
|
-
end
|
37
|
-
|
38
|
-
def each(&block)
|
39
|
-
steps.each(&block)
|
40
|
-
end
|
41
|
-
|
42
|
-
##
|
43
|
-
# Returns step by index.
|
44
|
-
#
|
45
|
-
# @param index [Integer]
|
46
|
-
# @return [ConvenientService::Service::Plugins::HasResultSteps::Entities::Step]
|
47
|
-
#
|
48
|
-
# @note Works in a similar way as `Array#[]`.
|
49
|
-
# @see https://ruby-doc.org/core-2.7.0/Array.html#method-i-5B-5D
|
50
|
-
#
|
51
|
-
def [](index)
|
52
|
-
steps[index]
|
53
|
-
end
|
54
|
-
|
55
|
-
def <<(step)
|
56
|
-
steps << step.copy(overrides: {kwargs: {index: next_available_index}})
|
57
|
-
end
|
58
|
-
|
59
|
-
def ==(other)
|
60
|
-
return unless other.instance_of?(self.class)
|
61
|
-
|
62
|
-
return false if steps != other.steps
|
63
|
-
|
64
|
-
true
|
65
|
-
end
|
66
|
-
|
67
|
-
private
|
68
|
-
|
69
|
-
def next_available_index
|
70
|
-
steps.size
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
/data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/commands.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/data/lib/convenient_service/service/plugins/{has_result_steps → can_have_steps}/entities.rb
RENAMED
File without changes
|