foobara 0.5.10 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of foobara might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +13 -0
- data/lib/foobara/all.rb +4 -2
- data/projects/command/src/command_pattern_implementation/concerns/command_data.rb +3 -3
- data/projects/command/src/command_pattern_implementation/concerns/domain_mappers.rb +2 -2
- data/projects/command/src/command_pattern_implementation/concerns/errors.rb +27 -27
- data/projects/command/src/command_pattern_implementation/concerns/errors_type.rb +7 -11
- data/projects/command/src/command_pattern_implementation/concerns/inputs.rb +4 -24
- data/projects/command/src/command_pattern_implementation/concerns/inputs_type.rb +9 -14
- data/projects/command/src/command_pattern_implementation/concerns/reflection.rb +7 -20
- data/projects/command/src/command_pattern_implementation/concerns/runtime.rb +3 -48
- data/projects/command/src/command_pattern_implementation/concerns/subcommands.rb +5 -5
- data/projects/command/src/command_pattern_implementation.rb +0 -1
- data/projects/command_connectors/lib/foobara/command_connectors.rb +1 -1
- data/projects/command_connectors/spec/command_connector_spec.rb +63 -4
- data/projects/command_connectors/spec/spec_helper.rb +1 -1
- data/projects/command_connectors/src/command_connector/concerns/desugarizers.rb +5 -5
- data/projects/command_connectors/src/command_connector/concerns/reflection.rb +4 -4
- data/projects/command_connectors/src/command_connector/request.rb +26 -10
- data/projects/command_connectors/src/command_connector/response.rb +2 -0
- data/projects/command_connectors/src/command_connector.rb +62 -58
- data/projects/command_connectors/src/command_registry/exposed_command.rb +7 -2
- data/projects/command_connectors/src/command_registry.rb +15 -15
- data/projects/command_connectors/src/desugarizer.rb +2 -2
- data/projects/command_connectors/src/desugarizers/attributes.rb +8 -8
- data/projects/command_connectors/src/desugarizers/auth.rb +1 -1
- data/projects/command_connectors/src/desugarizers/set_inputs.rb +3 -3
- data/projects/command_connectors/src/desugarizers/symbols_to_true.rb +2 -2
- data/projects/command_connectors/src/request_mutator.rb +6 -6
- data/projects/command_connectors/src/response_mutator.rb +6 -6
- data/projects/command_connectors/src/transformed_command.rb +39 -36
- data/projects/command_connectors/src/transformers/auth_errors_transformer.rb +2 -2
- data/projects/command_connectors/src/transformers/entity_to_primary_key_inputs_transformer.rb +2 -2
- data/projects/command_connectors/src/transformers/load_delegated_attributes_entities_pre_commit_transformer.rb +1 -1
- data/projects/domain_mapper/src/domain_mapper.rb +4 -4
- data/projects/domain_mapper/src/domain_mapper_lookups.rb +3 -3
- data/projects/entities/projects/detached_entity/lib/foobara/detached_entity.rb +1 -1
- data/projects/entities/projects/detached_entity/src/concerns/associations.rb +18 -18
- data/projects/entities/projects/detached_entity/src/concerns/initialization.rb +2 -2
- data/projects/entities/projects/detached_entity/src/concerns/primary_key.rb +4 -4
- data/projects/entities/projects/detached_entity/src/concerns/types.rb +2 -2
- data/projects/entities/projects/detached_entity/src/detached_entity_type.rb +4 -4
- data/projects/entities/projects/detached_entity/src/extensions/builtin_types/detached_entity/casters/primary_key.rb +1 -1
- data/projects/entities/projects/detached_entity/src/extensions/builtin_types/detached_entity/validators/model_instance_is_valid.rb +2 -2
- data/projects/entities/projects/detached_entity/src/extensions/type_declarations/handlers/registered_type_declaration/validate_primary_key_present.rb +30 -0
- data/projects/entities/projects/detached_entity/src/remove_sensitive_values_transformer_extensions.rb +2 -2
- data/projects/entities/projects/entity/lib/foobara/entity.rb +1 -1
- data/projects/entities/projects/entity/src/concerns/attributes.rb +6 -6
- data/projects/entities/projects/entity/src/concerns/callbacks.rb +1 -1
- data/projects/entities/projects/entity/src/concerns/initialization.rb +8 -8
- data/projects/entities/projects/entity/src/concerns/mutations.rb +4 -4
- data/projects/entities/projects/entity/src/concerns/persistence.rb +3 -3
- data/projects/entities/projects/entity/src/concerns/queries.rb +7 -7
- data/projects/entities/projects/entity/src/extensions/domain/domain_module_extension.rb +4 -4
- data/projects/entities/projects/entity/src/new_prepend.rb +2 -2
- data/projects/entities/projects/entity/src/not_found_error.rb +8 -8
- data/projects/entities/projects/entity/src/sensitive_value_removers/entity.rb +8 -5
- data/projects/entities/projects/in_memory_crud_driver_minimal/src/in_memory_minimal.rb +4 -4
- data/projects/entities/projects/model_attribute_helpers/lib/foobara/model_attribute_helpers.rb +0 -2
- data/projects/entities/projects/model_attribute_helpers/src/attribute_helper_aliases.rb +1 -1
- data/projects/entities/projects/model_attribute_helpers/src/attribute_helpers.rb +2 -2
- data/projects/entities/projects/nested_transactionable/lib/foobara/nested_transactionable.rb +5 -5
- data/projects/entities/projects/persistence/lib/foobara/persistence.rb +1 -1
- data/projects/entities/projects/persistence/src/entity_attributes_crud_driver.rb +35 -37
- data/projects/entities/projects/persistence/src/entity_base/transaction/concerns/entity_callback_handling.rb +25 -25
- data/projects/entities/projects/persistence/src/entity_base/transaction/concerns/state_transitions.rb +8 -8
- data/projects/entities/projects/persistence/src/entity_base/transaction/concerns/transaction_tracking.rb +1 -1
- data/projects/entities/projects/persistence/src/entity_base/transaction.rb +9 -9
- data/projects/entities/projects/persistence/src/entity_base/transaction_table/concerns/record_tracking.rb +4 -4
- data/projects/entities/projects/persistence/src/entity_base/transaction_table.rb +52 -52
- data/projects/entities/projects/persistence/src/entity_base.rb +7 -7
- data/projects/entities/projects/persistence/src/persistence.rb +23 -23
- data/projects/entities/projects/weak_object_set/src/weak_object_set.rb +16 -16
- data/projects/entities/spec/builtin_types/detached_entity_spec.rb +1 -1
- data/projects/entities/spec/builtin_types/entity_spec.rb +1 -1
- data/projects/entities/spec/builtin_types/model_spec.rb +1 -1
- data/projects/entities/spec/entity/extending_existing_spec.rb +1 -1
- data/projects/entities/spec/entity/from_type_declaration_spec.rb +1 -1
- data/projects/entities/spec/model/model_spec.rb +2 -2
- data/projects/entities/spec/spec_helper.rb +1 -1
- data/projects/entities_plumbing/lib/foobara/entities_plumbing.rb +6 -2
- data/projects/entities_plumbing/spec/inputs_spec.rb +54 -0
- data/projects/entities_plumbing/spec/spec_helper.rb +1 -1
- data/projects/entities_plumbing/spec/transaction_spec.rb +2 -2
- data/projects/entities_plumbing/src/extensions/command_pattern_implementation/concerns/entities.rb +21 -5
- data/projects/entities_plumbing/src/extensions/command_pattern_implementation/concerns/entity_errors_type.rb +23 -0
- data/projects/entities_plumbing/src/extensions/command_pattern_implementation/concerns/entity_inputs.rb +33 -0
- data/projects/entities_plumbing/src/extensions/command_pattern_implementation/concerns/entity_reflection.rb +39 -0
- data/projects/entities_plumbing/src/extensions/command_pattern_implementation/concerns/runtime.rb +39 -0
- data/projects/manifest/spec/spec_helper.rb +1 -1
- data/projects/manifest/src/base_manifest.rb +9 -9
- data/projects/manifest/src/model.rb +4 -4
- data/projects/manifest/src/type.rb +3 -3
- data/projects/manifest/src/type_declaration.rb +4 -4
- data/projects/model_plumbing/lib/foobara/model_plumbing.rb +2 -0
- data/projects/model_plumbing/src/extensions/command_pattern_implementation/concerns/model_inputs_type.rb +35 -0
- data/projects/typesystem/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_asc.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_both.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_desc.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/application.css +1 -0
- data/projects/typesystem/coverage/assets/0.13.2/application.js +7 -0
- data/projects/typesystem/coverage/assets/0.13.2/colorbox/border.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/colorbox/controls.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/colorbox/loading.gif +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/colorbox/loading_background.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/favicon_green.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/favicon_red.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/favicon_yellow.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-icons_222222_256x240.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-icons_2e83ff_256x240.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-icons_454545_256x240.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-icons_888888_256x240.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/loading.gif +0 -0
- data/projects/typesystem/coverage/assets/0.13.2/magnify.png +0 -0
- data/projects/typesystem/coverage/index.html +215756 -0
- data/projects/typesystem/projects/builtin_types/lib/foobara/builtin_types.rb +1 -1
- data/projects/typesystem/projects/builtin_types/src/builtin_types.rb +8 -8
- data/projects/typesystem/projects/builtin_types/src/duck/supported_validators/one_of/type_declaration_extension/extend_registered_type_declaration/desugarizers/module_desugarizer.rb +2 -2
- data/projects/typesystem/projects/builtin_types/src/email/validator_base.rb +4 -4
- data/projects/typesystem/projects/callback/src/block/concerns/block_parameter_required.rb +2 -2
- data/projects/typesystem/projects/callback/src/block/concerns/keyword_argumentable_block.rb +2 -2
- data/projects/typesystem/projects/callback/src/block/concerns/single_argument_block.rb +2 -2
- data/projects/typesystem/projects/callback/src/block.rb +4 -4
- data/projects/typesystem/projects/callback/src/registry/base.rb +10 -10
- data/projects/typesystem/projects/callback/src/registry/conditioned.rb +2 -2
- data/projects/typesystem/projects/callback/src/registry/multiple_action.rb +6 -6
- data/projects/typesystem/projects/callback/src/runner.rb +4 -4
- data/projects/typesystem/projects/callback/src/set.rb +4 -4
- data/projects/typesystem/projects/common/src/data_path.rb +14 -14
- data/projects/typesystem/projects/common/src/error.rb +11 -11
- data/projects/typesystem/projects/common/src/error_collection.rb +14 -14
- data/projects/typesystem/projects/common/src/error_key.rb +5 -3
- data/projects/typesystem/projects/common/src/outcome.rb +5 -5
- data/projects/typesystem/projects/common/src/possible_error.rb +2 -2
- data/projects/typesystem/projects/concerns/src/concern.rb +3 -3
- data/projects/typesystem/projects/delegate/src/extensions/module.rb +4 -4
- data/projects/typesystem/projects/domain/lib/foobara/domain.rb +2 -2
- data/projects/typesystem/projects/domain/src/domain.rb +5 -5
- data/projects/typesystem/projects/domain/src/domain_module_extension.rb +22 -22
- data/projects/typesystem/projects/domain/src/extensions/foobara.rb +6 -6
- data/projects/typesystem/projects/domain/src/module_extension.rb +4 -4
- data/projects/typesystem/projects/domain/src/organization.rb +6 -6
- data/projects/typesystem/projects/enumerated/src/accessors.rb +4 -4
- data/projects/typesystem/projects/enumerated/src/values.rb +14 -14
- data/projects/{entities → typesystem}/projects/model/lib/foobara/model.rb +1 -1
- data/projects/{entities → typesystem}/projects/model/src/concerns/classes.rb +4 -4
- data/projects/{entities → typesystem}/projects/model/src/concerns/types.rb +5 -5
- data/projects/{entities → typesystem}/projects/model/src/extensions/builtin_types/model/casters/hash.rb +1 -1
- data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration/attributes_handler_desugarizer.rb +2 -2
- data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration/model_class_desugarizer.rb +6 -6
- data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration/to_type_transformer.rb +4 -4
- data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_registered_model_type_declaration.rb +2 -2
- data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/registered_type_declaration/model_class_desugarizer.rb +6 -10
- data/projects/{entities → typesystem}/projects/model/src/model.rb +13 -13
- data/projects/{entities → typesystem}/projects/model/src/sensitive_value_removers/model.rb +1 -1
- data/projects/typesystem/projects/namespace/src/ambiguous_registry.rb +5 -5
- data/projects/typesystem/projects/namespace/src/base_registry.rb +8 -8
- data/projects/typesystem/projects/namespace/src/is_namespace.rb +19 -19
- data/projects/typesystem/projects/namespace/src/namespace/lookup_mode.rb +2 -2
- data/projects/typesystem/projects/namespace/src/namespace.rb +5 -5
- data/projects/typesystem/projects/namespace/src/namespace_helpers.rb +4 -4
- data/projects/typesystem/projects/namespace/src/prefixless_registry.rb +3 -3
- data/projects/typesystem/projects/namespace/src/scoped.rb +7 -7
- data/projects/typesystem/projects/project/src/foobara.rb +13 -7
- data/projects/typesystem/projects/project/src/project.rb +1 -1
- data/projects/typesystem/projects/state_machine/src/callbacks.rb +14 -14
- data/projects/typesystem/projects/state_machine/src/state_machine.rb +2 -2
- data/projects/typesystem/projects/state_machine/src/sugar.rb +3 -3
- data/projects/typesystem/projects/type_declarations/lib/foobara/type_declarations.rb +1 -1
- data/projects/typesystem/projects/type_declarations/src/attributes.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/attributes_transformers/from_yaml.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/attributes_transformers/only.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/attributes_transformers/reject.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/attributes_transformers/set.rb +4 -4
- data/projects/typesystem/projects/type_declarations/src/desugarizer.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/dsl/attributes.rb +9 -9
- data/projects/typesystem/projects/type_declarations/src/error_extension.rb +6 -6
- data/projects/typesystem/projects/type_declarations/src/handlers/extend_array_type_declaration/array_desugarizer.rb +3 -3
- data/projects/typesystem/projects/type_declarations/src/handlers/extend_array_type_declaration/element_type_declaration_desugarizer.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/handlers/extend_array_type_declaration/type_set_to_array_desugarizer.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/handlers/extend_attributes_type_declaration/element_type_declarations_desugarizer.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/handlers/extend_registered_type_declaration/to_type_transformer.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/handlers/extend_registered_type_declaration.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/handlers/extend_tuple_type_declaration/array_desugarizer.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/handlers/registered_type_declaration.rb +4 -3
- data/projects/typesystem/projects/type_declarations/src/remove_sensitive_values_transformer.rb +3 -3
- data/projects/typesystem/projects/type_declarations/src/type_builder.rb +5 -5
- data/projects/typesystem/projects/type_declarations/src/type_declaration.rb +7 -1
- data/projects/typesystem/projects/type_declarations/src/type_declaration_handler.rb +13 -13
- data/projects/typesystem/projects/type_declarations/src/type_declaration_handler_registry.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/type_declaration_validator.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/type_declarations.rb +2 -2
- data/projects/typesystem/projects/type_declarations/src/with_registries.rb +2 -2
- data/projects/typesystem/projects/types/src/extensions/error.rb +5 -5
- data/projects/typesystem/projects/types/src/type/concerns/reflection.rb +22 -22
- data/projects/typesystem/projects/types/src/type/concerns/supported_processor_registration.rb +4 -4
- data/projects/typesystem/projects/types/src/type.rb +25 -25
- data/projects/typesystem/projects/value/src/caster.rb +11 -11
- data/projects/typesystem/projects/value/src/data_error.rb +1 -1
- data/projects/typesystem/projects/value/src/mutator.rb +3 -3
- data/projects/typesystem/projects/value/src/processor/casting.rb +6 -6
- data/projects/typesystem/projects/value/src/processor/pipeline.rb +2 -2
- data/projects/typesystem/projects/value/src/processor/runner.rb +1 -1
- data/projects/typesystem/projects/value/src/processor/selection.rb +3 -3
- data/projects/typesystem/projects/value/src/processor.rb +23 -23
- data/projects/typesystem/projects/value/src/transformer.rb +5 -5
- data/projects/typesystem/projects/value/src/validator.rb +3 -3
- data/projects/typesystem/spec/builtin_types/custom_type_spec.rb +2 -2
- data/projects/typesystem/spec/builtin_types/instance_of_spec.rb +1 -1
- data/projects/typesystem/spec/foobara/foobara_spec.rb +18 -8
- data/projects/typesystem/spec/namespace/foobara_simulation_spec.rb +1 -1
- data/projects/typesystem/spec/spec_helper.rb +1 -1
- data/projects/typesystem/spec/state_machine/callbacks_spec.rb +1 -1
- data/projects/typesystem/spec/value/caster_spec.rb +1 -1
- data/version.rb +2 -2
- metadata +75 -35
- /data/projects/{command/src → entities_plumbing/src/extensions}/command_pattern_implementation/concerns/transactions.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/concerns/aliases.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/concerns/reflection.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/builtin_types/model/supported_transformers/mutable.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/builtin_types/model/validators/model_instance_is_valid.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration/array_with_symbolic_elements.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration/delegates_desugarizer.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration/delegates_validator.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration/hash_desugarizer.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration/move_private_from_element_types_to_root.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration/symbolize_private.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration/valid_attribute_names.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_model_type_declaration.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_registered_model_type_declaration/hash_desugarizer.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_registered_model_type_declaration/model_class_type_desugarizer.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_registered_model_type_declaration/mutable_validator.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_registered_model_type_declaration/normalize_mutable_attributes_desugarizer.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/handlers/extend_registered_model_type_declaration/to_type_transformer.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/extensions/type_declarations/lazy_element_types/model.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/sensitive_type_removers/extended_model.rb +0 -0
- /data/projects/{entities → typesystem}/projects/model/src/sensitive_type_removers/model.rb +0 -0
|
@@ -8,9 +8,9 @@ module Foobara
|
|
|
8
8
|
|
|
9
9
|
def default_crud_driver=(crud_driver)
|
|
10
10
|
if default_crud_driver
|
|
11
|
-
# :
|
|
11
|
+
# simplecov:disable
|
|
12
12
|
raise "Default crud driver already set."
|
|
13
|
-
# :
|
|
13
|
+
# simplecov:enable
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
@default_crud_driver = crud_driver
|
|
@@ -32,13 +32,13 @@ module Foobara
|
|
|
32
32
|
bases = objects_to_bases(objects)
|
|
33
33
|
|
|
34
34
|
if bases.empty?
|
|
35
|
-
# :
|
|
35
|
+
# simplecov:disable
|
|
36
36
|
raise "No bases found for #{objects}"
|
|
37
|
-
# :
|
|
37
|
+
# simplecov:enable
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
if bases.size == 1
|
|
41
|
-
bases.
|
|
41
|
+
bases[0].transaction(mode, &)
|
|
42
42
|
else
|
|
43
43
|
Foobara::TransactionGroup.run(bases:, mode:, &)
|
|
44
44
|
end
|
|
@@ -55,9 +55,9 @@ module Foobara
|
|
|
55
55
|
tx = base.current_transaction
|
|
56
56
|
|
|
57
57
|
unless tx
|
|
58
|
-
# :
|
|
58
|
+
# simplecov:disable
|
|
59
59
|
raise NoTransactionOpenError
|
|
60
|
-
# :
|
|
60
|
+
# simplecov:enable
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
tx
|
|
@@ -75,18 +75,18 @@ module Foobara
|
|
|
75
75
|
bases = to_bases(object)
|
|
76
76
|
|
|
77
77
|
if bases.empty?
|
|
78
|
-
# :
|
|
78
|
+
# simplecov:disable
|
|
79
79
|
raise "Could not find a base for #{object}"
|
|
80
|
-
# :
|
|
80
|
+
# simplecov:enable
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
if bases.size > 1
|
|
84
|
-
# :
|
|
84
|
+
# simplecov:disable
|
|
85
85
|
raise "Expected to only find 1 base for #{object} but found #{bases.size}"
|
|
86
|
-
# :
|
|
86
|
+
# simplecov:enable
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
bases
|
|
89
|
+
bases[0]
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def to_bases(object)
|
|
@@ -118,9 +118,9 @@ module Foobara
|
|
|
118
118
|
when Entity
|
|
119
119
|
base_for_entity_class(object.class)
|
|
120
120
|
else
|
|
121
|
-
# :
|
|
121
|
+
# simplecov:disable
|
|
122
122
|
raise ArgumentError, "Not able to convert #{object} to an entity base"
|
|
123
|
-
# :
|
|
123
|
+
# simplecov:enable
|
|
124
124
|
end
|
|
125
125
|
end
|
|
126
126
|
|
|
@@ -147,30 +147,30 @@ module Foobara
|
|
|
147
147
|
base.register_table(table)
|
|
148
148
|
tables_for_entity_class_name[entity_class_name] = table
|
|
149
149
|
else
|
|
150
|
-
# :
|
|
150
|
+
# simplecov:disable
|
|
151
151
|
raise NoTableOrCrudDriverError,
|
|
152
152
|
"Can't find table for #{entity_class_name} and can't dynamically build one without default crud driver."
|
|
153
|
-
# :
|
|
153
|
+
# simplecov:enable
|
|
154
154
|
end
|
|
155
155
|
end
|
|
156
156
|
|
|
157
157
|
def register_base(*args, name: nil, table_prefix: nil)
|
|
158
158
|
base = case args
|
|
159
159
|
in [EntityBase]
|
|
160
|
-
args
|
|
160
|
+
args[0]
|
|
161
161
|
in [Class => crud_driver_class, *rest] if crud_driver_class < EntityAttributesCrudDriver
|
|
162
162
|
unless name
|
|
163
|
-
# :
|
|
163
|
+
# simplecov:disable
|
|
164
164
|
raise ArgumentError, "Must provide name: when registering a base with a crud driver class"
|
|
165
|
-
# :
|
|
165
|
+
# simplecov:enable
|
|
166
166
|
end
|
|
167
167
|
|
|
168
168
|
crud_args, opts = case rest
|
|
169
169
|
in [Hash]
|
|
170
170
|
# TODO: test this code path
|
|
171
|
-
# :
|
|
171
|
+
# simplecov:disable
|
|
172
172
|
[[], rest]
|
|
173
|
-
# :
|
|
173
|
+
# simplecov:enable
|
|
174
174
|
in [] | [Array] | [Array, Hash]
|
|
175
175
|
rest
|
|
176
176
|
in Array
|
|
@@ -197,9 +197,9 @@ module Foobara
|
|
|
197
197
|
missing = bases - sorted_bases
|
|
198
198
|
|
|
199
199
|
unless missing.empty?
|
|
200
|
-
# :
|
|
200
|
+
# simplecov:disable
|
|
201
201
|
raise ArgumentError, "Missing bases: #{missing} are the not registered or something?"
|
|
202
|
-
# :
|
|
202
|
+
# simplecov:enable
|
|
203
203
|
# sorted_bases = [*missing, *sorted_bases]
|
|
204
204
|
end
|
|
205
205
|
|
|
@@ -16,9 +16,9 @@ module Foobara
|
|
|
16
16
|
|
|
17
17
|
def cleanup_proc
|
|
18
18
|
if deactivated?
|
|
19
|
-
# :
|
|
19
|
+
# simplecov:disable
|
|
20
20
|
raise "GarbageCleaner has been deactivated"
|
|
21
|
-
# :
|
|
21
|
+
# simplecov:enable
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
@cleanup_proc ||= begin
|
|
@@ -29,9 +29,9 @@ module Foobara
|
|
|
29
29
|
begin
|
|
30
30
|
queue.push(object_id)
|
|
31
31
|
rescue ClosedQueueError
|
|
32
|
-
# :
|
|
32
|
+
# simplecov:disable
|
|
33
33
|
deactivate
|
|
34
|
-
# :
|
|
34
|
+
# simplecov:enable
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|
|
@@ -50,9 +50,9 @@ module Foobara
|
|
|
50
50
|
self.queue = nil
|
|
51
51
|
break
|
|
52
52
|
else
|
|
53
|
-
# :
|
|
53
|
+
# simplecov:disable
|
|
54
54
|
raise "Unexpected nil value in the queue"
|
|
55
|
-
# :
|
|
55
|
+
# simplecov:enable
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
end
|
|
@@ -101,9 +101,9 @@ module Foobara
|
|
|
101
101
|
object = begin
|
|
102
102
|
ref&.__getobj__
|
|
103
103
|
rescue WeakRef::RefError
|
|
104
|
-
# :
|
|
104
|
+
# simplecov:disable
|
|
105
105
|
nil
|
|
106
|
-
# :
|
|
106
|
+
# simplecov:enable
|
|
107
107
|
end
|
|
108
108
|
|
|
109
109
|
if ref&.weakref_alive?
|
|
@@ -159,9 +159,9 @@ module Foobara
|
|
|
159
159
|
|
|
160
160
|
def <<(object)
|
|
161
161
|
if closed?
|
|
162
|
-
# :
|
|
162
|
+
# simplecov:disable
|
|
163
163
|
raise "Cannot add objects to a closed WeakObjectSet"
|
|
164
|
-
# :
|
|
164
|
+
# simplecov:enable
|
|
165
165
|
end
|
|
166
166
|
|
|
167
167
|
object_id = object.object_id
|
|
@@ -171,7 +171,7 @@ module Foobara
|
|
|
171
171
|
|
|
172
172
|
if existing_object
|
|
173
173
|
if key_method
|
|
174
|
-
key = object.
|
|
174
|
+
key = object.__send__(key_method)
|
|
175
175
|
old_key = object_id_to_key[object_id]
|
|
176
176
|
|
|
177
177
|
if key != old_key
|
|
@@ -189,7 +189,7 @@ module Foobara
|
|
|
189
189
|
garbage_cleaner.track(object)
|
|
190
190
|
|
|
191
191
|
if key_method
|
|
192
|
-
key = object.
|
|
192
|
+
key = object.__send__(key_method)
|
|
193
193
|
|
|
194
194
|
if key
|
|
195
195
|
existing_record_object_id = key_to_object_id[key]
|
|
@@ -197,9 +197,9 @@ module Foobara
|
|
|
197
197
|
if existing_record_object_id
|
|
198
198
|
# Sometimes this path is hit in the test suite and sometimes not, depending on
|
|
199
199
|
# non-deterministic behavior of the garbage collector
|
|
200
|
-
# :
|
|
200
|
+
# simplecov:disable
|
|
201
201
|
delete(existing_record_object_id)
|
|
202
|
-
# :
|
|
202
|
+
# simplecov:enable
|
|
203
203
|
end
|
|
204
204
|
|
|
205
205
|
key_to_object_id[key] = object_id
|
|
@@ -237,9 +237,9 @@ module Foobara
|
|
|
237
237
|
def find_by_key(key)
|
|
238
238
|
monitor.synchronize do
|
|
239
239
|
unless key_method
|
|
240
|
-
# :
|
|
240
|
+
# simplecov:disable
|
|
241
241
|
raise "Cannot find by key if there was no key_method given."
|
|
242
|
-
# :
|
|
242
|
+
# simplecov:enable
|
|
243
243
|
end
|
|
244
244
|
|
|
245
245
|
object_id = key_to_object_id[key]
|
|
@@ -6,7 +6,7 @@ RSpec.describe Foobara::Model do
|
|
|
6
6
|
:SomeEntity,
|
|
7
7
|
:Foo
|
|
8
8
|
].each do |const|
|
|
9
|
-
Object.
|
|
9
|
+
Object.__send__(:remove_const, const) if Object.const_defined?(const)
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
@@ -117,7 +117,7 @@ RSpec.describe Foobara::Model do
|
|
|
117
117
|
|
|
118
118
|
after do
|
|
119
119
|
if Object.const_defined?(:Foo)
|
|
120
|
-
Object.
|
|
120
|
+
Object.__send__(:remove_const, :Foo)
|
|
121
121
|
end
|
|
122
122
|
end
|
|
123
123
|
|
|
@@ -17,7 +17,7 @@ SimpleCov.command_name "entities"
|
|
|
17
17
|
SimpleCov.coverage_dir "coverage/entities"
|
|
18
18
|
|
|
19
19
|
SimpleCov.start do
|
|
20
|
-
|
|
20
|
+
skip "spec/support/"
|
|
21
21
|
# This avoids printing out info about coverage generated by HTTPFormatter
|
|
22
22
|
formatter Class.new { def format(_result) = nil }
|
|
23
23
|
end
|
|
@@ -2,12 +2,16 @@ module Foobara
|
|
|
2
2
|
module EntitiesPlumbing
|
|
3
3
|
class << self
|
|
4
4
|
def install!
|
|
5
|
+
CommandPatternImplementation.include CommandPatternImplementation::Concerns::Transactions
|
|
5
6
|
CommandPatternImplementation.include CommandPatternImplementation::Concerns::Entities
|
|
7
|
+
CommandPatternImplementation.include CommandPatternImplementation::Concerns::EntityInputs
|
|
8
|
+
CommandPatternImplementation.include CommandPatternImplementation::Concerns::EntityErrorsType
|
|
9
|
+
CommandPatternImplementation.include CommandPatternImplementation::Concerns::EntityReflection
|
|
6
10
|
|
|
7
11
|
if Foobara.project_installed?("command_connectors")
|
|
8
|
-
# :
|
|
12
|
+
# simplecov:disable
|
|
9
13
|
install_command_connector_extension
|
|
10
|
-
# :
|
|
14
|
+
# simplecov:enable
|
|
11
15
|
end
|
|
12
16
|
end
|
|
13
17
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
RSpec.describe Foobara::CommandPatternImplementation::Concerns::Entities do
|
|
2
|
+
describe "#run" do
|
|
3
|
+
after { Foobara.reset_alls }
|
|
4
|
+
|
|
5
|
+
before do
|
|
6
|
+
Foobara::Persistence.default_crud_driver = Foobara::Persistence::CrudDrivers::InMemory.new
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
context "when passing entity type as the inputs" do
|
|
10
|
+
let(:read_command) do
|
|
11
|
+
user_class
|
|
12
|
+
stub_class(:ReadUser, Foobara::Command) do
|
|
13
|
+
inputs User
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
context "when entity has no primary key yet" do
|
|
18
|
+
let(:user_class) do
|
|
19
|
+
stub_class :User, Foobara::Entity do
|
|
20
|
+
attributes name: { type: :string, required: true }
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it "results in a MissingPrimaryKeyError" do
|
|
25
|
+
expect {
|
|
26
|
+
read_command
|
|
27
|
+
}.to raise_error(
|
|
28
|
+
Foobara::TypeDeclarations::Handlers::RegisteredTypeDeclaration::
|
|
29
|
+
ValidatePrimaryKeyPresent::MissingPrimaryKeyError
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
context "when entity has primary key" do
|
|
35
|
+
let(:user_class) do
|
|
36
|
+
stub_class :User, Foobara::Entity do
|
|
37
|
+
attributes do
|
|
38
|
+
name :string, :required
|
|
39
|
+
id :integer
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
primary_key :id
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "results in a MissingPrimaryKeyError" do
|
|
47
|
+
expect {
|
|
48
|
+
read_command
|
|
49
|
+
}.to raise_error(Foobara::CommandPatternImplementation::BadCommandInputsError)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -17,7 +17,7 @@ SimpleCov.command_name "entities_plumbing"
|
|
|
17
17
|
SimpleCov.coverage_dir "coverage/entities_plumbing"
|
|
18
18
|
|
|
19
19
|
SimpleCov.start do
|
|
20
|
-
|
|
20
|
+
skip "spec/support/"
|
|
21
21
|
# This avoids printing out info about coverage generated by HTTPFormatter
|
|
22
22
|
formatter Class.new { def format(_result) = nil }
|
|
23
23
|
end
|
|
@@ -186,9 +186,9 @@ RSpec.describe Foobara::CommandPatternImplementation::Concerns::Entities do
|
|
|
186
186
|
error = errors.first
|
|
187
187
|
|
|
188
188
|
expect(error.class.name).to eq("ReadEmployee::EmployeeNotFoundError")
|
|
189
|
-
expect(error.key).to eq("
|
|
189
|
+
expect(error.key).to eq("data.employee.not_found")
|
|
190
190
|
|
|
191
|
-
expect(error.symbol).to be(:
|
|
191
|
+
expect(error.symbol).to be(:not_found)
|
|
192
192
|
|
|
193
193
|
context = error.context
|
|
194
194
|
|
data/projects/entities_plumbing/src/extensions/command_pattern_implementation/concerns/entities.rb
CHANGED
|
@@ -5,6 +5,18 @@ module Foobara
|
|
|
5
5
|
include Concern
|
|
6
6
|
|
|
7
7
|
module ClassMethods
|
|
8
|
+
def inputs(...)
|
|
9
|
+
if defined?(@entity_class_paths)
|
|
10
|
+
remove_instance_variable(:@entity_class_paths)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
if defined?(@inputs_association_paths)
|
|
14
|
+
remove_instance_variable(:@inputs_association_paths)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
super
|
|
18
|
+
end
|
|
19
|
+
|
|
8
20
|
# Only needed for entities not discoverable through the inputs
|
|
9
21
|
def depends_on_entities(*entities_to_add)
|
|
10
22
|
if entities_to_add.empty?
|
|
@@ -26,8 +38,6 @@ module Foobara
|
|
|
26
38
|
).transform_values(&:target_class)
|
|
27
39
|
end
|
|
28
40
|
|
|
29
|
-
# TODO: move to better concern!
|
|
30
|
-
# TODO: make work with inheritance
|
|
31
41
|
def to_load(*paths)
|
|
32
42
|
h = @to_load_paths_and_error_classes || {}
|
|
33
43
|
|
|
@@ -36,7 +46,7 @@ module Foobara
|
|
|
36
46
|
entity_class = entity_class_paths[path.to_s]
|
|
37
47
|
error_class = Entity::NotFoundError.subclass(self, entity_class, path)
|
|
38
48
|
h[path.to_s] = error_class
|
|
39
|
-
|
|
49
|
+
possible_input_error(path, error_class)
|
|
40
50
|
end
|
|
41
51
|
|
|
42
52
|
@to_load_paths_and_error_classes = h.sort_by do |path, _error_class|
|
|
@@ -64,14 +74,20 @@ module Foobara
|
|
|
64
74
|
begin
|
|
65
75
|
# here... filter out created entities...
|
|
66
76
|
if thunks_to_load.size == 1
|
|
67
|
-
entity_class.load(thunks_to_load
|
|
77
|
+
entity_class.load(thunks_to_load[0])
|
|
68
78
|
else
|
|
69
79
|
entity_class.load_many(thunks_to_load)
|
|
70
80
|
end
|
|
71
81
|
|
|
72
82
|
thunks_to_load
|
|
73
83
|
rescue Entity::NotFoundError => e
|
|
74
|
-
|
|
84
|
+
error_data_path = DataPath.new(e.data_path)
|
|
85
|
+
error_data_path.prepend!(data_path)
|
|
86
|
+
|
|
87
|
+
error = error_class.for(e.criteria, data_path: error_data_path.to_s)
|
|
88
|
+
add_input_error(error)
|
|
89
|
+
|
|
90
|
+
halt!
|
|
75
91
|
end
|
|
76
92
|
end
|
|
77
93
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Foobara
|
|
2
|
+
module CommandPatternImplementation
|
|
3
|
+
module Concerns
|
|
4
|
+
module EntityErrorsType
|
|
5
|
+
include Concern
|
|
6
|
+
|
|
7
|
+
module ClassMethods
|
|
8
|
+
def error_context_type_map
|
|
9
|
+
return @error_context_type_map if defined?(@error_context_type_map)
|
|
10
|
+
|
|
11
|
+
super
|
|
12
|
+
|
|
13
|
+
inputs_association_paths&.each do |data_path|
|
|
14
|
+
possible_input_error(data_path.to_sym, Entity::NotFoundError)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
@error_context_type_map
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module Foobara
|
|
2
|
+
module CommandPatternImplementation
|
|
3
|
+
module Concerns
|
|
4
|
+
module EntityInputs
|
|
5
|
+
include Concern
|
|
6
|
+
|
|
7
|
+
module ClassMethods
|
|
8
|
+
def inputs_association_paths
|
|
9
|
+
return @inputs_association_paths if defined?(@inputs_association_paths)
|
|
10
|
+
|
|
11
|
+
@inputs_association_paths = if inputs_type.nil?
|
|
12
|
+
nil
|
|
13
|
+
else
|
|
14
|
+
keys = Entity.construct_associations(inputs_type).keys
|
|
15
|
+
|
|
16
|
+
if keys.empty?
|
|
17
|
+
nil
|
|
18
|
+
else
|
|
19
|
+
keys.map do |key|
|
|
20
|
+
DataPath.new(key)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def skip_model_to_attributes_conversion?(type)
|
|
27
|
+
super || type.extends?(BuiltinTypes[:entity])
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Foobara
|
|
2
|
+
module CommandPatternImplementation
|
|
3
|
+
module Concerns
|
|
4
|
+
module EntityReflection
|
|
5
|
+
include Concern
|
|
6
|
+
|
|
7
|
+
module ClassMethods
|
|
8
|
+
def types_depended_on
|
|
9
|
+
# These lookups are duplicative of the overriden method as well as other methods.
|
|
10
|
+
# Likely there's some way to DRY this up
|
|
11
|
+
remove_sensitive = TypeDeclarations.foobara_manifest_context_remove_sensitive?
|
|
12
|
+
|
|
13
|
+
if defined?(@types_depended_on) && @types_depended_on.key?(remove_sensitive)
|
|
14
|
+
return @types_depended_on[remove_sensitive]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
@types_depended_on ||= {}
|
|
18
|
+
@types_depended_on[remove_sensitive] = begin
|
|
19
|
+
types = super
|
|
20
|
+
|
|
21
|
+
unless depends_on_entities.empty?
|
|
22
|
+
entity_types = depends_on_entities.map(&:entity_type)
|
|
23
|
+
|
|
24
|
+
if remove_sensitive
|
|
25
|
+
entity_types = entity_types.reject(&:sensitive?)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
types |= entity_types
|
|
29
|
+
types |= entity_types.map(&:types_depended_on).inject(:|)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
types
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
data/projects/entities_plumbing/src/extensions/command_pattern_implementation/concerns/runtime.rb
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Foobara
|
|
2
|
+
module CommandPatternImplementation
|
|
3
|
+
module Concerns
|
|
4
|
+
module Runtime
|
|
5
|
+
def validate_records
|
|
6
|
+
self.class.inputs_association_paths&.each do |data_path|
|
|
7
|
+
if data_path.last == :"#"
|
|
8
|
+
records = data_path.values_at(@inputs)
|
|
9
|
+
|
|
10
|
+
records.each.with_index do |record, index|
|
|
11
|
+
if record&.persisted? && !record.loaded?
|
|
12
|
+
begin
|
|
13
|
+
record.class.load(record)
|
|
14
|
+
rescue Foobara::Entity::NotFoundError => e
|
|
15
|
+
e.prepend_path!(index)
|
|
16
|
+
e.prepend_path!(data_path.path[..-2])
|
|
17
|
+
|
|
18
|
+
add_input_error(e)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
else
|
|
23
|
+
record = data_path.value_at(@inputs)
|
|
24
|
+
|
|
25
|
+
if record&.persisted? && !record.loaded?
|
|
26
|
+
begin
|
|
27
|
+
record.class.load(record)
|
|
28
|
+
rescue Foobara::Entity::NotFoundError => e
|
|
29
|
+
e.prepend_path!(data_path)
|
|
30
|
+
add_input_error(e)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -17,7 +17,7 @@ SimpleCov.command_name "manifest"
|
|
|
17
17
|
SimpleCov.coverage_dir "coverage/manifest"
|
|
18
18
|
|
|
19
19
|
SimpleCov.start do
|
|
20
|
-
|
|
20
|
+
skip "spec/support/"
|
|
21
21
|
# This avoids printing out info about coverage generated by HTTPFormatter
|
|
22
22
|
formatter Class.new { def format(_result) = nil }
|
|
23
23
|
end
|
|
@@ -55,17 +55,17 @@ module Foobara
|
|
|
55
55
|
self.manifest_path = manifest_path
|
|
56
56
|
|
|
57
57
|
if relevant_manifest.nil?
|
|
58
|
-
# :
|
|
58
|
+
# simplecov:disable
|
|
59
59
|
raise InvalidPath, "invalid path #{manifest_path}"
|
|
60
|
-
# :
|
|
60
|
+
# simplecov:enable
|
|
61
61
|
end
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def path
|
|
65
|
-
# :
|
|
65
|
+
# simplecov:disable
|
|
66
66
|
warn "[DEPRECATION] `path` is deprecated. Please use `manifest_path` instead."
|
|
67
67
|
manifest_path
|
|
68
|
-
# :
|
|
68
|
+
# simplecov:enable
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def domain
|
|
@@ -91,11 +91,11 @@ module Foobara
|
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
def parent_category
|
|
94
|
-
self[:parent]&.
|
|
94
|
+
self[:parent]&.[](0)
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
def parent_name
|
|
98
|
-
self[:parent]&.
|
|
98
|
+
self[:parent]&.[](-1)
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
def scoped_category
|
|
@@ -103,7 +103,7 @@ module Foobara
|
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
def relevant_manifest
|
|
106
|
-
@relevant_manifest ||= Foobara::DataPath.values_at(manifest_path, root_manifest)
|
|
106
|
+
@relevant_manifest ||= Foobara::DataPath.values_at(manifest_path, root_manifest)[0]
|
|
107
107
|
end
|
|
108
108
|
|
|
109
109
|
def find_type(type_declaration)
|
|
@@ -126,9 +126,9 @@ module Foobara
|
|
|
126
126
|
elsif optional_key?(method_name)
|
|
127
127
|
self.class.optional_key_defaults[method_name.to_sym]
|
|
128
128
|
else
|
|
129
|
-
# :
|
|
129
|
+
# simplecov:disable
|
|
130
130
|
super
|
|
131
|
-
# :
|
|
131
|
+
# simplecov:enable
|
|
132
132
|
end
|
|
133
133
|
end
|
|
134
134
|
|