convenient_service 0.13.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/.vscode/CacheItsValue.code-snippets +1 -1
- data/.yardopts +3 -0
- data/CHANGELOG.md +67 -0
- data/README.md +1 -1
- data/Taskfile.yml +14 -2
- data/lib/convenient_service/dependencies.rb +15 -12
- data/lib/convenient_service/examples/dry/gemfile/services/assert_file_exists.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/assert_file_not_empty.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/parse_content.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb +3 -3
- data/lib/convenient_service/examples/dry/gemfile/services/read_file_content.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/run_shell_command.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile/services/strip_comments.rb +1 -1
- data/lib/convenient_service/examples/dry/gemfile.rb +1 -1
- data/lib/convenient_service/examples/dry/v1/gemfile/dry_service/config.rb +47 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/dry_service.rb +3 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_exists.rb +31 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_not_empty.rb +31 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_node_available.rb +28 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_npm_package_available.rb +41 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/assert_valid_ruby_syntax.rb +43 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/format.rb +39 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/format_body.rb +95 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/format_gems_with_envs.rb +98 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/format_gems_without_envs.rb +86 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/format_header.rb +76 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/parse_content.rb +95 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/read_file_content.rb +33 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/run_shell_command.rb +43 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services/strip_comments.rb +111 -0
- data/lib/convenient_service/examples/dry/v1/gemfile/services.rb +17 -0
- data/lib/convenient_service/examples/dry/v1/gemfile.rb +27 -0
- data/lib/convenient_service/examples/rails/gemfile/services/assert_file_exists.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile/services/parse_content.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile/services/print_shell_command.rb +3 -3
- data/lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile/services/run_shell_command.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile/services/strip_comments.rb +1 -1
- data/lib/convenient_service/examples/rails/gemfile.rb +1 -1
- data/lib/convenient_service/examples/rails/v1/gemfile/rails_service/config.rb +58 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/rails_service.rb +3 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_file_exists.rb +27 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_file_not_empty.rb +27 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_node_available.rb +28 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_npm_package_available.rb +37 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/assert_valid_ruby_syntax.rb +37 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/format.rb +68 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/format_body.rb +81 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/format_gems_with_envs.rb +84 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/format_gems_without_envs.rb +72 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/format_header.rb +70 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/merge_sections.rb +27 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/parse_content.rb +91 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/read_file_content.rb +29 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/replace_file_content.rb +39 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/run_shell_command.rb +38 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services/strip_comments.rb +109 -0
- data/lib/convenient_service/examples/rails/v1/gemfile/services.rb +20 -0
- data/lib/convenient_service/examples/rails/v1/gemfile.rb +27 -0
- data/lib/convenient_service/examples/standard/cowsay.rb +1 -1
- data/lib/convenient_service/examples/standard/date_time/services/safe_parse.rb +1 -1
- data/lib/convenient_service/examples/standard/date_time.rb +1 -1
- data/lib/convenient_service/examples/standard/factorial/services/calculate.rb +9 -3
- data/lib/convenient_service/examples/standard/factorial.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile/services/assert_file_exists.rb +3 -3
- data/lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb +3 -3
- data/lib/convenient_service/examples/standard/gemfile/services/assert_npm_package_available.rb +2 -2
- data/lib/convenient_service/examples/standard/gemfile/services/format.rb +4 -4
- data/lib/convenient_service/examples/standard/gemfile/services/merge_sections.rb +4 -4
- data/lib/convenient_service/examples/standard/gemfile/services/parse_content.rb +3 -3
- data/lib/convenient_service/examples/standard/gemfile/services/print_shell_command.rb +4 -4
- data/lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb +3 -3
- data/lib/convenient_service/examples/standard/gemfile/services/replace_file_content.rb +3 -3
- data/lib/convenient_service/examples/standard/gemfile/services/run_shell_command.rb +3 -3
- data/lib/convenient_service/examples/standard/gemfile/services/strip_comments.rb +1 -1
- data/lib/convenient_service/examples/standard/gemfile.rb +1 -1
- data/lib/convenient_service/examples/standard/request_params.rb +1 -1
- data/lib/convenient_service/examples/standard/v1/cowsay/services/build_cloud.rb +44 -0
- data/lib/convenient_service/examples/standard/v1/cowsay/services/build_cow.rb +40 -0
- data/lib/convenient_service/examples/standard/v1/cowsay/services/print.rb +34 -0
- data/lib/convenient_service/examples/standard/v1/cowsay/services.rb +5 -0
- data/lib/convenient_service/examples/standard/v1/cowsay.rb +26 -0
- data/lib/convenient_service/examples/standard/v1/date_time/services/safe_parse.rb +33 -0
- data/lib/convenient_service/examples/standard/v1/date_time/services.rb +3 -0
- data/lib/convenient_service/examples/standard/v1/date_time.rb +25 -0
- data/lib/convenient_service/examples/standard/v1/factorial/services/calculate.rb +51 -0
- data/lib/convenient_service/examples/standard/v1/factorial/services.rb +3 -0
- data/lib/convenient_service/examples/standard/v1/factorial/utils/timeout/with_timeout.rb +52 -0
- data/lib/convenient_service/examples/standard/v1/factorial/utils/timeout.rb +23 -0
- data/lib/convenient_service/examples/standard/v1/factorial/utils.rb +3 -0
- data/lib/convenient_service/examples/standard/v1/factorial.rb +26 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_file_exists.rb +32 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_file_not_empty.rb +32 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_node_available.rb +28 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_npm_package_available.rb +50 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/assert_valid_ruby_syntax.rb +41 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/format.rb +82 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/format_body.rb +85 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/format_gems_with_envs.rb +88 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/format_gems_without_envs.rb +76 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/format_header.rb +68 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/merge_sections.rb +54 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/parse_content.rb +103 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/print_shell_command.rb +47 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/read_file_content.rb +41 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/replace_file_content.rb +50 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/run_shell_command.rb +52 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services/strip_comments.rb +113 -0
- data/lib/convenient_service/examples/standard/v1/gemfile/services.rb +20 -0
- data/lib/convenient_service/examples/standard/v1/gemfile.rb +26 -0
- data/lib/convenient_service/examples/standard/v1/request_params/constants.rb +17 -0
- data/lib/convenient_service/examples/standard/v1/request_params/entities/description.rb +42 -0
- data/lib/convenient_service/examples/standard/v1/request_params/entities/format.rb +42 -0
- data/lib/convenient_service/examples/standard/v1/request_params/entities/id.rb +49 -0
- data/lib/convenient_service/examples/standard/v1/request_params/entities/logger.rb +23 -0
- data/lib/convenient_service/examples/standard/v1/request_params/entities/request.rb +25 -0
- data/lib/convenient_service/examples/standard/v1/request_params/entities/source.rb +42 -0
- data/lib/convenient_service/examples/standard/v1/request_params/entities/tag.rb +42 -0
- data/lib/convenient_service/examples/standard/v1/request_params/entities/title.rb +42 -0
- data/lib/convenient_service/examples/standard/v1/request_params/entities.rb +11 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services/apply_default_param_values.rb +28 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services/cast_params.rb +40 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services/extract_params_from_body.rb +72 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services/extract_params_from_path.rb +64 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services/filter_out_unpermitted_params.rb +28 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services/log_request_params.rb +56 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services/merge_params.rb +28 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services/prepare.rb +67 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services/validate_casted_params.rb +96 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services/validate_uncasted_params.rb +74 -0
- data/lib/convenient_service/examples/standard/v1/request_params/services.rb +13 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/array/wrap.rb +48 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/array.rb +23 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_body.rb +44 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_path.rb +42 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/http/request.rb +30 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/http.rb +3 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/integer/safe_parse.rb +33 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/integer.rb +27 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/json/safe_parse.rb +42 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/json.rb +23 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/object/blank.rb +36 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/object/present.rb +33 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/object.rb +28 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/url/valid.rb +49 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils/url.rb +23 -0
- data/lib/convenient_service/examples/standard/v1/request_params/utils.rb +8 -0
- data/lib/convenient_service/examples/standard/v1/request_params.rb +50 -0
- data/lib/convenient_service/feature/configs/aliases.rb +9 -0
- data/lib/convenient_service/feature/configs/standard.rb +22 -0
- data/lib/convenient_service/feature/configs.rb +5 -0
- data/lib/convenient_service/feature/plugins/aliases.rb +7 -0
- data/lib/convenient_service/feature/plugins/can_have_entries/commands/define_entry.rb +51 -0
- data/lib/convenient_service/feature/plugins/can_have_entries/commands.rb +3 -0
- data/lib/convenient_service/feature/plugins/can_have_entries/concern.rb +24 -0
- data/lib/convenient_service/feature/plugins/can_have_entries.rb +4 -0
- data/lib/convenient_service/feature/plugins.rb +5 -0
- data/lib/convenient_service/feature.rb +2 -9
- data/lib/convenient_service/rspec/helpers/{custom → classes}/stub_service/constants.rb +1 -1
- data/lib/convenient_service/rspec/helpers/{custom → classes}/stub_service/entities/result_spec.rb +8 -8
- data/lib/convenient_service/rspec/helpers/{custom → classes}/stub_service/entities/stubbed_service.rb +6 -6
- data/lib/convenient_service/rspec/helpers/{custom → classes}/stub_service.rb +1 -1
- data/lib/convenient_service/rspec/helpers/{custom → classes}/wrap_method/entities/wrapped_method.rb +6 -6
- data/lib/convenient_service/rspec/helpers/{custom → classes}/wrap_method/exceptions.rb +1 -1
- data/lib/convenient_service/rspec/helpers/{custom → classes}/wrap_method.rb +2 -2
- data/lib/convenient_service/rspec/helpers/classes.rb +4 -0
- data/lib/convenient_service/rspec/helpers/ignoring_exception.rb +1 -1
- data/lib/convenient_service/rspec/helpers/stub_service.rb +5 -5
- data/lib/convenient_service/rspec/helpers/wrap_method.rb +1 -1
- data/lib/convenient_service/rspec/helpers.rb +4 -6
- data/lib/convenient_service/rspec/matchers/call_chain_next.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/call_chain_next.rb +8 -8
- data/lib/convenient_service/rspec/matchers/{custom → classes}/export.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/constants.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/chain.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_code_part.rb +4 -4
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_data_part.rb +4 -4
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_message_part.rb +4 -4
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_parts.rb +3 -3
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_service_part.rb +4 -4
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_status_part.rb +4 -4
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_step_part.rb +4 -4
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_got_parts.rb +3 -3
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_got_service_part.rb +4 -4
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_got_step_part.rb +4 -4
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base.rb +4 -4
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/error/commands/generate_got_jsend_attributes_part.rb +19 -10
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/error.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/failure/commands/generate_got_jsend_attributes_part.rb +28 -20
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/failure.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/null.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb +41 -8
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/success.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers.rb +3 -3
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result.rb +4 -4
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_code.rb +5 -5
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_data.rb +5 -5
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_message.rb +5 -5
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_service.rb +5 -5
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_status.rb +5 -5
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_step.rb +6 -6
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_type.rb +5 -5
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator.rb +3 -3
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/exceptions.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base.rb +15 -15
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_error.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_failure.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_not_error.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_not_failure.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_not_success.rb +1 -1
- data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_success.rb +1 -1
- data/lib/convenient_service/rspec/matchers/classes.rb +5 -0
- data/lib/convenient_service/rspec/matchers/delegate_to.rb +1 -1
- data/lib/convenient_service/rspec/matchers/export.rb +1 -1
- data/lib/convenient_service/rspec/matchers/include_module.rb +1 -1
- data/lib/convenient_service/rspec/matchers/results/be_error.rb +1 -1
- data/lib/convenient_service/rspec/matchers/results/be_failure.rb +1 -1
- data/lib/convenient_service/rspec/matchers/results/be_not_error.rb +1 -1
- data/lib/convenient_service/rspec/matchers/results/be_not_failure.rb +1 -1
- data/lib/convenient_service/rspec/matchers/results/be_not_success.rb +1 -1
- data/lib/convenient_service/rspec/matchers/results/be_result.rb +31 -0
- data/lib/convenient_service/rspec/matchers/results/be_success.rb +1 -1
- data/lib/convenient_service/rspec/matchers/results.rb +4 -0
- data/lib/convenient_service/rspec/matchers.rb +6 -28
- data/lib/convenient_service/rspec/{helpers/custom → primitive_helpers/classes}/ignoring_exception/exceptions.rb +2 -2
- data/lib/convenient_service/rspec/{helpers/custom → primitive_helpers/classes}/ignoring_exception.rb +3 -3
- data/lib/convenient_service/rspec/{helpers/custom → primitive_helpers/classes}/in_threads.rb +2 -2
- data/lib/convenient_service/rspec/primitive_helpers/classes.rb +4 -0
- data/lib/convenient_service/rspec/primitive_helpers/ignoring_exception.rb +13 -0
- data/lib/convenient_service/rspec/{helpers → primitive_helpers}/in_threads.rb +2 -2
- data/lib/convenient_service/rspec/primitive_helpers.rb +19 -0
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/be_descendant_of.rb +2 -2
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/be_direct_descendant_of.rb +2 -2
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/cache_its_value.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/be_descendant_of.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/be_direct_descendant_of.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/cache_its_value.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/commands/generate_printable_method.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands/apply_stub_to_track_delegations.rb +4 -4
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands/generate_printable_arguments.rb +4 -4
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/base.rb +5 -5
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/return_its_value.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_any_arguments.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_concrete_arguments.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/without_arguments.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/values/base.rb +4 -4
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/values/with_calling_original.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/values/without_calling_original.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings_collection/exceptions.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings_collection.rb +13 -13
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/delegation.rb +3 -3
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher.rb +13 -13
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to.rb +13 -13
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/extend_module.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/have_abstract_method.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/have_alias_method.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/have_attr_accessor.rb +4 -4
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/have_attr_reader.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/have_attr_writer.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/include_module.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/prepend_module.rb +2 -2
- data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/singleton_prepend_module.rb +2 -2
- data/lib/convenient_service/rspec/primitive_matchers/classes.rb +15 -0
- data/lib/convenient_service/rspec/primitive_matchers/delegate_to.rb +13 -0
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/extend_module.rb +2 -2
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/have_abstract_method.rb +2 -2
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/have_alias_method.rb +2 -2
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/have_attr_accessor.rb +2 -2
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/have_attr_reader.rb +2 -2
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/have_attr_writer.rb +2 -2
- data/lib/convenient_service/rspec/primitive_matchers/include_module.rb +13 -0
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/prepend_module.rb +2 -2
- data/lib/convenient_service/rspec/{matchers → primitive_matchers}/singleton_prepend_module.rb +2 -2
- data/lib/convenient_service/rspec/primitive_matchers.rb +41 -0
- data/lib/convenient_service/rspec.rb +3 -0
- data/lib/convenient_service/{configs → service/configs}/aliases.rb +1 -1
- data/lib/convenient_service/{configs → service/configs}/awesome_print_inspect/aliases.rb +1 -1
- data/lib/convenient_service/service/configs/awesome_print_inspect.rb +61 -0
- data/lib/convenient_service/service/configs/minimal.rb +261 -0
- data/lib/convenient_service/service/configs/standard/aliases.rb +9 -0
- data/lib/convenient_service/service/configs/standard/v1.rb +185 -0
- data/lib/convenient_service/service/configs/standard.rb +238 -0
- data/lib/convenient_service/service/plugins/{can_have_fallback → can_have_fallbacks}/concern.rb +29 -17
- data/lib/convenient_service/service/plugins/{can_have_fallback → can_have_fallbacks}/exceptions.rb +7 -7
- data/lib/convenient_service/service/plugins/can_have_fallbacks/middleware.rb +36 -0
- data/lib/convenient_service/service/plugins/can_have_fallbacks.rb +5 -0
- data/lib/convenient_service/service/plugins/can_have_steps/concern.rb +9 -3
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/concern.rb +97 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/middleware.rb +74 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks.rb +4 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/raises_on_not_result_return_value/exceptions.rb +32 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/raises_on_not_result_return_value/middleware.rb +33 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/raises_on_not_result_return_value.rb +4 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins.rb +2 -1
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step_collection.rb +16 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/commands.rb +0 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/concern/class_methods.rb +10 -17
- data/lib/convenient_service/service/plugins/has_j_send_result/concern/instance_methods.rb +0 -9
- data/lib/convenient_service/service/plugins/has_j_send_result/constants.rb +4 -4
- data/lib/convenient_service/service/plugins/has_j_send_result/container.rb +8 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/{can_have_fallback → can_have_fallbacks}/concern.rb +16 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_fallbacks.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect/concern.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_inspect/concern.rb +9 -1
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/instance_methods.rb +7 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb +7 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result_params_validations/using_active_model_validations/middleware.rb +18 -7
- data/lib/convenient_service/service/plugins/has_j_send_result_params_validations/using_dry_validation/middleware.rb +26 -4
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/exceptions.rb +41 -0
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/middleware.rb +33 -6
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error.rb +0 -1
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/exceptions.rb +67 -6
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/middleware.rb +36 -3
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure.rb +0 -1
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb +67 -0
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands.rb +1 -1
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/exceptions.rb +15 -2
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/middleware.rb +8 -2
- data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/middleware.rb +11 -3
- data/lib/convenient_service/service/plugins.rb +1 -1
- data/lib/convenient_service/service.rb +1 -0
- data/lib/convenient_service/support/dependency_container/commands.rb +0 -1
- data/lib/convenient_service/support/dependency_container.rb +0 -1
- data/lib/convenient_service/version.rb +1 -1
- data/lib/convenient_service.rb +0 -1
- data/yard/yard-convenient_service_concern.rb +45 -0
- metadata +258 -133
- data/lib/convenient_service/configs/awesome_print_inspect.rb +0 -59
- data/lib/convenient_service/configs/minimal.rb +0 -257
- data/lib/convenient_service/configs/standard.rb +0 -208
- data/lib/convenient_service/rspec/helpers/custom.rb +0 -6
- data/lib/convenient_service/rspec/matchers/custom.rb +0 -18
- data/lib/convenient_service/service/plugins/can_have_fallback/middleware.rb +0 -30
- data/lib/convenient_service/service/plugins/can_have_fallback.rb +0 -5
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback/concern.rb +0 -53
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback/middleware.rb +0 -34
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallback.rb +0 -4
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_fallback.rb +0 -3
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/commands/assert_args_count_lower_than_three.rb +0 -25
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/commands/assert_either_args_or_kwargs_are_passed.rb +0 -26
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/commands.rb +0 -4
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/commands/assert_kwargs_contain_only_j_send_keys.rb +0 -53
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/commands.rb +0 -3
- data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_data_and_extra_keys.rb +0 -29
- data/lib/convenient_service/support/dependency_container/commands/define_entry.rb +0 -49
- data/lib/convenient_service/support/dependency_container/entry.rb +0 -22
- /data/lib/convenient_service/rspec/helpers/{custom → classes}/stub_service/entities.rb +0 -0
- /data/lib/convenient_service/rspec/helpers/{custom → classes}/wrap_method/entities.rb +0 -0
- /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands.rb +0 -0
- /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/error/commands.rb +0 -0
- /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/failure/commands.rb +0 -0
- /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/success/commands.rb +0 -0
- /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands.rb +0 -0
- /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities.rb +0 -0
- /data/lib/convenient_service/rspec/matchers/{custom → classes}/results.rb +0 -0
- /data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/commands.rb +0 -0
- /data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands.rb +0 -0
- /data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings.rb +0 -0
- /data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities.rb +0 -0
- /data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities.rb +0 -0
- /data/lib/convenient_service/{configs.rb → service/configs.rb} +0 -0
- /data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/{can_have_fallback → can_have_fallbacks}/result.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86314358470fd8502e3b00853f6f0aed31fe7837fe879b8a6fe9b02b23a37055
|
4
|
+
data.tar.gz: 8c7ddbfa504ef02c2774bbc4c616297345b684320ed0e4b4b10134f2a8851c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59dc4c6936c9764718dd105ef24255e89a21397b56770460850fa38365c37d0a4ba7d97bba924c72906f2ba27fc6b66b3981e9f1682a43c22f245e6daa811627
|
7
|
+
data.tar.gz: bc6942d0091fe8805164bfb01b00ed09c2be71ae0ea2838d2958331844053984309600f15151cb33fe261bc76913eed1f5299898b2e95df696020ab5a92e4d9d
|
data/.gitignore
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"scope": "ruby",
|
9
9
|
"prefix": "CacheItsValue",
|
10
10
|
"body": [
|
11
|
-
"include ConvenientService::RSpec::
|
11
|
+
"include ConvenientService::RSpec::PrimitiveMatchers::CacheItsValue",
|
12
12
|
],
|
13
13
|
"description": "`CacheItsValue` - a module that allows to use custom RSpec matcher `cache_its_value` to verify caching"
|
14
14
|
}
|
data/.yardopts
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
##
|
2
|
+
# NOTE: This config is used by `task docs:generate`.
|
3
|
+
#
|
2
4
|
# NOTE: `.yardopts` docs.
|
3
5
|
# https://rubydoc.info/gems/yard/YARD/CLI/Yardoc
|
4
6
|
#
|
@@ -9,5 +11,6 @@
|
|
9
11
|
--markup-provider commonmarker
|
10
12
|
--output-dir docs
|
11
13
|
--tag internal --hide-tag internal
|
14
|
+
--plugin convenient_service_concern
|
12
15
|
'lib/**/*.rb' -
|
13
16
|
README.md
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,72 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.15.0](https://github.com/marian13/convenient_service/compare/v0.14.0...v0.15.0) (2023-11-10)
|
4
|
+
|
5
|
+
|
6
|
+
### ⚠ BREAKING CHANGES
|
7
|
+
|
8
|
+
* **feature:** allow to use plugins for features
|
9
|
+
|
10
|
+
### Features
|
11
|
+
|
12
|
+
* **can_have_steps:** do not allow to modify steps from callbacks ([b90b7f7](https://github.com/marian13/convenient_service/commit/b90b7f7b5ba7b9cb12151d02495d1ad1c230504e))
|
13
|
+
* **feature:** allow to use plugins for features ([17645f8](https://github.com/marian13/convenient_service/commit/17645f888849b5cb42c2ae45aa8430cb96e28eff))
|
14
|
+
|
15
|
+
|
16
|
+
### Bug Fixes
|
17
|
+
|
18
|
+
* **can_have_steps:** introduce raises_on_not_result_return_value for steps ([bb27527](https://github.com/marian13/convenient_service/commit/bb27527b708747df356980cf831c660757fb4093))
|
19
|
+
|
20
|
+
|
21
|
+
### Miscellaneous Chores
|
22
|
+
|
23
|
+
* release 0.15.0 ([7f6a6a7](https://github.com/marian13/convenient_service/commit/7f6a6a74b722eaf26ae7195351a9078c944032dd))
|
24
|
+
|
25
|
+
## [0.14.0](https://github.com/marian13/convenient_service/compare/v0.13.0...v0.14.0) (2023-09-20)
|
26
|
+
|
27
|
+
|
28
|
+
### ⚠ BREAKING CHANGES
|
29
|
+
|
30
|
+
* **has_j_send_result_params_validations:** return errors on validation issues
|
31
|
+
* **has_j_send_result_params_validations:** return errors on validation issues
|
32
|
+
* **can_have_fallbacks:** fallback only failures by default
|
33
|
+
* **be_result:** update got part
|
34
|
+
* **has_j_send_result_short:** update constants
|
35
|
+
* **fallbacks:** create separate fallbacks failures and errors, run only error fallback when true
|
36
|
+
|
37
|
+
### Features
|
38
|
+
|
39
|
+
* **be_result:** introduce be_result ([f8fc85b](https://github.com/marian13/convenient_service/commit/f8fc85bb9141851c130a040731e4bb99114050d2))
|
40
|
+
* **can_have_fallbacks:** allow to pass fallback_true_status ([584dabe](https://github.com/marian13/convenient_service/commit/584dabe83f87c2d794ea779a3e5c7f0b0ea97f65))
|
41
|
+
* **can_have_fallbacks:** fallback only failures by default ([58650a7](https://github.com/marian13/convenient_service/commit/58650a736be0a4daaf283c6eef9e0867a34d44d4))
|
42
|
+
* **configs:** create copy of v1 ([bb039c8](https://github.com/marian13/convenient_service/commit/bb039c83f53607c4cf59f634c662fc604f13ff7b))
|
43
|
+
* **examples:** create copy of v1 ([70bd3fe](https://github.com/marian13/convenient_service/commit/70bd3febc4a88ebe7e7c3d33c7dd2e1c03331ccb))
|
44
|
+
* **has_awesome_print_inspect:** add message and data keys ([14e0a3f](https://github.com/marian13/convenient_service/commit/14e0a3f088edf8ea8565ba7ff06ca0212c4116e9))
|
45
|
+
* **has_inspect:** add message and data keys ([8f30b7a](https://github.com/marian13/convenient_service/commit/8f30b7a905b8a953d514061ed381a404b65c81af))
|
46
|
+
* **has_j_send_result_params_validations:** return errors on validation issues ([e25e1a4](https://github.com/marian13/convenient_service/commit/e25e1a4f94cc309035533220dbcfbfccbb94cc94))
|
47
|
+
* **has_j_send_result_params_validations:** return errors on validation issues ([09a9b94](https://github.com/marian13/convenient_service/commit/09a9b948070f3132818d1da9ef009d1d15655ab9))
|
48
|
+
* **has_j_send_result_short_syntax:** allow to pass data, message, code to all results ([aabf2f9](https://github.com/marian13/convenient_service/commit/aabf2f98d32407616159cbcd2bcc6349a9a3b98f))
|
49
|
+
* **has_j_send_result_short_syntax:** allow to pass message and code to short form of error ([1af3153](https://github.com/marian13/convenient_service/commit/1af3153aa1bf385eadcf73f30e13a3cc5126d793))
|
50
|
+
* **has_j_send_result_short_syntax:** allow to pass message and code to short form of failure ([7390630](https://github.com/marian13/convenient_service/commit/73906300f94ec6488f312d4a611f433d8c850691))
|
51
|
+
* **has_j_send_result_short_syntax:** allow to pass message and code to short form of success ([fdf2ab2](https://github.com/marian13/convenient_service/commit/fdf2ab23ade8941ed2c6dd10d17769eaebecc855))
|
52
|
+
* **has_j_send_status_and_attributes:** introduce Data#keys ([27f43e1](https://github.com/marian13/convenient_service/commit/27f43e1594988cc523e9bb3608e90a40e4c2b442))
|
53
|
+
* **has_j_send_status_and_attributes:** introduce Message#empty? ([6c1452d](https://github.com/marian13/convenient_service/commit/6c1452d99d71be45bb6cb95159a2fd32ffca668e))
|
54
|
+
* **rescues_result_unhandled_exceptions:** allow to pass status ([2ef85f2](https://github.com/marian13/convenient_service/commit/2ef85f2970dd56802bd22f467529da6242faf967))
|
55
|
+
* **using_active_model_validations:** allow to pass status to middleware ([bc5bb70](https://github.com/marian13/convenient_service/commit/bc5bb7027fe94724a8d28a3770b68c731b37ff10))
|
56
|
+
* **using_dry_validation:** allow to pass status to middleware ([3a5ef12](https://github.com/marian13/convenient_service/commit/3a5ef120219a8a94b1d15bb7226f265db967ce9e))
|
57
|
+
|
58
|
+
|
59
|
+
### Miscellaneous Chores
|
60
|
+
|
61
|
+
* release 0.14.0 ([c7cef07](https://github.com/marian13/convenient_service/commit/c7cef0721d8360329c19b8ad4d636bcec83805c6))
|
62
|
+
|
63
|
+
|
64
|
+
### Code Refactoring
|
65
|
+
|
66
|
+
* **be_result:** update got part ([428280a](https://github.com/marian13/convenient_service/commit/428280a8eb2aed09f49bd949f84b7e10ef933708))
|
67
|
+
* **fallbacks:** create separate fallbacks failures and errors, run only error fallback when true ([bbab564](https://github.com/marian13/convenient_service/commit/bbab5647d09ecdba9c9727bef3e2dc6b8138710b))
|
68
|
+
* **has_j_send_result_short:** update constants ([2074acd](https://github.com/marian13/convenient_service/commit/2074acd001115dd4c60d432e71a4fef58794c881))
|
69
|
+
|
3
70
|
## 0.13.0 (2023-08-27)
|
4
71
|
|
5
72
|
|
data/README.md
CHANGED
@@ -38,7 +38,7 @@ Yet another approach to revisit the service object pattern, but this time focusi
|
|
38
38
|
<!-- general_description:end -->
|
39
39
|
|
40
40
|
<!-- warning:start -->
|
41
|
-
## WARNING ❗❗❗
|
41
|
+
## ❗❗❗ WARNING ❗❗❗
|
42
42
|
|
43
43
|
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+, JRuby 9.4+ (TruffleRuby support is planned as well). Thanks.
|
44
44
|
<!-- features:end -->
|
data/Taskfile.yml
CHANGED
@@ -339,7 +339,13 @@ tasks:
|
|
339
339
|
#
|
340
340
|
docs:generate:
|
341
341
|
cmds:
|
342
|
-
|
342
|
+
##
|
343
|
+
# NOTE: yard supports plugins as gems only.
|
344
|
+
# - https://rubydoc.info/gems/yard/file/docs/GettingStarted.md#plugin-support
|
345
|
+
#
|
346
|
+
# NOTE: `RUBYLIB` is used to extend Ruby's `$LOAD_PATH`. This way yard treats `./yard` folder as a directory with custom gems.
|
347
|
+
#
|
348
|
+
- RUBYLIB=./yard bundle exec yardoc
|
343
349
|
|
344
350
|
docs:generate:open:
|
345
351
|
cmds:
|
@@ -664,4 +670,10 @@ tasks:
|
|
664
670
|
yard_junk:
|
665
671
|
cmds:
|
666
672
|
- mkdir -p docs
|
667
|
-
|
673
|
+
##
|
674
|
+
# NOTE: yard supports plugins as gems only.
|
675
|
+
# - https://rubydoc.info/gems/yard/file/docs/GettingStarted.md#plugin-support
|
676
|
+
#
|
677
|
+
# NOTE: `RUBYLIB` is used to extend Ruby's `$LOAD_PATH`. This way yard treats `./yard` folder as a directory with custom gems.
|
678
|
+
#
|
679
|
+
- RUBYLIB=./yard bundle exec yard-junk --text --html docs/junk-yard.html
|
@@ -125,8 +125,8 @@ module ConvenientService
|
|
125
125
|
require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_awesome_print_inspect"
|
126
126
|
require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_awesome_print_inspect"
|
127
127
|
require_relative "service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect"
|
128
|
-
require_relative "configs/awesome_print_inspect"
|
129
|
-
require_relative "configs/awesome_print_inspect/aliases"
|
128
|
+
require_relative "service/configs/awesome_print_inspect"
|
129
|
+
require_relative "service/configs/awesome_print_inspect/aliases"
|
130
130
|
end
|
131
131
|
|
132
132
|
##
|
@@ -292,9 +292,10 @@ module ConvenientService
|
|
292
292
|
#
|
293
293
|
# Loads standard config examples.
|
294
294
|
#
|
295
|
+
# @param version [String]
|
295
296
|
# @return [Boolean]
|
296
297
|
#
|
297
|
-
def require_standard_examples
|
298
|
+
def require_standard_examples(version: "")
|
298
299
|
##
|
299
300
|
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/date/rdoc/Date.html
|
300
301
|
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/date/rdoc/DateTime.html
|
@@ -325,11 +326,11 @@ module ConvenientService
|
|
325
326
|
#
|
326
327
|
require "uri"
|
327
328
|
|
328
|
-
require_relative "examples
|
329
|
-
require_relative "examples
|
330
|
-
require_relative "examples
|
331
|
-
require_relative "examples
|
332
|
-
require_relative "examples
|
329
|
+
require_relative ::File.join("examples", "standard", version, "cowsay")
|
330
|
+
require_relative ::File.join("examples", "standard", version, "date_time")
|
331
|
+
require_relative ::File.join("examples", "standard", version, "factorial")
|
332
|
+
require_relative ::File.join("examples", "standard", version, "gemfile")
|
333
|
+
require_relative ::File.join("examples", "standard", version, "request_params")
|
333
334
|
end
|
334
335
|
|
335
336
|
##
|
@@ -337,9 +338,10 @@ module ConvenientService
|
|
337
338
|
#
|
338
339
|
# Loads rails config examples.
|
339
340
|
#
|
341
|
+
# @param version [String]
|
340
342
|
# @return [Boolean]
|
341
343
|
#
|
342
|
-
def require_rails_examples
|
344
|
+
def require_rails_examples(version: "")
|
343
345
|
##
|
344
346
|
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html
|
345
347
|
# - https://github.com/flori/json
|
@@ -357,7 +359,7 @@ module ConvenientService
|
|
357
359
|
#
|
358
360
|
require "webrick"
|
359
361
|
|
360
|
-
require_relative "examples
|
362
|
+
require_relative ::File.join("examples", "rails", version, "gemfile")
|
361
363
|
end
|
362
364
|
|
363
365
|
##
|
@@ -365,9 +367,10 @@ module ConvenientService
|
|
365
367
|
#
|
366
368
|
# Loads dry config examples.
|
367
369
|
#
|
370
|
+
# @param version [String]
|
368
371
|
# @return [Boolean]
|
369
372
|
#
|
370
|
-
def require_dry_examples
|
373
|
+
def require_dry_examples(version: "")
|
371
374
|
##
|
372
375
|
# - https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html
|
373
376
|
# - https://github.com/flori/json
|
@@ -385,7 +388,7 @@ module ConvenientService
|
|
385
388
|
#
|
386
389
|
require "webrick"
|
387
390
|
|
388
|
-
require_relative "examples
|
391
|
+
require_relative ::File.join("examples", "dry", version, "gemfile")
|
389
392
|
end
|
390
393
|
|
391
394
|
##
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
# Usage example:
|
5
5
|
#
|
6
|
-
# ConvenientService::Examples::Dry::Gemfile::Services::PrintShellCommand.result(
|
6
|
+
# ConvenientService::Examples::Dry::Gemfile::Services::PrintShellCommand.result(command: "ls -a")
|
7
7
|
#
|
8
8
|
module ConvenientService
|
9
9
|
module Examples
|
@@ -24,7 +24,7 @@ module ConvenientService
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def result
|
27
|
-
return
|
27
|
+
return failure("Printing of shell command `#{command}` is skipped") if skip
|
28
28
|
|
29
29
|
out.puts
|
30
30
|
|
@@ -33,7 +33,7 @@ module ConvenientService
|
|
33
33
|
success
|
34
34
|
end
|
35
35
|
|
36
|
-
def
|
36
|
+
def fallback_failure_result
|
37
37
|
success
|
38
38
|
end
|
39
39
|
end
|
@@ -28,7 +28,7 @@ module ConvenientService
|
|
28
28
|
step :result, in: :file_without_comments, out: :content_without_comments
|
29
29
|
|
30
30
|
def result
|
31
|
-
success(
|
31
|
+
success(content_without_comments: file_without_comments.read)
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
# Usage example:
|
5
|
+
#
|
6
|
+
# result = ConvenientService::Examples::Dry::V1::Gemfile.format(path: "Gemfile")
|
7
|
+
# result = ConvenientService::Examples::Dry::V1::Gemfile.format(path: "spec/cli/gemfile/format/fixtures/Gemfile")
|
8
|
+
#
|
9
|
+
module ConvenientService
|
10
|
+
module Examples
|
11
|
+
module Dry
|
12
|
+
module V1
|
13
|
+
class Gemfile
|
14
|
+
class DryService
|
15
|
+
module Config
|
16
|
+
include Support::Concern
|
17
|
+
|
18
|
+
included do
|
19
|
+
include ConvenientService::Standard::V1::Config
|
20
|
+
|
21
|
+
##
|
22
|
+
# NOTE: `AssignsAttributesInConstructor::UsingDryInitializer` plugin.
|
23
|
+
#
|
24
|
+
concerns do
|
25
|
+
use ConvenientService::Plugins::Common::AssignsAttributesInConstructor::UsingDryInitializer::Concern
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# NOTE: `HasJSendResultParamsValidations::UsingDryValidation` plugin.
|
30
|
+
#
|
31
|
+
concerns do
|
32
|
+
use ConvenientService::Plugins::Service::HasJSendResultParamsValidations::UsingDryValidation::Concern
|
33
|
+
end
|
34
|
+
|
35
|
+
middlewares :result do
|
36
|
+
insert_before \
|
37
|
+
ConvenientService::Plugins::Service::RaisesOnNotResultReturnValue::Middleware,
|
38
|
+
ConvenientService::Plugins::Service::HasJSendResultParamsValidations::UsingDryValidation::Middleware.with(status: :failure)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module Examples
|
5
|
+
module Dry
|
6
|
+
module V1
|
7
|
+
class Gemfile
|
8
|
+
module Services
|
9
|
+
class AssertFileExists
|
10
|
+
include DryService::Config
|
11
|
+
|
12
|
+
option :path
|
13
|
+
|
14
|
+
contract do
|
15
|
+
schema do
|
16
|
+
required(:path).filled(:string)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def result
|
21
|
+
return error("File with path `#{path}` does NOT exist") unless ::File.exist?(path)
|
22
|
+
|
23
|
+
success
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module Examples
|
5
|
+
module Dry
|
6
|
+
module V1
|
7
|
+
class Gemfile
|
8
|
+
module Services
|
9
|
+
class AssertFileNotEmpty
|
10
|
+
include DryService::Config
|
11
|
+
|
12
|
+
option :path
|
13
|
+
|
14
|
+
contract do
|
15
|
+
schema do
|
16
|
+
required(:path).filled(:string)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def result
|
21
|
+
return error(message: "File with path `#{path}` is empty") if ::File.zero?(path)
|
22
|
+
|
23
|
+
success
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
# Usage example:
|
5
|
+
#
|
6
|
+
# ConvenientService::Examples::Dry::V1::Gemfile::Services::AssertNodeAvailable.result
|
7
|
+
#
|
8
|
+
module ConvenientService
|
9
|
+
module Examples
|
10
|
+
module Dry
|
11
|
+
module V1
|
12
|
+
class Gemfile
|
13
|
+
module Services
|
14
|
+
class AssertNodeAvailable
|
15
|
+
include DryService::Config
|
16
|
+
|
17
|
+
##
|
18
|
+
# NOTE: `> /dev/null 2>&1` is used to hide output.
|
19
|
+
# https://unix.stackexchange.com/a/119650/394253
|
20
|
+
#
|
21
|
+
step Services::RunShellCommand, in: {command: -> { "which node > /dev/null 2>&1" }}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
# Usage example:
|
5
|
+
#
|
6
|
+
# ConvenientService::Examples::Dry::V1::Gemfile::Services::AssertNpmPackageAvailable.result(name: "lodash")
|
7
|
+
#
|
8
|
+
module ConvenientService
|
9
|
+
module Examples
|
10
|
+
module Dry
|
11
|
+
module V1
|
12
|
+
class Gemfile
|
13
|
+
module Services
|
14
|
+
class AssertNpmPackageAvailable
|
15
|
+
include DryService::Config
|
16
|
+
|
17
|
+
option :name
|
18
|
+
|
19
|
+
contract do
|
20
|
+
schema do
|
21
|
+
required(:name).filled(:string)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
step Services::AssertNodeAvailable
|
26
|
+
|
27
|
+
##
|
28
|
+
# NOTE: `> /dev/null 2>&1` is used to hide output.
|
29
|
+
# https://unix.stackexchange.com/a/119650/394253
|
30
|
+
#
|
31
|
+
# NOTE: For `npm list` and its options docs, see
|
32
|
+
# https://docs.npmjs.com/cli/v7/commands/npm-ls
|
33
|
+
#
|
34
|
+
step Services::RunShellCommand, in: {command: -> { "npm list #{name} --depth=0 > /dev/null 2>&1" }}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ConvenientService
|
4
|
+
module Examples
|
5
|
+
module Dry
|
6
|
+
module V1
|
7
|
+
class Gemfile
|
8
|
+
module Services
|
9
|
+
class AssertValidRubySyntax
|
10
|
+
include DryService::Config
|
11
|
+
|
12
|
+
option :content
|
13
|
+
|
14
|
+
contract do
|
15
|
+
schema do
|
16
|
+
required(:content).value(:string)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def result
|
21
|
+
##
|
22
|
+
# NOTE: `> /dev/null 2>&1` is used to hide output.
|
23
|
+
# https://unix.stackexchange.com/a/119650/394253
|
24
|
+
#
|
25
|
+
check_ruby_syntax_result = Services::RunShellCommand.result(command: "ruby -c #{file.path} > /dev/null 2>&1")
|
26
|
+
|
27
|
+
return error("`#{content}` contains invalid Ruby syntax") unless check_ruby_syntax_result.success?
|
28
|
+
|
29
|
+
success
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def file
|
35
|
+
@file ||= ::Tempfile.new.tap { |tempfile| tempfile.write(content) }.tap(&:close)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
# Usage example:
|
5
|
+
#
|
6
|
+
# result = ConvenientService::Examples::Dry::V1::Gemfile::Services::Format.result(path: "Gemfile")
|
7
|
+
# result = ConvenientService::Examples::Dry::V1::Gemfile::Services::Format.result(path: "spec/cli/gemfile/format/fixtures/Gemfile")
|
8
|
+
#
|
9
|
+
module ConvenientService
|
10
|
+
module Examples
|
11
|
+
module Dry
|
12
|
+
module V1
|
13
|
+
class Gemfile
|
14
|
+
module Services
|
15
|
+
class Format
|
16
|
+
include DryService::Config
|
17
|
+
|
18
|
+
option :path
|
19
|
+
|
20
|
+
step Services::ReadFileContent, in: :path, out: :content
|
21
|
+
step Services::StripComments, in: :content, out: :content_without_comments
|
22
|
+
step Services::ParseContent, in: {content: :content_without_comments}, out: :parsed_content
|
23
|
+
step Services::FormatHeader, in: :parsed_content, out: {formatted_content: :formatted_header_content}
|
24
|
+
step Services::FormatBody, in: :parsed_content, out: {formatted_content: :formatted_body_content}
|
25
|
+
|
26
|
+
before :result do
|
27
|
+
@progressbar = ::ProgressBar.create(title: "Formatting", total: steps.count)
|
28
|
+
end
|
29
|
+
|
30
|
+
after :step do |step_result|
|
31
|
+
@progressbar.increment
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|