convenient_service 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.dockerignore +1 -0
- data/.gem_release.yml +23 -0
- data/.github/workflows/cd.yml +54 -0
- data/.github/workflows/ci.yml +190 -0
- data/.gitignore +34 -0
- data/.inch.yml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +45 -0
- data/.rubocop_rspec.yml +58 -0
- data/.ruby-version +1 -0
- data/.tool-versions +1 -0
- data/.yardopts +13 -0
- data/Appraisals +124 -0
- data/CHANGELOG.md +1 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +55 -0
- data/ROADMAP.md +41 -0
- data/Rakefile +54 -0
- data/Taskfile.yml +316 -0
- data/convenient_service.gemspec +52 -0
- data/coverage/.gitkeep +0 -0
- data/docker/2.7/Dockerfile +73 -0
- data/docker/3.0/Dockerfile +73 -0
- data/docker/3.1/Dockerfile +73 -0
- data/env.rb +19 -0
- data/lib/convenient_service/common/plugins/aliases.rb +8 -0
- data/lib/convenient_service/common/plugins/assigns_attributes_in_constructor/using_active_model_attribute_assignment/concern.rb +21 -0
- data/lib/convenient_service/common/plugins/assigns_attributes_in_constructor/using_active_model_attribute_assignment/middleware.rb +29 -0
- data/lib/convenient_service/common/plugins/assigns_attributes_in_constructor/using_active_model_attribute_assignment.rb +4 -0
- data/lib/convenient_service/common/plugins/assigns_attributes_in_constructor/using_dry_initializer/concern.rb +21 -0
- data/lib/convenient_service/common/plugins/assigns_attributes_in_constructor/using_dry_initializer.rb +3 -0
- data/lib/convenient_service/common/plugins/caches_constructor_params/concern.rb +22 -0
- data/lib/convenient_service/common/plugins/caches_constructor_params/entities/constructor_params.rb +34 -0
- data/lib/convenient_service/common/plugins/caches_constructor_params/entities.rb +3 -0
- data/lib/convenient_service/common/plugins/caches_constructor_params/middleware.rb +17 -0
- data/lib/convenient_service/common/plugins/caches_constructor_params.rb +5 -0
- data/lib/convenient_service/common/plugins/caches_return_value/entities/key.rb +79 -0
- data/lib/convenient_service/common/plugins/caches_return_value/entities.rb +3 -0
- data/lib/convenient_service/common/plugins/caches_return_value/middleware.rb +17 -0
- data/lib/convenient_service/common/plugins/caches_return_value.rb +4 -0
- data/lib/convenient_service/common/plugins/can_be_copied/concern.rb +33 -0
- data/lib/convenient_service/common/plugins/can_be_copied.rb +3 -0
- data/lib/convenient_service/common/plugins/has_around_callbacks/concern.rb +19 -0
- data/lib/convenient_service/common/plugins/has_around_callbacks/errors.rb +29 -0
- data/lib/convenient_service/common/plugins/has_around_callbacks/middleware.rb +113 -0
- data/lib/convenient_service/common/plugins/has_around_callbacks.rb +5 -0
- data/lib/convenient_service/common/plugins/has_attributes/using_active_model_attributes/concern.rb +19 -0
- data/lib/convenient_service/common/plugins/has_attributes/using_active_model_attributes/patches/active_model_attributes.rb +45 -0
- data/lib/convenient_service/common/plugins/has_attributes/using_active_model_attributes/patches.rb +3 -0
- data/lib/convenient_service/common/plugins/has_attributes/using_active_model_attributes.rb +4 -0
- data/lib/convenient_service/common/plugins/has_callbacks/concern.rb +36 -0
- data/lib/convenient_service/common/plugins/has_callbacks/entities/callback.rb +59 -0
- data/lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb +35 -0
- data/lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb +26 -0
- data/lib/convenient_service/common/plugins/has_callbacks/entities/type.rb +50 -0
- data/lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb +33 -0
- data/lib/convenient_service/common/plugins/has_callbacks/entities.rb +6 -0
- data/lib/convenient_service/common/plugins/has_callbacks/middleware.rb +21 -0
- data/lib/convenient_service/common/plugins/has_callbacks.rb +5 -0
- data/lib/convenient_service/common/plugins/has_constructor/concern.rb +18 -0
- data/lib/convenient_service/common/plugins/has_constructor.rb +3 -0
- data/lib/convenient_service/common/plugins/has_internals/commands/create_internals_class.rb +56 -0
- data/lib/convenient_service/common/plugins/has_internals/commands.rb +3 -0
- data/lib/convenient_service/common/plugins/has_internals/concern.rb +28 -0
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/concern.rb +25 -0
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/has_cache/concern.rb +30 -0
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/has_cache/entities/cache.rb +81 -0
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/has_cache/entities.rb +3 -0
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/has_cache.rb +4 -0
- data/lib/convenient_service/common/plugins/has_internals/entities/internals/plugins.rb +3 -0
- data/lib/convenient_service/common/plugins/has_internals/entities/internals.rb +18 -0
- data/lib/convenient_service/common/plugins/has_internals/entities.rb +3 -0
- data/lib/convenient_service/common/plugins/has_internals.rb +5 -0
- data/lib/convenient_service/common/plugins/normalizes_env/middleware.rb +29 -0
- data/lib/convenient_service/common/plugins/normalizes_env.rb +3 -0
- data/lib/convenient_service/common/plugins.rb +16 -0
- data/lib/convenient_service/common.rb +3 -0
- data/lib/convenient_service/configs/aliases.rb +7 -0
- data/lib/convenient_service/configs/standard.rb +193 -0
- data/lib/convenient_service/configs.rb +5 -0
- data/lib/convenient_service/core/aliases.rb +9 -0
- data/lib/convenient_service/core/class_methods.rb +81 -0
- data/lib/convenient_service/core/entities/classic_middleware.rb +32 -0
- data/lib/convenient_service/core/entities/config/entities/concerns/entities/default_concern.rb +18 -0
- data/lib/convenient_service/core/entities/config/entities/concerns/entities/middleware/commands/cast_middleware.rb +78 -0
- data/lib/convenient_service/core/entities/config/entities/concerns/entities/middleware/commands.rb +3 -0
- data/lib/convenient_service/core/entities/config/entities/concerns/entities/middleware.rb +103 -0
- data/lib/convenient_service/core/entities/config/entities/concerns/entities/stack.rb +206 -0
- data/lib/convenient_service/core/entities/config/entities/concerns/entities.rb +5 -0
- data/lib/convenient_service/core/entities/config/entities/concerns.rb +216 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb +95 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/commands.rb +3 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/commands/cast_caller.rb +72 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/commands/define_method_middlewares_caller.rb +134 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/commands.rb +4 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/concern/class_methods.rb +29 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/concern/instance_methods.rb +66 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/concern.rb +32 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller.rb +25 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/chain.rb +71 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/commands/cast_container.rb +76 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/commands/resolve_methods_middlewares_callers.rb +72 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/commands.rb +4 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/concern/class_methods.rb +29 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/concern/instance_methods.rb +165 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/concern.rb +32 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container.rb +22 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware.rb +114 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/stack.rb +193 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities.rb +7 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares.rb +182 -0
- data/lib/convenient_service/core/entities/config/entities.rb +4 -0
- data/lib/convenient_service/core/entities/config/errors.rb +27 -0
- data/lib/convenient_service/core/entities/config.rb +147 -0
- data/lib/convenient_service/core/entities.rb +4 -0
- data/lib/convenient_service/core/instance_methods.rb +54 -0
- data/lib/convenient_service/core.rb +19 -0
- data/lib/convenient_service/dependencies/built_in.rb +36 -0
- data/lib/convenient_service/dependencies/extractions/active_support_concern/concern.rb +258 -0
- data/lib/convenient_service/dependencies/extractions/active_support_concern.rb +16 -0
- data/lib/convenient_service/dependencies/extractions/b.rb +12 -0
- data/lib/convenient_service/dependencies/extractions/byebug_syntax_highlighting.rb +58 -0
- data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/builder.rb +194 -0
- data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/logger.rb +60 -0
- data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/runner.rb +79 -0
- data/lib/convenient_service/dependencies/extractions/ruby_middleware/middleware.rb +8 -0
- data/lib/convenient_service/dependencies/extractions/ruby_middleware.rb +15 -0
- data/lib/convenient_service/dependencies/extractions.rb +10 -0
- data/lib/convenient_service/dependencies.rb +133 -0
- data/lib/convenient_service/error.rb +16 -0
- data/lib/convenient_service/examples/dry/gemfile/dry_service/config.rb +43 -0
- data/lib/convenient_service/examples/dry/gemfile/dry_service.rb +3 -0
- data/lib/convenient_service/examples/dry/gemfile/services/assert_file_exists.rb +29 -0
- data/lib/convenient_service/examples/dry/gemfile/services/assert_file_not_empty.rb +29 -0
- data/lib/convenient_service/examples/dry/gemfile/services/assert_node_available.rb +26 -0
- data/lib/convenient_service/examples/dry/gemfile/services/assert_npm_package_available.rb +39 -0
- data/lib/convenient_service/examples/dry/gemfile/services/assert_valid_ruby_syntax.rb +41 -0
- data/lib/convenient_service/examples/dry/gemfile/services/format.rb +37 -0
- data/lib/convenient_service/examples/dry/gemfile/services/format_body.rb +93 -0
- data/lib/convenient_service/examples/dry/gemfile/services/format_gems_with_envs.rb +96 -0
- data/lib/convenient_service/examples/dry/gemfile/services/format_gems_without_envs.rb +84 -0
- data/lib/convenient_service/examples/dry/gemfile/services/format_header.rb +74 -0
- data/lib/convenient_service/examples/dry/gemfile/services/parse_content.rb +93 -0
- data/lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb +37 -0
- data/lib/convenient_service/examples/dry/gemfile/services/read_file_content.rb +31 -0
- data/lib/convenient_service/examples/dry/gemfile/services/run_shell.rb +40 -0
- data/lib/convenient_service/examples/dry/gemfile/services/strip_comments.rb +109 -0
- data/lib/convenient_service/examples/dry/gemfile/services.rb +17 -0
- data/lib/convenient_service/examples/dry/gemfile.rb +24 -0
- data/lib/convenient_service/examples/rails/gemfile/rails_service/config.rb +54 -0
- data/lib/convenient_service/examples/rails/gemfile/rails_service.rb +3 -0
- data/lib/convenient_service/examples/rails/gemfile/services/assert_file_exists.rb +25 -0
- data/lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb +25 -0
- data/lib/convenient_service/examples/rails/gemfile/services/assert_node_available.rb +26 -0
- data/lib/convenient_service/examples/rails/gemfile/services/assert_npm_package_available.rb +35 -0
- data/lib/convenient_service/examples/rails/gemfile/services/assert_valid_ruby_syntax.rb +35 -0
- data/lib/convenient_service/examples/rails/gemfile/services/format.rb +37 -0
- data/lib/convenient_service/examples/rails/gemfile/services/format_body.rb +79 -0
- data/lib/convenient_service/examples/rails/gemfile/services/format_gems_with_envs.rb +82 -0
- data/lib/convenient_service/examples/rails/gemfile/services/format_gems_without_envs.rb +70 -0
- data/lib/convenient_service/examples/rails/gemfile/services/format_header.rb +69 -0
- data/lib/convenient_service/examples/rails/gemfile/services/parse_content.rb +89 -0
- data/lib/convenient_service/examples/rails/gemfile/services/print_shell_command.rb +33 -0
- data/lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb +27 -0
- data/lib/convenient_service/examples/rails/gemfile/services/run_shell.rb +35 -0
- data/lib/convenient_service/examples/rails/gemfile/services/strip_comments.rb +107 -0
- data/lib/convenient_service/examples/rails/gemfile/services.rb +17 -0
- data/lib/convenient_service/examples/rails/gemfile.rb +24 -0
- data/lib/convenient_service/examples/standard/gemfile/services/assert_file_exists.rb +30 -0
- data/lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb +30 -0
- data/lib/convenient_service/examples/standard/gemfile/services/assert_node_available.rb +35 -0
- data/lib/convenient_service/examples/standard/gemfile/services/assert_npm_package_available.rb +48 -0
- data/lib/convenient_service/examples/standard/gemfile/services/assert_valid_ruby_syntax.rb +39 -0
- data/lib/convenient_service/examples/standard/gemfile/services/format.rb +39 -0
- data/lib/convenient_service/examples/standard/gemfile/services/format_body.rb +83 -0
- data/lib/convenient_service/examples/standard/gemfile/services/format_gems_with_envs.rb +86 -0
- data/lib/convenient_service/examples/standard/gemfile/services/format_gems_without_envs.rb +74 -0
- data/lib/convenient_service/examples/standard/gemfile/services/format_header.rb +66 -0
- data/lib/convenient_service/examples/standard/gemfile/services/parse_content.rb +101 -0
- data/lib/convenient_service/examples/standard/gemfile/services/print_shell_command.rb +38 -0
- data/lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb +39 -0
- data/lib/convenient_service/examples/standard/gemfile/services/run_shell.rb +37 -0
- data/lib/convenient_service/examples/standard/gemfile/services/strip_comments.rb +111 -0
- data/lib/convenient_service/examples/standard/gemfile/services.rb +17 -0
- data/lib/convenient_service/examples/standard/gemfile.rb +23 -0
- data/lib/convenient_service/logger.rb +70 -0
- data/lib/convenient_service/rspec/helpers/custom/ignoring_error.rb +29 -0
- data/lib/convenient_service/rspec/helpers/custom/stub_service/entities/result_spec.rb +119 -0
- data/lib/convenient_service/rspec/helpers/custom/stub_service/entities/stubbed_service.rb +99 -0
- data/lib/convenient_service/rspec/helpers/custom/stub_service/entities.rb +4 -0
- data/lib/convenient_service/rspec/helpers/custom/stub_service.rb +26 -0
- data/lib/convenient_service/rspec/helpers/custom/wrap_method/entities/wrapped_method.rb +80 -0
- data/lib/convenient_service/rspec/helpers/custom/wrap_method/entities.rb +3 -0
- data/lib/convenient_service/rspec/helpers/custom/wrap_method/errors.rb +25 -0
- data/lib/convenient_service/rspec/helpers/custom/wrap_method.rb +27 -0
- data/lib/convenient_service/rspec/helpers/custom.rb +5 -0
- data/lib/convenient_service/rspec/helpers/ignoring_error.rb +13 -0
- data/lib/convenient_service/rspec/helpers/stub_service.rb +29 -0
- data/lib/convenient_service/rspec/helpers/wrap_method.rb +13 -0
- data/lib/convenient_service/rspec/helpers.rb +21 -0
- data/lib/convenient_service/rspec/matchers/be_descendant_of.rb +13 -0
- data/lib/convenient_service/rspec/matchers/be_direct_descendant_of.rb +13 -0
- data/lib/convenient_service/rspec/matchers/cache_its_value.rb +13 -0
- data/lib/convenient_service/rspec/matchers/call_chain_next.rb +13 -0
- data/lib/convenient_service/rspec/matchers/custom/be_descendant_of.rb +55 -0
- data/lib/convenient_service/rspec/matchers/custom/be_direct_descendant_of.rb +55 -0
- data/lib/convenient_service/rspec/matchers/custom/cache_its_value.rb +55 -0
- data/lib/convenient_service/rspec/matchers/custom/call_chain_next.rb +150 -0
- data/lib/convenient_service/rspec/matchers/custom/delegate_to.rb +255 -0
- data/lib/convenient_service/rspec/matchers/custom/extend_module.rb +40 -0
- data/lib/convenient_service/rspec/matchers/custom/have_abstract_method.rb +45 -0
- data/lib/convenient_service/rspec/matchers/custom/have_alias_method.rb +45 -0
- data/lib/convenient_service/rspec/matchers/custom/have_attr_accessor.rb +43 -0
- data/lib/convenient_service/rspec/matchers/custom/have_attr_reader.rb +47 -0
- data/lib/convenient_service/rspec/matchers/custom/have_attr_writer.rb +47 -0
- data/lib/convenient_service/rspec/matchers/custom/include_module.rb +40 -0
- data/lib/convenient_service/rspec/matchers/custom/prepend_module.rb +40 -0
- data/lib/convenient_service/rspec/matchers/custom/results/be_error.rb +153 -0
- data/lib/convenient_service/rspec/matchers/custom/results/be_failure.rb +120 -0
- data/lib/convenient_service/rspec/matchers/custom/results/be_success.rb +120 -0
- data/lib/convenient_service/rspec/matchers/custom/results.rb +5 -0
- data/lib/convenient_service/rspec/matchers/custom.rb +16 -0
- data/lib/convenient_service/rspec/matchers/delegate_to.rb +13 -0
- data/lib/convenient_service/rspec/matchers/extend_module.rb +13 -0
- data/lib/convenient_service/rspec/matchers/have_abstract_method.rb +13 -0
- data/lib/convenient_service/rspec/matchers/have_alias_method.rb +13 -0
- data/lib/convenient_service/rspec/matchers/have_attr_accessor.rb +13 -0
- data/lib/convenient_service/rspec/matchers/have_attr_reader.rb +13 -0
- data/lib/convenient_service/rspec/matchers/have_attr_writer.rb +13 -0
- data/lib/convenient_service/rspec/matchers/include_module.rb +13 -0
- data/lib/convenient_service/rspec/matchers/prepend_module.rb +13 -0
- data/lib/convenient_service/rspec/matchers/results/be_error.rb +15 -0
- data/lib/convenient_service/rspec/matchers/results/be_failure.rb +15 -0
- data/lib/convenient_service/rspec/matchers/results/be_success.rb +15 -0
- data/lib/convenient_service/rspec/matchers/results.rb +21 -0
- data/lib/convenient_service/rspec/matchers.rb +43 -0
- data/lib/convenient_service/rspec.rb +4 -0
- data/lib/convenient_service/service/plugins/aliases.rb +8 -0
- data/lib/convenient_service/service/plugins/can_recalculate_result/concern.rb +26 -0
- data/lib/convenient_service/service/plugins/can_recalculate_result.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result/commands/create_result_class.rb +56 -0
- data/lib/convenient_service/service/plugins/has_result/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result/concern/class_methods.rb +82 -0
- data/lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb +32 -0
- data/lib/convenient_service/service/plugins/has_result/concern.rb +22 -0
- data/lib/convenient_service/service/plugins/has_result/constants.rb +33 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/commands/cast_result_params.rb +33 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/concern/instance_methods.rb +64 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/concern.rb +19 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/entities/code/class_methods.rb +30 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/entities/code.rb +45 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/entities/data/class_methods.rb +28 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/entities/data.rb +45 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/entities/message/class_methods.rb +30 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/entities/message.rb +41 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/entities/status/class_methods.rb +30 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/entities/status.rb +69 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/entities.rb +6 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/errors.rb +25 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_recalculate_result/concern.rb +27 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/can_recalculate_result.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax/concern/instance_methods.rb +28 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax/concern.rb +30 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_result_short_syntax.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/marks_result_status_as_checked/middleware.rb +25 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/marks_result_status_as_checked.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/raises_on_not_checked_result_status/errors.rb +31 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +33 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins/raises_on_not_checked_result_status.rb +4 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/plugins.rb +6 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/structs/result_params.rb +17 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result/structs.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result/entities/result.rb +22 -0
- data/lib/convenient_service/service/plugins/has_result/entities.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result/errors.rb +34 -0
- data/lib/convenient_service/service/plugins/has_result/middleware.rb +19 -0
- data/lib/convenient_service/service/plugins/has_result.rb +8 -0
- data/lib/convenient_service/service/plugins/has_result_method_steps/errors.rb +23 -0
- data/lib/convenient_service/service/plugins/has_result_method_steps/middleware.rb +37 -0
- data/lib/convenient_service/service/plugins/has_result_method_steps/services/method_step_config.rb +29 -0
- data/lib/convenient_service/service/plugins/has_result_method_steps/services/run_method_in_organizer.rb +30 -0
- data/lib/convenient_service/service/plugins/has_result_method_steps/services/run_own_method_in_organizer.rb +52 -0
- data/lib/convenient_service/service/plugins/has_result_method_steps/services.rb +5 -0
- data/lib/convenient_service/service/plugins/has_result_method_steps.rb +5 -0
- data/lib/convenient_service/service/plugins/has_result_params_validations/using_active_model_validations/concern.rb +19 -0
- data/lib/convenient_service/service/plugins/has_result_params_validations/using_active_model_validations/middleware.rb +35 -0
- data/lib/convenient_service/service/plugins/has_result_params_validations/using_active_model_validations.rb +4 -0
- data/lib/convenient_service/service/plugins/has_result_params_validations/using_dry_validation/concern.rb +22 -0
- data/lib/convenient_service/service/plugins/has_result_params_validations/using_dry_validation/middleware.rb +39 -0
- data/lib/convenient_service/service/plugins/has_result_params_validations/using_dry_validation.rb +4 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/concern.rb +30 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/error/commands/assert_args_count_lower_than_three.rb +25 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/error/commands/assert_either_args_or_kwargs_are_passed.rb +26 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/error/commands.rb +4 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/error/errors.rb +46 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/error/middleware.rb +27 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/error.rb +5 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/commands/refute_kwargs_contain_data_and_extra_keys.rb +29 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/errors.rb +28 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/failure/middleware.rb +19 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/failure.rb +5 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/success/commands/refute_kwargs_contain_data_and_extra_keys.rb +29 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/success/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/success/errors.rb +28 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/success/middleware.rb +19 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax/success.rb +5 -0
- data/lib/convenient_service/service/plugins/has_result_short_syntax.rb +6 -0
- data/lib/convenient_service/service/plugins/has_result_steps/commands/create_step_class.rb +60 -0
- data/lib/convenient_service/service/plugins/has_result_steps/commands.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result_steps/concern.rb +53 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method.rb +54 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method_caller.rb +67 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method_direction.rb +65 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method_key.rb +71 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method_name.rb +74 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/define_method_in_container.rb +55 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/commands.rb +8 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/concern/class_methods.rb +21 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/concern/instance_methods.rb +96 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/concern.rb +29 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/callers/alias.rb +39 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/callers/base.rb +49 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/callers/proc.rb +42 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/callers/raw.rb +42 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/callers/usual.rb +39 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/callers.rb +7 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/directions/base.rb +33 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/directions/input.rb +31 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/directions/output.rb +31 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/directions.rb +5 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/key.rb +40 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/name.rb +40 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/values/raw.rb +48 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities/values.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/entities.rb +7 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method/errors.rb +127 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/method.rb +20 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/service/class_methods.rb +32 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/service.rb +48 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step/commands/cast_params.rb +61 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step/commands/extract_params.rb +38 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step/commands.rb +4 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step/concern/instance_methods.rb +138 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step/concern.rb +23 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step/errors.rb +23 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step/structs/params.rb +17 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step/structs.rb +3 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step.rb +20 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities/step_collection.rb +61 -0
- data/lib/convenient_service/service/plugins/has_result_steps/entities.rb +6 -0
- data/lib/convenient_service/service/plugins/has_result_steps/middleware.rb +26 -0
- data/lib/convenient_service/service/plugins/has_result_steps.rb +6 -0
- data/lib/convenient_service/service/plugins/raises_on_double_result/errors.rb +34 -0
- data/lib/convenient_service/service/plugins/raises_on_double_result/middleware.rb +33 -0
- data/lib/convenient_service/service/plugins/raises_on_double_result.rb +4 -0
- data/lib/convenient_service/service/plugins/wraps_result_in_db_transaction/middleware.rb +15 -0
- data/lib/convenient_service/service/plugins/wraps_result_in_db_transaction.rb +3 -0
- data/lib/convenient_service/service/plugins.rb +14 -0
- data/lib/convenient_service/service.rb +3 -0
- data/lib/convenient_service/specification.rb +21 -0
- data/lib/convenient_service/support/abstract_method/errors.rb +22 -0
- data/lib/convenient_service/support/abstract_method.rb +21 -0
- data/lib/convenient_service/support/castable/errors.rb +29 -0
- data/lib/convenient_service/support/castable.rb +44 -0
- data/lib/convenient_service/support/command.rb +25 -0
- data/lib/convenient_service/support/concern.rb +11 -0
- data/lib/convenient_service/support/copyable.rb +56 -0
- data/lib/convenient_service/support/delegate.rb +42 -0
- data/lib/convenient_service/support/finite_loop.rb +49 -0
- data/lib/convenient_service/support/middleware/stack_builder.rb +78 -0
- data/lib/convenient_service/support/middleware.rb +3 -0
- data/lib/convenient_service/support.rb +11 -0
- data/lib/convenient_service/utils/array/contain_exactly.rb +56 -0
- data/lib/convenient_service/utils/array/drop_while.rb +50 -0
- data/lib/convenient_service/utils/array/errors.rb +19 -0
- data/lib/convenient_service/utils/array/find_last.rb +38 -0
- data/lib/convenient_service/utils/array/find_yield.rb +93 -0
- data/lib/convenient_service/utils/array/keep_after.rb +41 -0
- data/lib/convenient_service/utils/array/merge.rb +77 -0
- data/lib/convenient_service/utils/array/rjust.rb +50 -0
- data/lib/convenient_service/utils/array/wrap.rb +40 -0
- data/lib/convenient_service/utils/array.rb +52 -0
- data/lib/convenient_service/utils/bool/to_bool.rb +37 -0
- data/lib/convenient_service/utils/bool.rb +15 -0
- data/lib/convenient_service/utils/hash/except.rb +46 -0
- data/lib/convenient_service/utils/hash.rb +15 -0
- data/lib/convenient_service/utils/method/defined.rb +49 -0
- data/lib/convenient_service/utils/method.rb +15 -0
- data/lib/convenient_service/utils/module/class_method_defined.rb +46 -0
- data/lib/convenient_service/utils/module/get_own_const.rb +60 -0
- data/lib/convenient_service/utils/module/get_own_instance_method.rb +81 -0
- data/lib/convenient_service/utils/module/has_own_instance_method.rb +77 -0
- data/lib/convenient_service/utils/module/instance_method_defined.rb +46 -0
- data/lib/convenient_service/utils/module.rb +40 -0
- data/lib/convenient_service/utils/object/resolve_type.rb +47 -0
- data/lib/convenient_service/utils/object.rb +19 -0
- data/lib/convenient_service/utils/proc/conjunct.rb +48 -0
- data/lib/convenient_service/utils/proc/exec_config.rb +136 -0
- data/lib/convenient_service/utils/proc.rb +20 -0
- data/lib/convenient_service/utils/string/camelize.rb +56 -0
- data/lib/convenient_service/utils/string.rb +15 -0
- data/lib/convenient_service/utils.rb +10 -0
- data/lib/convenient_service/version.rb +5 -0
- data/lib/convenient_service.rb +31 -0
- data/logo.png +0 -0
- metadata +738 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8ac75a9e4491384ec69ea4ddf3b7e9c4b9fc652dda2ec28236d0625d684605a2
|
4
|
+
data.tar.gz: a76819b97f23ef9d66185757832cb3be6c8b703cbfbe39fa8704be59c2af936d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8da7165d9eee47a3f978db542c7eaf77b6b80d8a2c27d885ce032b8433bae881d2c7c345923c676c38b1b1d30ad5aef9231c962ae282d0392f7278d768e8d9d6
|
7
|
+
data.tar.gz: e64a25c3a7513b2c2cf028a11c6a1ee692d6ad01c31ebd053d32e44c980bfddab9e77c2a1d7ca5fa529e4458eea6dae026b3f01bb743159045d6874e02757a47
|
data/.dockerignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Gemfile.lock
|
data/.gem_release.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
quiet: false
|
2
|
+
|
3
|
+
##
|
4
|
+
# NOTE: `bump` options.
|
5
|
+
# https://github.com/svenfuchs/gem-release#gem-bump
|
6
|
+
#
|
7
|
+
bump:
|
8
|
+
file: ./lib/convenient_service/version.rb
|
9
|
+
message: 🎉 🎉 🎉 Release %{version} 🎉 🎉 🎉
|
10
|
+
recurse: false
|
11
|
+
release: true
|
12
|
+
sign: true
|
13
|
+
tag: true
|
14
|
+
|
15
|
+
##
|
16
|
+
# NOTE: `release` options.
|
17
|
+
# https://github.com/svenfuchs/gem-release#gem-release
|
18
|
+
#
|
19
|
+
release:
|
20
|
+
color: true
|
21
|
+
host: https://rubygems.org
|
22
|
+
recurse: false
|
23
|
+
key: convenient_service
|
@@ -0,0 +1,54 @@
|
|
1
|
+
##
|
2
|
+
# CD using GitHub Actions.
|
3
|
+
#
|
4
|
+
# NOTE: GitHub Actions DSL.
|
5
|
+
# - https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions#understanding-the-workflow-file
|
6
|
+
# - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
7
|
+
#
|
8
|
+
# NOTE: Ruby workflow example.
|
9
|
+
# - https://github.com/ruby/setup-ruby#usage
|
10
|
+
#
|
11
|
+
# NOTE: How to set the working directory for the run directive (working-directory)?
|
12
|
+
# - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrunhttps://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
13
|
+
#
|
14
|
+
# NOTE: How to deploy to GitHub Pages using GitHub Actions?
|
15
|
+
# - https://github.com/marketplace/actions/github-pages-action
|
16
|
+
#
|
17
|
+
name: CD
|
18
|
+
|
19
|
+
on:
|
20
|
+
push:
|
21
|
+
branches:
|
22
|
+
- main
|
23
|
+
|
24
|
+
jobs:
|
25
|
+
deploy:
|
26
|
+
runs-on: ubuntu-20.04
|
27
|
+
name: Deploy
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@v2
|
30
|
+
- name: Set up Ruby
|
31
|
+
uses: ruby/setup-ruby@v1
|
32
|
+
with:
|
33
|
+
ruby-version: 3.1
|
34
|
+
##
|
35
|
+
# NOTE: Installs the latest compatible Bundler version, runs `bundle install` and caches installed gems.
|
36
|
+
# - https://github.com/ruby/setup-ruby#usage
|
37
|
+
# - https://github.com/ruby/setup-ruby#bundler
|
38
|
+
#
|
39
|
+
bundler-cache: true
|
40
|
+
##
|
41
|
+
# NOTE: Installs Task (task runner).
|
42
|
+
# https://taskfile.dev/installation/#github-actions
|
43
|
+
# https://github.com/go-task/task
|
44
|
+
#
|
45
|
+
- name: Install Task (task runner)
|
46
|
+
uses: arduino/setup-task@v1
|
47
|
+
- name: Generate docs
|
48
|
+
working-directory: ./
|
49
|
+
run: task docs:generate
|
50
|
+
- name: Deploy docs to GitHub Pages
|
51
|
+
uses: peaceiris/actions-gh-pages@v3
|
52
|
+
with:
|
53
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
54
|
+
publish_dir: ./docs
|
@@ -0,0 +1,190 @@
|
|
1
|
+
##
|
2
|
+
# CI using GitHub Actions.
|
3
|
+
#
|
4
|
+
# NOTE: GitHub Actions DSL.
|
5
|
+
# - https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions#understanding-the-workflow-file
|
6
|
+
# - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
7
|
+
#
|
8
|
+
# NOTE: Ruby workflow example.
|
9
|
+
# - https://github.com/ruby/setup-ruby#usage
|
10
|
+
#
|
11
|
+
# NOTE: Building and testing Ruby.
|
12
|
+
# - https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-ruby
|
13
|
+
#
|
14
|
+
# NOTE: More examples.
|
15
|
+
# - https://gist.github.com/geonizeli/57376c15f23feecdabf5ea213c3d7f41
|
16
|
+
# - https://docs.knapsackpro.com/2019/how-to-run-rspec-on-github-actions-for-ruby-on-rails-app-using-parallel-jobs
|
17
|
+
#
|
18
|
+
# NOTE: Sharing data between jobs and post-workflow artifacts.
|
19
|
+
# - https://docs.github.com/en/actions/learn-github-actions/essential-features-of-github-actions#sharing-data-between-jobs
|
20
|
+
# - https://github.com/actions/upload-artifact
|
21
|
+
# - https://github.com/actions/download-artifact
|
22
|
+
#
|
23
|
+
# NOTE: Virtual Environments.
|
24
|
+
# - https://github.com/actions/virtual-environments
|
25
|
+
#
|
26
|
+
# NOTE: How to collect and upload coverage reports for Coveralls?
|
27
|
+
# - https://github.com/marketplace/actions/coveralls-github-action#complete-parallel-job-example
|
28
|
+
# - https://github.com/coverallsapp/github-action/issues/29
|
29
|
+
# - https://github.com/coverallsapp/github-action/issues/29#issuecomment-704366557
|
30
|
+
#
|
31
|
+
# NOTE: What is the purpose of bundle-audit?
|
32
|
+
# - https://github.com/rubysec/bundler-audit
|
33
|
+
#
|
34
|
+
# IMPORTANT: This workflow is heavily based on Shopify/packwerk workflow.
|
35
|
+
# - https://github.com/Shopify/packwerk/blob/main/.github/workflows/ci.yml
|
36
|
+
# - https://github.com/Shopify/packwerk/actions/runs/331834549/workflow
|
37
|
+
#
|
38
|
+
name: CI
|
39
|
+
|
40
|
+
on:
|
41
|
+
pull_request:
|
42
|
+
branches:
|
43
|
+
- main
|
44
|
+
push:
|
45
|
+
branches:
|
46
|
+
- main
|
47
|
+
|
48
|
+
jobs:
|
49
|
+
lint:
|
50
|
+
##
|
51
|
+
# NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
|
52
|
+
# In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
|
53
|
+
# That is why the well-known Ubuntu is used.
|
54
|
+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
|
55
|
+
#
|
56
|
+
runs-on: ubuntu-20.04
|
57
|
+
name: Lint
|
58
|
+
steps:
|
59
|
+
- uses: actions/checkout@v2
|
60
|
+
- name: Set up Ruby
|
61
|
+
uses: ruby/setup-ruby@v1
|
62
|
+
with:
|
63
|
+
ruby-version: 3.1
|
64
|
+
##
|
65
|
+
# NOTE: Installs the latest compatible Bundler version, runs `bundle install` and caches installed gems.
|
66
|
+
# - https://github.com/ruby/setup-ruby#usage
|
67
|
+
# - https://github.com/ruby/setup-ruby#bundler
|
68
|
+
#
|
69
|
+
bundler-cache: true
|
70
|
+
##
|
71
|
+
# NOTE: Installs Task (task runner).
|
72
|
+
# https://taskfile.dev/installation/#github-actions
|
73
|
+
# https://github.com/go-task/task
|
74
|
+
#
|
75
|
+
- name: Install Task (task runner)
|
76
|
+
uses: arduino/setup-task@v1
|
77
|
+
- name: Run Rubocop
|
78
|
+
run: task rubocop
|
79
|
+
- name: Run Yard-Junk (docs linter)
|
80
|
+
run: task docs:lint
|
81
|
+
|
82
|
+
test:
|
83
|
+
needs:
|
84
|
+
- lint
|
85
|
+
##
|
86
|
+
# NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
|
87
|
+
# In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
|
88
|
+
# That is why the well-known Ubuntu is used.
|
89
|
+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
|
90
|
+
#
|
91
|
+
runs-on: ubuntu-20.04
|
92
|
+
strategy:
|
93
|
+
matrix:
|
94
|
+
gemfile:
|
95
|
+
- Gemfile
|
96
|
+
ruby:
|
97
|
+
- 2.7
|
98
|
+
##
|
99
|
+
# NOTE: 3.0 is wrapped by quotes in order to avoid misparsing it as integer.
|
100
|
+
# https://github.com/actions/runner/issues/849
|
101
|
+
#
|
102
|
+
- "3.0"
|
103
|
+
- 3.1
|
104
|
+
env:
|
105
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
106
|
+
|
107
|
+
name: "Test Ruby `${{ matrix.ruby }}` with Gemfile `${{ matrix.gemfile }}`"
|
108
|
+
steps:
|
109
|
+
- uses: actions/checkout@v2
|
110
|
+
- name: "Set up Ruby `${{ matrix.ruby }}`"
|
111
|
+
uses: ruby/setup-ruby@v1
|
112
|
+
with:
|
113
|
+
ruby-version: ${{ matrix.ruby }}
|
114
|
+
##
|
115
|
+
# NOTE: Installs the latest compatible Bundler version, runs `bundle install` and caches installed gems.
|
116
|
+
# - https://github.com/ruby/setup-ruby#usage
|
117
|
+
# - https://github.com/ruby/setup-ruby#bundler
|
118
|
+
#
|
119
|
+
bundler-cache: true
|
120
|
+
##
|
121
|
+
# NOTE: Installs Task (task runner).
|
122
|
+
# https://taskfile.dev/installation/#github-actions
|
123
|
+
# https://github.com/go-task/task
|
124
|
+
#
|
125
|
+
- name: Install Task (task runner)
|
126
|
+
uses: arduino/setup-task@v1
|
127
|
+
- name: Run RSpec without appraisals
|
128
|
+
run: task rspec:standard
|
129
|
+
- name: Install dependencies for appraisals
|
130
|
+
run: task deps:install
|
131
|
+
- name: Run RSpec with Rails 5.2
|
132
|
+
run: task rspec:rails_5.2
|
133
|
+
- name: Run RSpec with Rails 6.0
|
134
|
+
run: task rspec:rails_6.0
|
135
|
+
- name: Run RSpec with Rails 6.1
|
136
|
+
run: task rspec:rails_6.1
|
137
|
+
- name: Run RSpec with Rails 7.0
|
138
|
+
run: task rspec:rails_7.0
|
139
|
+
- name: Run RSpec with Dry
|
140
|
+
run: task rspec:dry
|
141
|
+
##
|
142
|
+
# NOTE: `lcov-result-merger` is written in JS.
|
143
|
+
#
|
144
|
+
- name: Set up Node.js 16.x
|
145
|
+
uses: actions/setup-node@v3
|
146
|
+
with:
|
147
|
+
node-version: 16.x
|
148
|
+
##
|
149
|
+
# NOTE: `lcov-result-merger` docs.
|
150
|
+
# https://github.com/mweibel/lcov-result-merger
|
151
|
+
#
|
152
|
+
# NOTE: `npx --yes` option.
|
153
|
+
# https://stackoverflow.com/questions/70742968/automatically-accept-installing-npx-package
|
154
|
+
#
|
155
|
+
# NOTE: `lcov-result-merger` uses `vinyl-fs` for globs which in turn uses `node-glob`.
|
156
|
+
# - https://github.com/mweibel/lcov-result-merger/blob/v3.3.0/bin/lcov-result-merger.js#L38
|
157
|
+
# - https://github.com/gulpjs/vinyl-fs#srcglobs-options
|
158
|
+
# - https://github.com/isaacs/node-glob#glob-primer
|
159
|
+
#
|
160
|
+
# NOTE: Append `&& cat coverage/lcov.info` to debug.
|
161
|
+
#
|
162
|
+
# IMPORTANT: 'coverage/**/lcov.info' single quotes are mandatory.
|
163
|
+
#
|
164
|
+
- name: Merge coverage reports into single file
|
165
|
+
run: task coverage:lcov:merge
|
166
|
+
- name: Configure coverage reports for Coveralls
|
167
|
+
uses: coverallsapp/github-action@master
|
168
|
+
with:
|
169
|
+
github-token: ${{ secrets.github_token }}
|
170
|
+
flag-name: run-${{ matrix.ruby }}-${{ matrix.gemfile }}
|
171
|
+
parallel: true
|
172
|
+
path-to-lcov: "./coverage/lcov.info"
|
173
|
+
|
174
|
+
coverage:
|
175
|
+
needs:
|
176
|
+
- test
|
177
|
+
##
|
178
|
+
# NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
|
179
|
+
# In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
|
180
|
+
# That is why the well-known Ubuntu is used.
|
181
|
+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
|
182
|
+
#
|
183
|
+
runs-on: ubuntu-20.04
|
184
|
+
name: Gather coverage
|
185
|
+
steps:
|
186
|
+
- name: Upload coverage reports to Coveralls
|
187
|
+
uses: coverallsapp/github-action@master
|
188
|
+
with:
|
189
|
+
github-token: ${{ secrets.github_token }}
|
190
|
+
parallel-finished: true
|
data/.gitignore
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/*
|
5
|
+
!/coverage/.gitkeep
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/tmp/
|
10
|
+
|
11
|
+
# rspec failure tracking
|
12
|
+
/.rspec_status
|
13
|
+
|
14
|
+
# Hide `byebug` history
|
15
|
+
/.byebug_history
|
16
|
+
|
17
|
+
# Ignore `Gemfile.lock`
|
18
|
+
/Gemfile.lock
|
19
|
+
|
20
|
+
##
|
21
|
+
# NOTE: Ignores `Gemfile` amd `Gemfile.lock` used in docker containers.
|
22
|
+
#
|
23
|
+
# NOTE: `Gemfile*` matches all files that start with Gemfile in any nesting.
|
24
|
+
# NOTE: `/Gemfile*` matches all files that start with Gemfile only from root folder.
|
25
|
+
#
|
26
|
+
/Gemfile*
|
27
|
+
|
28
|
+
##
|
29
|
+
# NOTE: Ignores `.DS_Store` in any nesting.
|
30
|
+
#
|
31
|
+
.DS_Store
|
32
|
+
|
33
|
+
# Ignore docs
|
34
|
+
/docs/*
|
data/.inch.yml
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
inherit_from:
|
2
|
+
- .rubocop_rspec.yml
|
3
|
+
|
4
|
+
##
|
5
|
+
# Standard based Rubocop config.
|
6
|
+
# - https://github.com/testdouble/standard
|
7
|
+
# - https://github.com/testdouble/standard#usage-via-rubocop
|
8
|
+
# - https://evilmartians.com/chronicles/rubocoping-with-legacy-bring-your-ruby-code-up-to-standard
|
9
|
+
#
|
10
|
+
require:
|
11
|
+
##
|
12
|
+
# Rubocop for RSpec files.
|
13
|
+
# https://github.com/rubocop/rubocop-rspec#usage
|
14
|
+
#
|
15
|
+
- rubocop-rspec
|
16
|
+
##
|
17
|
+
# NOTE: `rubocop-performance` is automatically bundled with Standard.
|
18
|
+
#
|
19
|
+
- rubocop-performance
|
20
|
+
##
|
21
|
+
# NOTE: Custom Standard cop that should be loaded before `config/base.yml`.
|
22
|
+
#
|
23
|
+
- standard/cop/block_single_line_braces
|
24
|
+
|
25
|
+
inherit_gem:
|
26
|
+
standard: config/base.yml
|
27
|
+
|
28
|
+
AllCops:
|
29
|
+
##
|
30
|
+
# https://github.com/testdouble/standard#how-do-i-specify-a-ruby-version-what-is-supported
|
31
|
+
#
|
32
|
+
TargetRubyVersion: 2.7
|
33
|
+
|
34
|
+
Exclude:
|
35
|
+
##
|
36
|
+
# NOTE: Excludes vendor from linting. Needed by GitHub Actions.
|
37
|
+
# - https://github.com/rubocop/rubocop/issues/9832
|
38
|
+
# - https://github.com/rubocop/rubocop/issues/9832#issuecomment-873398952
|
39
|
+
#
|
40
|
+
- vendor/**/*
|
41
|
+
|
42
|
+
##
|
43
|
+
# NOTE: Excludes dependencies from linting.
|
44
|
+
#
|
45
|
+
- lib/convenient_service/dependencies/**/*
|
data/.rubocop_rspec.yml
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
##
|
2
|
+
# Standard based Rubocop config suggested by Evil Martians.
|
3
|
+
# - https://evilmartians.com/chronicles/rubocoping-with-legacy-bring-your-ruby-code-up-to-standard
|
4
|
+
# - https://github.com/testdouble/standard
|
5
|
+
#
|
6
|
+
# Copied without any modifications from:
|
7
|
+
# https://gist.github.com/palkan/623c0816b05ed246bfe0cb406050990a
|
8
|
+
#
|
9
|
+
require:
|
10
|
+
- rubocop-rspec
|
11
|
+
|
12
|
+
RSpec/Focus:
|
13
|
+
Enabled: true
|
14
|
+
|
15
|
+
RSpec/EmptyExampleGroup:
|
16
|
+
Enabled: true
|
17
|
+
|
18
|
+
RSpec/EmptyLineAfterExampleGroup:
|
19
|
+
Enabled: true
|
20
|
+
|
21
|
+
RSpec/EmptyLineAfterFinalLet:
|
22
|
+
Enabled: true
|
23
|
+
|
24
|
+
RSpec/EmptyLineAfterHook:
|
25
|
+
Enabled: true
|
26
|
+
|
27
|
+
RSpec/EmptyLineAfterSubject:
|
28
|
+
Enabled: true
|
29
|
+
|
30
|
+
RSpec/HookArgument:
|
31
|
+
Enabled: true
|
32
|
+
|
33
|
+
RSpec/HooksBeforeExamples:
|
34
|
+
Enabled: true
|
35
|
+
|
36
|
+
RSpec/ImplicitExpect:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
RSpec/IteratedExpectation:
|
40
|
+
Enabled: true
|
41
|
+
|
42
|
+
RSpec/LetBeforeExamples:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
RSpec/MissingExampleGroupArgument:
|
46
|
+
Enabled: true
|
47
|
+
|
48
|
+
RSpec/ReceiveCounts:
|
49
|
+
Enabled: true
|
50
|
+
|
51
|
+
RSpec/Capybara/CurrentPathExpectation:
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
RSpec/FactoryBot/AttributeDefinedStatically:
|
55
|
+
Enabled: true
|
56
|
+
|
57
|
+
RSpec/FactoryBot/CreateList:
|
58
|
+
Enabled: true
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.1.0
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.1.0
|
data/.yardopts
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
##
|
2
|
+
# NOTE: `.yardopts` docs.
|
3
|
+
# https://rubydoc.info/gems/yard/YARD/CLI/Yardoc
|
4
|
+
#
|
5
|
+
# NOTE: `@internal` tag.
|
6
|
+
# https://github.com/lsegal/yard/issues/484#issuecomment-442596174
|
7
|
+
#
|
8
|
+
--markup markdown
|
9
|
+
--markup-provider commonmarker
|
10
|
+
--output-dir docs
|
11
|
+
--tag internal --hide-tag internal
|
12
|
+
'lib/**/*.rb' -
|
13
|
+
README.md
|
data/Appraisals
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
# TODO: GitHub wiki for `shouda-matchers`.
|
5
|
+
#
|
6
|
+
# IMPORTANT: `shoulda-matchers` loads active support core extensions.
|
7
|
+
# https://guides.rubyonrails.org/active_support_core_extensions.html
|
8
|
+
# https://apidock.com/rails/v6.1.3.1/Hash/symbolize_keys
|
9
|
+
#
|
10
|
+
# This can lead to the false positive tests. For example:
|
11
|
+
#
|
12
|
+
# {"a" => 1}.symbolize_keys
|
13
|
+
# # => {:a=>1}
|
14
|
+
# # Works well with Active Support
|
15
|
+
#
|
16
|
+
# {"a" => 1}.symbolize_keys
|
17
|
+
# # undefined method `symbolize_keys` for {"a"=>1}:Hash (NoMethodError)
|
18
|
+
# # Raises for Ruby 3.1 and lower.
|
19
|
+
#
|
20
|
+
# To debug who actually requires Active Support, use the following snippet:
|
21
|
+
#
|
22
|
+
# # env.rb (or any other file that is loaded as early as it is possible)
|
23
|
+
# def require(path)
|
24
|
+
# if path.include?("active_support")
|
25
|
+
# print "require \"#{path}\" from \"#{caller.first.gsub(ENV['HOME'], "~")}\"\n\n"
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# super
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
appraise "rails_5.2" do
|
32
|
+
gem "activemodel", "~> 5.2.0"
|
33
|
+
|
34
|
+
##
|
35
|
+
# NOTE: Waits for `should-matchers` full support.
|
36
|
+
#
|
37
|
+
# gem "shoulda-matchers", "~> 5.0.0"
|
38
|
+
end
|
39
|
+
|
40
|
+
appraise "rails_6.0" do
|
41
|
+
gem "activemodel", "~> 6.0.0"
|
42
|
+
|
43
|
+
##
|
44
|
+
# NOTE: Waits for `should-matchers` full support.
|
45
|
+
#
|
46
|
+
# gem "shoulda-matchers", "~> 5.0.0"
|
47
|
+
end
|
48
|
+
|
49
|
+
appraise "rails_6.1" do
|
50
|
+
gem "activemodel", "~> 6.1.0"
|
51
|
+
|
52
|
+
##
|
53
|
+
# NOTE: Waits for `should-matchers` full support.
|
54
|
+
#
|
55
|
+
# gem "shoulda-matchers", "~> 5.0.0"
|
56
|
+
end
|
57
|
+
|
58
|
+
appraise "rails_7.0" do
|
59
|
+
gem "activemodel", "~> 7.0.0"
|
60
|
+
|
61
|
+
##
|
62
|
+
# NOTE: Waits for `should-matchers` full support.
|
63
|
+
#
|
64
|
+
# gem "shoulda-matchers", "~> 5.0.0"
|
65
|
+
end
|
66
|
+
|
67
|
+
appraise "dry" do
|
68
|
+
gem "dry-initializer", "~> 3.0.0"
|
69
|
+
|
70
|
+
gem "dry-validation", "~> 1.5.0"
|
71
|
+
|
72
|
+
##
|
73
|
+
# NOTE: Restricts temporarily `dry-configurable` version (dependency of `dry-validation`) until the following issue is resolved:
|
74
|
+
# https://github.com/dry-rb/dry-configurable/issues/146
|
75
|
+
#
|
76
|
+
gem "dry-configurable", "~> 0.15.0"
|
77
|
+
|
78
|
+
##
|
79
|
+
# NOTE: Restricts temporarily `dry-schema` version (dependency of `dry-validation`) until the following issue is resolved:
|
80
|
+
# https://github.com/dry-rb/dry-schema/issues/434
|
81
|
+
#
|
82
|
+
gem "dry-schema", "~> 1.10.0"
|
83
|
+
|
84
|
+
##
|
85
|
+
# NOTE: Restricts temporarily `dry-core` version (dependency of `dry-validation`) until the following issue is resolved:
|
86
|
+
# https://github.com/dry-rb/dry-core/issues/73#issuecomment-1279774309
|
87
|
+
#
|
88
|
+
gem "dry-core", "~> 0.8.0"
|
89
|
+
end
|
90
|
+
|
91
|
+
##
|
92
|
+
# NOTE: A combination of all the highest versions of gems. Just for quick hacking in `task console:all`.
|
93
|
+
# IMPORTANT: Should not be enforced in CI, since integrity checks between external gems are not the goal of this library (a least for now).
|
94
|
+
#
|
95
|
+
appraise "all" do
|
96
|
+
gem "activemodel", "~> 7.0.0"
|
97
|
+
|
98
|
+
gem "dry-initializer", "~> 3.0.0"
|
99
|
+
|
100
|
+
gem "dry-validation", "~> 1.5.0"
|
101
|
+
|
102
|
+
##
|
103
|
+
# NOTE: Restricts temporarily `dry-configurable` version (dependency of `dry-validation`) until the following issue is resolved:
|
104
|
+
# https://github.com/dry-rb/dry-configurable/issues/146
|
105
|
+
#
|
106
|
+
gem "dry-configurable", "~> 0.15.0"
|
107
|
+
|
108
|
+
##
|
109
|
+
# NOTE: Restricts temporarily `dry-schema` version (dependency of `dry-validation`) until the following issue is resolved:
|
110
|
+
# https://github.com/dry-rb/dry-schema/issues/434
|
111
|
+
#
|
112
|
+
gem "dry-schema", "~> 1.10.0"
|
113
|
+
|
114
|
+
##
|
115
|
+
# NOTE: Restricts temporarily `dry-core` version (dependency of `dry-validation`) until the following issue is resolved:
|
116
|
+
# https://github.com/dry-rb/dry-core/issues/73#issuecomment-1279774309
|
117
|
+
#
|
118
|
+
gem "dry-core", "~> 0.8.0"
|
119
|
+
|
120
|
+
##
|
121
|
+
# NOTE: Waits for `should-matchers` full support.
|
122
|
+
#
|
123
|
+
# gem "shoulda-matchers", "~> 5.0.0"
|
124
|
+
end
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
## 0.1.0
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2022 Marian Kostyk
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
<!-- stand_with_ukraine:start -->
|
2
|
+
<h1 align="center">
|
3
|
+
#StandWithUkraine
|
4
|
+
</h1>
|
5
|
+
|
6
|
+
[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine)
|
7
|
+
<!-- stand_with_ukraine:end -->
|
8
|
+
|
9
|
+
<!-- header:start -->
|
10
|
+
<!-- TODO: Remove html to display in YARD with commonmark -->
|
11
|
+
<h1 align="center">
|
12
|
+
Convenient Service
|
13
|
+
</h1>
|
14
|
+
<!-- header:end -->
|
15
|
+
|
16
|
+
<!-- badges:start -->
|
17
|
+
[![Gem Version](https://badge.fury.io/rb/convenient_service.svg)](https://rubygems.org/gems/convenient_service) [![GitHub Actions CI](https://github.com/marian13/convenient_service/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/marian13/convenient_service/actions/workflows/ci.yml) [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard) [![Coverage Status](https://coveralls.io/repos/github/marian13/convenient_service/badge.svg)](https://coveralls.io/github/marian13/convenient_service?branch=main) [![inline docs](http://inch-ci.org/github/marian13/convenient_service.svg?branch=main)](http://inch-ci.org/github/marian13/convenient_service)
|
18
|
+
[![Convenient Service on stackoverflow](https://img.shields.io/badge/stackoverflow-community-orange.svg?logo=stackoverflow)](https://stackoverflow.com/tags/convenient-service)
|
19
|
+
[![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/user?u=31435716&fan_landing=true)
|
20
|
+
[![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
|
21
|
+
<!-- badges:end -->
|
22
|
+
|
23
|
+
<!-- logo:start -->
|
24
|
+
<!-- TODO: Remove html to display in YARD with commonmark -->
|
25
|
+
<p align="center">
|
26
|
+
<img src="https://raw.githubusercontent.com/marian13/convenient_service/main/logo.png" width="300">
|
27
|
+
</p>
|
28
|
+
<!-- logo:end -->
|
29
|
+
|
30
|
+
<!-- general_description:start -->
|
31
|
+
Yet another approach to revisit the service object pattern, but this time focusing on the unique, opinionated features.
|
32
|
+
|
33
|
+
\* Logo is downloaded from [CuteWallpaper.org](https://cutewallpaper.org/24/cartoon-diamond-png/2703010921.html). It will be replaced later.
|
34
|
+
<!-- general_description:end -->
|
35
|
+
|
36
|
+
<!-- warning:start -->
|
37
|
+
## WARNING ❗❗❗
|
38
|
+
|
39
|
+
This library is under heavy development. Public API may be subject to change. The first major release is still to come. Use the current version at your own risk. Ruby 2.7+. Thanks.
|
40
|
+
<!-- features:end -->
|
41
|
+
<!-- warning:end -->
|
42
|
+
|
43
|
+
<!-- documentation:start -->
|
44
|
+
## Documentation
|
45
|
+
|
46
|
+
- Check out [Convenient Service Official User Docs](https://marian13.github.io/convenient_service_docs/) for installation, requirements, and usage guides.
|
47
|
+
|
48
|
+
- Have a look at [Convenient Service Development Wiki](https://github.com/marian13/convenient_service/wiki) if you consider making a contribution.
|
49
|
+
|
50
|
+
---
|
51
|
+
<!-- documentation:end -->
|
52
|
+
|
53
|
+
<!-- author:start -->
|
54
|
+
Copyright (c) 2022 [Marian Kostyk](http://mariankostyk.com).
|
55
|
+
<!-- author:end -->
|