foobara 0.5.10 → 0.6.2
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.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +22 -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/src/command_connector/concerns/desugarizers.rb +5 -5
- data/projects/command_connectors/src/command_connector/concerns/reflection.rb +63 -17
- 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 +24 -18
- 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_plumbing/lib/foobara/entities_plumbing.rb +6 -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/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/projects/builtin_types/lib/foobara/builtin_types.rb +2 -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 +14 -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/lib/foobara/types.rb +0 -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/version.rb +2 -2
- metadata +44 -160
- data/projects/command_connectors/Guardfile +0 -6
- data/projects/command_connectors/spec/allowed_rules_spec.rb +0 -77
- data/projects/command_connectors/spec/ambiguous_lookups_spec.rb +0 -143
- data/projects/command_connectors/spec/auth_mappers_spec.rb +0 -201
- data/projects/command_connectors/spec/command_connector_spec.rb +0 -2460
- data/projects/command_connectors/spec/command_registry_spec.rb +0 -9
- data/projects/command_connectors/spec/commands/describe_spec.rb +0 -83
- data/projects/command_connectors/spec/commands/ping_spec.rb +0 -14
- data/projects/command_connectors/spec/commands/query_git_commit_info_spec.rb +0 -55
- data/projects/command_connectors/spec/fixtures/command_connectors/manifest_with_errors_with_missing_command_parents.yaml +0 -1662
- data/projects/command_connectors/spec/not_found_error_spec.rb +0 -17
- data/projects/command_connectors/spec/pre_commit_transformers/load_atoms_pre_commit_transformer_spec.rb +0 -108
- data/projects/command_connectors/spec/request_spec.rb +0 -118
- data/projects/command_connectors/spec/serializer_spec.rb +0 -9
- data/projects/command_connectors/spec/serializers/aggregate_serializer_spec.rb +0 -45
- data/projects/command_connectors/spec/serializers/atomic_serializer_spec.rb +0 -68
- data/projects/command_connectors/spec/serializers/entities_to_primary_keys_serializer_spec.rb +0 -36
- data/projects/command_connectors/spec/serializers/json_serializer_spec.rb +0 -22
- data/projects/command_connectors/spec/serializers/noop_serializer_spec.rb +0 -22
- data/projects/command_connectors/spec/serializers/yaml_serializer_spec.rb +0 -22
- data/projects/command_connectors/spec/spec_helper.rb +0 -56
- data/projects/command_connectors/spec/support/rubyprof.rb +0 -32
- data/projects/command_connectors/spec/support/term_trap.rb +0 -6
- data/projects/command_connectors/spec/transformers/entity_to_primary_key_inputs_transformer_spec.rb +0 -119
- data/projects/entities/Guardfile +0 -6
- data/projects/entities/spec/builtin_types/detached_entity_spec.rb +0 -300
- data/projects/entities/spec/builtin_types/entity_spec.rb +0 -501
- data/projects/entities/spec/builtin_types/model_spec.rb +0 -420
- data/projects/entities/spec/detached_entity/casting_spec.rb +0 -31
- data/projects/entities/spec/entity/concerns/associations_spec.rb +0 -73
- data/projects/entities/spec/entity/concerns/attribute_helpers_spec.rb +0 -220
- data/projects/entities/spec/entity/concerns/callbacks_spec.rb +0 -61
- data/projects/entities/spec/entity/concerns/initialization_spec.rb +0 -213
- data/projects/entities/spec/entity/concerns/mutations_spec.rb +0 -38
- data/projects/entities/spec/entity/concerns/queries_spec.rb +0 -184
- data/projects/entities/spec/entity/entity_spec.rb +0 -240
- data/projects/entities/spec/entity/extending_existing_spec.rb +0 -137
- data/projects/entities/spec/entity/extensions/domain_module_extension_spec.rb +0 -42
- data/projects/entities/spec/entity/from_type_declaration_spec.rb +0 -34
- data/projects/entities/spec/entity/that_owns_spec.rb +0 -243
- data/projects/entities/spec/entity/weak_object_set_spec.rb +0 -91
- data/projects/entities/spec/model/model_spec.rb +0 -135
- data/projects/entities/spec/model/types_spec.rb +0 -397
- data/projects/entities/spec/nested_transactionable/nested_transactionable_spec.rb +0 -67
- data/projects/entities/spec/persistence/entity_attributes_crud_drivers/in_memory_minimal_spec.rb +0 -13
- data/projects/entities/spec/persistence/entity_base/transaction_spec.rb +0 -509
- data/projects/entities/spec/persistence/entity_base/transaction_table_spec.rb +0 -58
- data/projects/entities/spec/persistence/persistence_spec.rb +0 -148
- data/projects/entities/spec/spec_helper.rb +0 -54
- data/projects/entities/spec/support/rubyprof.rb +0 -32
- data/projects/entities/spec/support/term_trap.rb +0 -6
- data/projects/entities/spec/type_declarations/sensitive_type_removers_spec.rb +0 -90
- data/projects/entities_plumbing/Guardfile +0 -6
- data/projects/entities_plumbing/spec/auth_mappers_spec.rb +0 -159
- data/projects/entities_plumbing/spec/spec_helper.rb +0 -55
- data/projects/entities_plumbing/spec/support/rubyprof.rb +0 -32
- data/projects/entities_plumbing/spec/support/term_trap.rb +0 -6
- data/projects/entities_plumbing/spec/transaction_spec.rb +0 -534
- data/projects/manifest/Guardfile +0 -6
- data/projects/manifest/spec/associations_spec.rb +0 -67
- data/projects/manifest/spec/manifest_spec.rb +0 -382
- data/projects/manifest/spec/model_spec.rb +0 -126
- data/projects/manifest/spec/spec_helper.rb +0 -54
- data/projects/manifest/spec/type_declaration_spec.rb +0 -39
- data/projects/manifest/spec/type_spec.rb +0 -30
- data/projects/typesystem/spec/builtin_types/allow_nil_spec.rb +0 -138
- data/projects/typesystem/spec/builtin_types/array_spec.rb +0 -140
- data/projects/typesystem/spec/builtin_types/associative_array_spec.rb +0 -228
- data/projects/typesystem/spec/builtin_types/attributes_spec.rb +0 -490
- data/projects/typesystem/spec/builtin_types/big_decimal_spec.rb +0 -42
- data/projects/typesystem/spec/builtin_types/boolean_spec.rb +0 -43
- data/projects/typesystem/spec/builtin_types/class_type_desugarizer_spec.rb +0 -17
- data/projects/typesystem/spec/builtin_types/custom_type_spec.rb +0 -430
- data/projects/typesystem/spec/builtin_types/date_spec.rb +0 -37
- data/projects/typesystem/spec/builtin_types/datetime_spec.rb +0 -49
- data/projects/typesystem/spec/builtin_types/email_spec.rb +0 -44
- data/projects/typesystem/spec/builtin_types/float_spec.rb +0 -59
- data/projects/typesystem/spec/builtin_types/instance_of_spec.rb +0 -75
- data/projects/typesystem/spec/builtin_types/one_of_spec.rb +0 -73
- data/projects/typesystem/spec/builtin_types/string_spec.rb +0 -117
- data/projects/typesystem/spec/builtin_types/symbol_spec.rb +0 -24
- data/projects/typesystem/spec/builtin_types/tuple_spec.rb +0 -125
- data/projects/typesystem/spec/callback/callback_spec.rb +0 -155
- data/projects/typesystem/spec/callback/registry/conditioned_spec.rb +0 -152
- data/projects/typesystem/spec/callback/registry/multiple_action_spec.rb +0 -144
- data/projects/typesystem/spec/callback/registry/single_action_spec.rb +0 -114
- data/projects/typesystem/spec/common/data_path_spec.rb +0 -268
- data/projects/typesystem/spec/common/error_collection_spec.rb +0 -77
- data/projects/typesystem/spec/common/error_key_spec.rb +0 -56
- data/projects/typesystem/spec/common/outcome_spec.rb +0 -65
- data/projects/typesystem/spec/common/possible_error_spec.rb +0 -17
- data/projects/typesystem/spec/concerns/concern_spec.rb +0 -122
- data/projects/typesystem/spec/enumerated/accessors_spec.rb +0 -182
- data/projects/typesystem/spec/enumerated/enumerated_spec.rb +0 -32
- data/projects/typesystem/spec/enumerated/values_spec.rb +0 -67
- data/projects/typesystem/spec/foobara/foobara_spec.rb +0 -45
- data/projects/typesystem/spec/namespace/ambiguous_registry_spec.rb +0 -70
- data/projects/typesystem/spec/namespace/foobara_simulation_spec.rb +0 -254
- data/projects/typesystem/spec/namespace/is_namespace_spec.rb +0 -103
- data/projects/typesystem/spec/namespace/namespace_helpers_spec.rb +0 -67
- data/projects/typesystem/spec/namespace/namespace_spec.rb +0 -335
- data/projects/typesystem/spec/namespace/prefixless_registry_spec.rb +0 -30
- data/projects/typesystem/spec/namespace/unambiguous_registry_spec.rb +0 -50
- data/projects/typesystem/spec/spec_helper.rb +0 -52
- data/projects/typesystem/spec/state_machine/callbacks_spec.rb +0 -144
- data/projects/typesystem/spec/state_machine/state_machine_spec.rb +0 -224
- data/projects/typesystem/spec/state_machine/target_attribute_spec.rb +0 -46
- data/projects/typesystem/spec/support/rubyprof.rb +0 -32
- data/projects/typesystem/spec/support/term_trap.rb +0 -6
- data/projects/typesystem/spec/type_declarations/attributes_spec.rb +0 -14
- data/projects/typesystem/spec/type_declarations/attributes_transformer_spec.rb +0 -95
- data/projects/typesystem/spec/type_declarations/dsl/attributes_spec.rb +0 -107
- data/projects/typesystem/spec/type_declarations/handlers/extend_registered_type_declaration_spec.rb +0 -13
- data/projects/typesystem/spec/type_declarations/sensitive_type_removers_spec.rb +0 -210
- data/projects/typesystem/spec/type_declarations/type_builder_spec.rb +0 -47
- data/projects/typesystem/spec/type_declarations/type_declaration_spec.rb +0 -252
- data/projects/typesystem/spec/type_declarations/type_declarations_spec.rb +0 -11
- data/projects/typesystem/spec/type_declarations/typed_transformer_spec.rb +0 -65
- data/projects/typesystem/spec/types/sensitive_spec.rb +0 -36
- data/projects/typesystem/spec/types/type_spec.rb +0 -102
- data/projects/typesystem/spec/value/caster_spec.rb +0 -23
- data/projects/typesystem/spec/value/processor/runner_spec.rb +0 -34
- data/projects/typesystem/spec/value/processor/selection_spec.rb +0 -71
- data/projects/typesystem/spec/value/processor_spec.rb +0 -76
- data/projects/typesystem/spec/value/transformer_spec.rb +0 -27
- /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
|
@@ -42,11 +42,11 @@ module Foobara
|
|
|
42
42
|
if existing_class.instance_variable_get(:@foobara_created_via_make_class)
|
|
43
43
|
existing_module_to_copy_over = existing_class
|
|
44
44
|
parent_mod = Util.module_for(existing_class)
|
|
45
|
-
parent_mod.
|
|
45
|
+
parent_mod.__send__(:remove_const, Util.non_full_name(existing_class))
|
|
46
46
|
else
|
|
47
|
-
# :
|
|
47
|
+
# simplecov:disable
|
|
48
48
|
return existing_class
|
|
49
|
-
# :
|
|
49
|
+
# simplecov:enable
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@ module Foobara
|
|
|
61
61
|
model_module = Util.make_module_p(model_module_name, tag: true)
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
const_name = model_name.split("::")
|
|
64
|
+
const_name = model_name.split("::")[-1]
|
|
65
65
|
|
|
66
66
|
model_module.const_set(const_name, anonymous_model_class)
|
|
67
67
|
|
|
@@ -28,12 +28,12 @@ module Foobara
|
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
when 1
|
|
31
|
-
@mutable_override = args
|
|
31
|
+
@mutable_override = args[0]
|
|
32
32
|
set_model_type
|
|
33
33
|
else
|
|
34
|
-
# :
|
|
34
|
+
# simplecov:disable
|
|
35
35
|
raise ArgumentError, "Expected 0 or 1 arguments but got #{args_size}"
|
|
36
|
-
# :
|
|
36
|
+
# simplecov:enable
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
|
|
@@ -226,9 +226,9 @@ module Foobara
|
|
|
226
226
|
|
|
227
227
|
if method_defined?(method)
|
|
228
228
|
# TODO: test this code path
|
|
229
|
-
# :
|
|
229
|
+
# simplecov:disable
|
|
230
230
|
remove_method method
|
|
231
|
-
# :
|
|
231
|
+
# simplecov:enable
|
|
232
232
|
end
|
|
233
233
|
end
|
|
234
234
|
|
|
@@ -12,7 +12,7 @@ module Foobara
|
|
|
12
12
|
def cast(attributes)
|
|
13
13
|
symbolized_attributes = super
|
|
14
14
|
|
|
15
|
-
model_class.
|
|
15
|
+
model_class.__send__(build_method(symbolized_attributes), symbolized_attributes)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def model_class
|
|
@@ -19,10 +19,10 @@ module Foobara
|
|
|
19
19
|
|
|
20
20
|
if sugary_type_declaration.deep_duped?
|
|
21
21
|
# TODO: probably not worth directly testing this path
|
|
22
|
-
# :
|
|
22
|
+
# simplecov:disable
|
|
23
23
|
declaration.is_duped = true
|
|
24
24
|
declaration.is_deep_duped = true
|
|
25
|
-
# :
|
|
25
|
+
# simplecov:enable
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
declaration = handler.desugarize(declaration)
|
|
@@ -27,9 +27,9 @@ module Foobara
|
|
|
27
27
|
when ::String, nil
|
|
28
28
|
model_module
|
|
29
29
|
else
|
|
30
|
-
# :
|
|
30
|
+
# simplecov:disable
|
|
31
31
|
raise ArgumentError, "expected #{model_module} to be a module or module name"
|
|
32
|
-
# :
|
|
32
|
+
# simplecov:enable
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -53,9 +53,9 @@ module Foobara
|
|
|
53
53
|
elsif klass.is_a?(::String)
|
|
54
54
|
klass
|
|
55
55
|
else
|
|
56
|
-
# :
|
|
56
|
+
# simplecov:disable
|
|
57
57
|
raise ArgumentError, "expected #{klass} to be a class or class name"
|
|
58
|
-
# :
|
|
58
|
+
# simplecov:enable
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
strictish_type_declaration[:model_class] = model_class_name
|
|
@@ -70,9 +70,9 @@ module Foobara
|
|
|
70
70
|
when ::String
|
|
71
71
|
model_base_class
|
|
72
72
|
else
|
|
73
|
-
# :
|
|
73
|
+
# simplecov:disable
|
|
74
74
|
raise ArgumentError, "expected #{model_base_class} to be a class or class name"
|
|
75
|
-
# :
|
|
75
|
+
# simplecov:enable
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
if strictish_type_declaration[:name].is_a?(::Symbol)
|
|
@@ -17,9 +17,9 @@ module Foobara
|
|
|
17
17
|
if model_type
|
|
18
18
|
if model_type.foobara_root_namespace == Foobara::Namespace.current.foobara_root_namespace
|
|
19
19
|
# TODO: test this code path
|
|
20
|
-
# :
|
|
20
|
+
# simplecov:disable
|
|
21
21
|
existing_class
|
|
22
|
-
# :
|
|
22
|
+
# simplecov:enable
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
else
|
|
@@ -83,9 +83,9 @@ module Foobara
|
|
|
83
83
|
existing_model_type = model_class.model_type
|
|
84
84
|
|
|
85
85
|
if existing_model_type
|
|
86
|
-
# :
|
|
86
|
+
# simplecov:disable
|
|
87
87
|
raise "Did not expect #{type.declaration_data[:name]} to already exist"
|
|
88
|
-
# :
|
|
88
|
+
# simplecov:enable
|
|
89
89
|
else
|
|
90
90
|
model_class.model_type = type
|
|
91
91
|
|
|
@@ -5,9 +5,9 @@ module Foobara
|
|
|
5
5
|
class ExtendRegisteredModelTypeDeclaration < ExtendRegisteredTypeDeclaration
|
|
6
6
|
def applicable?(sugary_type_declaration)
|
|
7
7
|
strict_type_declaration = if sugary_type_declaration.strict?
|
|
8
|
-
# :
|
|
8
|
+
# simplecov:disable
|
|
9
9
|
sugary_type_declaration
|
|
10
|
-
# :
|
|
10
|
+
# simplecov:enable
|
|
11
11
|
else
|
|
12
12
|
desugarize(sugary_type_declaration.clone)
|
|
13
13
|
end
|
|
@@ -10,24 +10,20 @@ module Foobara
|
|
|
10
10
|
def desugarize(declaration)
|
|
11
11
|
model_class = declaration.declaration_data
|
|
12
12
|
|
|
13
|
-
declaration.declaration_data = model_class.model_type.foobara_manifest_reference.to_sym
|
|
14
|
-
|
|
15
13
|
type = model_class.model_type
|
|
16
14
|
|
|
17
15
|
if type
|
|
16
|
+
declaration.declaration_data = type.foobara_manifest_reference.to_sym
|
|
18
17
|
declaration.type = type
|
|
19
18
|
declaration.reference_checked = true
|
|
19
|
+
declaration.is_absolutified = true
|
|
20
|
+
declaration.is_strict = true
|
|
21
|
+
declaration.is_duped = true
|
|
22
|
+
declaration.is_deep_duped = true
|
|
20
23
|
else
|
|
21
|
-
|
|
22
|
-
declaration.reference_checked = false
|
|
23
|
-
# :nocov:
|
|
24
|
+
declaration.claimed_but_error!
|
|
24
25
|
end
|
|
25
26
|
|
|
26
|
-
declaration.is_absolutified = true
|
|
27
|
-
declaration.is_strict = true
|
|
28
|
-
declaration.is_duped = true
|
|
29
|
-
declaration.is_deep_duped = true
|
|
30
|
-
|
|
31
27
|
declaration
|
|
32
28
|
end
|
|
33
29
|
|
|
@@ -18,11 +18,11 @@ module Foobara
|
|
|
18
18
|
when 0
|
|
19
19
|
@description
|
|
20
20
|
when 1
|
|
21
|
-
@description = args
|
|
21
|
+
@description = args[0]
|
|
22
22
|
else
|
|
23
|
-
# :
|
|
23
|
+
# simplecov:disable
|
|
24
24
|
raise ArgumentError, "expected 0 or 1 argument, got #{args.size}"
|
|
25
|
-
# :
|
|
25
|
+
# simplecov:enable
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
@@ -111,7 +111,7 @@ module Foobara
|
|
|
111
111
|
if foobara_type&.scoped_path_set?
|
|
112
112
|
foobara_type.scoped_name
|
|
113
113
|
else
|
|
114
|
-
Util.non_full_name(self) || model_name&.split("::")&.
|
|
114
|
+
Util.non_full_name(self) || model_name&.split("::")&.[](-1)
|
|
115
115
|
end
|
|
116
116
|
end
|
|
117
117
|
|
|
@@ -186,9 +186,9 @@ module Foobara
|
|
|
186
186
|
invalid_options = options.keys - ALLOWED_OPTIONS
|
|
187
187
|
|
|
188
188
|
unless invalid_options.empty?
|
|
189
|
-
# :
|
|
189
|
+
# simplecov:disable
|
|
190
190
|
raise ArgumentError, "Invalid options #{invalid_options} expected only #{ALLOWED_OPTIONS}"
|
|
191
|
-
# :
|
|
191
|
+
# simplecov:enable
|
|
192
192
|
end
|
|
193
193
|
|
|
194
194
|
self.skip_validations = options[:skip_validations]
|
|
@@ -204,9 +204,9 @@ module Foobara
|
|
|
204
204
|
|
|
205
205
|
if attributes.nil?
|
|
206
206
|
if validate
|
|
207
|
-
# :
|
|
207
|
+
# simplecov:disable
|
|
208
208
|
raise ArgumentError, "Cannot use validate option without attributes"
|
|
209
|
-
# :
|
|
209
|
+
# simplecov:enable
|
|
210
210
|
end
|
|
211
211
|
else
|
|
212
212
|
if Thread.inheritable_thread_local_var_get(:foobara_ignore_unexpected_attributes)
|
|
@@ -246,9 +246,9 @@ module Foobara
|
|
|
246
246
|
end
|
|
247
247
|
|
|
248
248
|
def valid_attribute_name?(attribute_name)
|
|
249
|
-
# :
|
|
249
|
+
# simplecov:disable
|
|
250
250
|
self.class.valid_attribute_name?(attribute_name)
|
|
251
|
-
# :
|
|
251
|
+
# simplecov:enable
|
|
252
252
|
end
|
|
253
253
|
|
|
254
254
|
def validate_attribute_name!(attribute_name)
|
|
@@ -261,7 +261,7 @@ module Foobara
|
|
|
261
261
|
|
|
262
262
|
def attributes_with_delegates
|
|
263
263
|
h = self.class.delegates.keys.to_h do |delegated_attribute_name|
|
|
264
|
-
[delegated_attribute_name,
|
|
264
|
+
[delegated_attribute_name, __send__(delegated_attribute_name)]
|
|
265
265
|
end
|
|
266
266
|
|
|
267
267
|
attributes.merge(h)
|
|
@@ -274,9 +274,9 @@ module Foobara
|
|
|
274
274
|
outcome = cast_attribute(attribute_name, value)
|
|
275
275
|
attributes[attribute_name] = outcome.success? ? outcome.result : value
|
|
276
276
|
else
|
|
277
|
-
# :
|
|
277
|
+
# simplecov:disable
|
|
278
278
|
raise AttributeIsImmutableError, "Cannot write attribute #{attribute_name} because it is not mutable"
|
|
279
|
-
# :
|
|
279
|
+
# simplecov:enable
|
|
280
280
|
end
|
|
281
281
|
end
|
|
282
282
|
|
|
@@ -22,15 +22,15 @@ module Foobara
|
|
|
22
22
|
entry = registry[short_name]
|
|
23
23
|
|
|
24
24
|
unless entry
|
|
25
|
-
# :
|
|
25
|
+
# simplecov:disable
|
|
26
26
|
raise NotRegisteredError, "Not registered: #{short_name.inspect}"
|
|
27
|
-
# :
|
|
27
|
+
# simplecov:enable
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
unless entry.delete(scoped)
|
|
31
|
-
# :
|
|
31
|
+
# simplecov:disable
|
|
32
32
|
raise NotRegisteredError, "Not registered: #{short_name.inspect}"
|
|
33
|
-
# :
|
|
33
|
+
# simplecov:enable
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
@@ -82,7 +82,7 @@ module Foobara
|
|
|
82
82
|
"Ambiguous match for #{path.inspect}. Matches the following: #{candidates.inspect}"
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
-
candidates
|
|
85
|
+
candidates[0]
|
|
86
86
|
end
|
|
87
87
|
end
|
|
88
88
|
|
|
@@ -7,9 +7,9 @@ module Foobara
|
|
|
7
7
|
class NotRegisteredError < StandardError; end
|
|
8
8
|
|
|
9
9
|
def register(_scoped)
|
|
10
|
-
# :
|
|
10
|
+
# simplecov:disable
|
|
11
11
|
raise "Subclass responsibility"
|
|
12
|
-
# :
|
|
12
|
+
# simplecov:enable
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def registered?(path)
|
|
@@ -17,15 +17,15 @@ module Foobara
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def unregister(_scoped)
|
|
20
|
-
# :
|
|
20
|
+
# simplecov:disable
|
|
21
21
|
raise "Subclass responsibility"
|
|
22
|
-
# :
|
|
22
|
+
# simplecov:enable
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def lookup(_path, filter: nil)
|
|
26
|
-
# :
|
|
26
|
+
# simplecov:disable
|
|
27
27
|
raise "Subclass responsibility"
|
|
28
|
-
# :
|
|
28
|
+
# simplecov:enable
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
# TODO: should return an enumerator
|
|
@@ -45,9 +45,9 @@ module Foobara
|
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def each_scoped_without_filter(&)
|
|
48
|
-
# :
|
|
48
|
+
# simplecov:disable
|
|
49
49
|
raise "Subclass responsibility"
|
|
50
|
-
# :
|
|
50
|
+
# simplecov:enable
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def apply_filter(object, filter)
|
|
@@ -12,9 +12,9 @@ module Foobara
|
|
|
12
12
|
|
|
13
13
|
if defined?(@foobara_categories)
|
|
14
14
|
if @foobara_categories.empty?
|
|
15
|
-
# :
|
|
15
|
+
# simplecov:disable
|
|
16
16
|
remove_instance_variable(:@foobara_categories)
|
|
17
|
-
# :
|
|
17
|
+
# simplecov:enable
|
|
18
18
|
elsif scoped_namespace
|
|
19
19
|
@foobara_categories = scoped_namespace.foobara_categories.merge(@foobara_categories)
|
|
20
20
|
end
|
|
@@ -26,9 +26,9 @@ module Foobara
|
|
|
26
26
|
|
|
27
27
|
if namespace
|
|
28
28
|
if namespace.foobara_children.include?(self)
|
|
29
|
-
# :
|
|
29
|
+
# simplecov:disable
|
|
30
30
|
raise "Already registered on parent"
|
|
31
|
-
# :
|
|
31
|
+
# simplecov:enable
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
namespace.foobara_children << self
|
|
@@ -88,9 +88,9 @@ module Foobara
|
|
|
88
88
|
scopedish = foobara_lookup(scopedish)
|
|
89
89
|
|
|
90
90
|
unless scopedish
|
|
91
|
-
# :
|
|
91
|
+
# simplecov:disable
|
|
92
92
|
raise ArgumentError, "Cannot unregister non-existent #{scopedish}"
|
|
93
|
-
# :
|
|
93
|
+
# simplecov:enable
|
|
94
94
|
end
|
|
95
95
|
end
|
|
96
96
|
|
|
@@ -181,13 +181,13 @@ module Foobara
|
|
|
181
181
|
end.compact
|
|
182
182
|
|
|
183
183
|
if candidates.size > 1
|
|
184
|
-
# :
|
|
184
|
+
# simplecov:disable
|
|
185
185
|
raise AmbiguousLookupError,
|
|
186
186
|
"#{path} is ambiguous. Matches the following: #{candidates.map(&:scoped_full_name)}"
|
|
187
|
-
# :
|
|
187
|
+
# simplecov:enable
|
|
188
188
|
end
|
|
189
189
|
|
|
190
|
-
scoped = candidates
|
|
190
|
+
scoped = candidates[0] ||
|
|
191
191
|
foobara_parent_namespace&.foobara_lookup_without_cache(path, filter:, mode:, visited:)
|
|
192
192
|
|
|
193
193
|
scoped ||= foobara_lookup_without_cache(
|
|
@@ -290,12 +290,12 @@ module Foobara
|
|
|
290
290
|
end.compact
|
|
291
291
|
|
|
292
292
|
if candidates.size > 1
|
|
293
|
-
# :
|
|
293
|
+
# simplecov:disable
|
|
294
294
|
raise AmbiguousLookupError, "Multiple things matched #{path}"
|
|
295
|
-
# :
|
|
295
|
+
# simplecov:enable
|
|
296
296
|
end
|
|
297
297
|
|
|
298
|
-
candidates
|
|
298
|
+
candidates[0] || partial
|
|
299
299
|
end
|
|
300
300
|
|
|
301
301
|
def foobara_parent_namespace
|
|
@@ -306,9 +306,9 @@ module Foobara
|
|
|
306
306
|
object = foobara_lookup(name, **)
|
|
307
307
|
|
|
308
308
|
unless object
|
|
309
|
-
# :
|
|
309
|
+
# simplecov:disable
|
|
310
310
|
raise NotFoundError, "Could not find #{name}"
|
|
311
|
-
# :
|
|
311
|
+
# simplecov:enable
|
|
312
312
|
end
|
|
313
313
|
|
|
314
314
|
object
|
|
@@ -356,11 +356,11 @@ module Foobara
|
|
|
356
356
|
|
|
357
357
|
if filter
|
|
358
358
|
method = "foobara_#{method}#{"!" if bang}"
|
|
359
|
-
|
|
359
|
+
__send__(method, *, **, filter:, &)
|
|
360
360
|
else
|
|
361
|
-
# :
|
|
361
|
+
# simplecov:disable
|
|
362
362
|
super
|
|
363
|
-
# :
|
|
363
|
+
# simplecov:enable
|
|
364
364
|
end
|
|
365
365
|
end
|
|
366
366
|
|
|
@@ -405,9 +405,9 @@ module Foobara
|
|
|
405
405
|
when Foobara::Namespace::BaseRegistry::WouldMakeRegistryAmbiguousError
|
|
406
406
|
Foobara::Namespace::AmbiguousRegistry
|
|
407
407
|
else
|
|
408
|
-
# :
|
|
408
|
+
# simplecov:disable
|
|
409
409
|
raise ArgumentError, "Not sure how to upgrade a #{error.class}"
|
|
410
|
-
# :
|
|
410
|
+
# simplecov:enable
|
|
411
411
|
end
|
|
412
412
|
|
|
413
413
|
old_registry = foobara_registry
|
|
@@ -48,9 +48,9 @@ module Foobara
|
|
|
48
48
|
class << self
|
|
49
49
|
def validate!(mode)
|
|
50
50
|
unless ALL.include?(mode)
|
|
51
|
-
# :
|
|
51
|
+
# simplecov:disable
|
|
52
52
|
raise ArgumentError, "Expected #{mode} to be one of #{ALL.map(&:inspect).join(",")}"
|
|
53
|
-
# :
|
|
53
|
+
# simplecov:enable
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
end
|
|
@@ -15,9 +15,9 @@ module Foobara
|
|
|
15
15
|
|
|
16
16
|
def use(namespace)
|
|
17
17
|
unless namespace.is_a?(Namespace::IsNamespace)
|
|
18
|
-
# :
|
|
18
|
+
# simplecov:disable
|
|
19
19
|
raise ArgumentError, "Expected #{namespace} to be a namespace"
|
|
20
|
-
# :
|
|
20
|
+
# simplecov:enable
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
old_namespace = current
|
|
@@ -46,9 +46,9 @@ module Foobara
|
|
|
46
46
|
when Foobara::Scoped
|
|
47
47
|
object.scoped_path
|
|
48
48
|
else
|
|
49
|
-
# :
|
|
49
|
+
# simplecov:disable
|
|
50
50
|
raise ArgumentError, "Expected #{object} to be a string, symbol, array, or Foobara::IsScoped"
|
|
51
|
-
# :
|
|
51
|
+
# simplecov:enable
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
|
|
@@ -60,7 +60,7 @@ module Foobara
|
|
|
60
60
|
|
|
61
61
|
def fire_changed!
|
|
62
62
|
@on_change&.each_pair do |object, method_name|
|
|
63
|
-
object.
|
|
63
|
+
object.__send__(method_name)
|
|
64
64
|
end
|
|
65
65
|
end
|
|
66
66
|
|
|
@@ -60,9 +60,9 @@ module Foobara
|
|
|
60
60
|
if Foobara::Util.super_method_takes_parameters?(self, AutoRegisterInstances, __method__)
|
|
61
61
|
super
|
|
62
62
|
else
|
|
63
|
-
# :
|
|
63
|
+
# simplecov:disable
|
|
64
64
|
super()
|
|
65
|
-
# :
|
|
65
|
+
# simplecov:enable
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
ns = scoped_namespace || self.class.scoped_default_namespace
|
|
@@ -77,9 +77,9 @@ module Foobara
|
|
|
77
77
|
|
|
78
78
|
def initialize(*, **, &)
|
|
79
79
|
if Foobara::Util.super_method_takes_parameters?(self, InstancesAreNamespaces, __method__)
|
|
80
|
-
# :
|
|
80
|
+
# simplecov:disable
|
|
81
81
|
super
|
|
82
|
-
# :
|
|
82
|
+
# simplecov:enable
|
|
83
83
|
else
|
|
84
84
|
super()
|
|
85
85
|
end
|
|
@@ -23,9 +23,9 @@ module Foobara
|
|
|
23
23
|
key = to_key(scoped)
|
|
24
24
|
|
|
25
25
|
unless registry.key?(key)
|
|
26
|
-
# :
|
|
26
|
+
# simplecov:disable
|
|
27
27
|
raise NotRegisteredError, "#{key} is not registered"
|
|
28
|
-
# :
|
|
28
|
+
# simplecov:enable
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
registry.delete(key)
|
|
@@ -33,7 +33,7 @@ module Foobara
|
|
|
33
33
|
|
|
34
34
|
def lookup(path, filter = nil)
|
|
35
35
|
if path.size == 1
|
|
36
|
-
apply_filter(registry[path
|
|
36
|
+
apply_filter(registry[path[0]], filter)
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
|
|
@@ -8,15 +8,15 @@ module Foobara
|
|
|
8
8
|
def scoped_path
|
|
9
9
|
if scoped_unregistered?
|
|
10
10
|
# TODO: can probably delete this defensive check
|
|
11
|
-
# :
|
|
11
|
+
# simplecov:disable
|
|
12
12
|
raise "Cannot use unregistered Scoped object"
|
|
13
|
-
# :
|
|
13
|
+
# simplecov:enable
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
unless defined?(@scoped_path)
|
|
17
|
-
# :
|
|
17
|
+
# simplecov:disable
|
|
18
18
|
raise NoScopedPathSetError, "No scoped path set. Explicitly set it to nil if that's what you want."
|
|
19
|
-
# :
|
|
19
|
+
# simplecov:enable
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
@scoped_path
|
|
@@ -62,7 +62,7 @@ module Foobara
|
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def scoped_short_name
|
|
65
|
-
@scoped_short_name ||= scoped_path
|
|
65
|
+
@scoped_short_name ||= scoped_path[-1]
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
def scoped_short_path
|
|
@@ -90,9 +90,9 @@ module Foobara
|
|
|
90
90
|
def foobara_manifest_reference
|
|
91
91
|
if scoped_unregistered?
|
|
92
92
|
# TODO: can probably delete this defensive check
|
|
93
|
-
# :
|
|
93
|
+
# simplecov:disable
|
|
94
94
|
raise "Cannot use unregistered Scoped object"
|
|
95
|
-
# :
|
|
95
|
+
# simplecov:enable
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
@foobara_manifest_reference ||= scoped_full_name
|
|
@@ -6,10 +6,10 @@ module Foobara
|
|
|
6
6
|
class << self
|
|
7
7
|
# TODO: let's eliminate this method
|
|
8
8
|
def require_project_file(project, path)
|
|
9
|
-
# :
|
|
9
|
+
# simplecov:disable
|
|
10
10
|
warn "DEPRECATION WARNING: require_project_file is deprecated. Use require_relative instead."
|
|
11
11
|
require_relative("../../#{project}/src/#{path}")
|
|
12
|
-
# :
|
|
12
|
+
# simplecov:enable
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
attr_accessor :is_installed
|
|
@@ -20,9 +20,9 @@ module Foobara
|
|
|
20
20
|
|
|
21
21
|
def project(symbol, project_path: nil)
|
|
22
22
|
if all_projects.key?(symbol)
|
|
23
|
-
# :
|
|
23
|
+
# simplecov:disable
|
|
24
24
|
raise ArgumentError, "Project #{symbol} already loaded"
|
|
25
|
-
# :
|
|
25
|
+
# simplecov:enable
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
project = Project.new(symbol, project_path:)
|
|
@@ -51,13 +51,19 @@ module Foobara
|
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def reset_alls
|
|
54
|
-
raise_if_production!
|
|
54
|
+
raise_if_production!
|
|
55
55
|
all_projects.each_value(&:reset_all)
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
def raise_if_production!(
|
|
58
|
+
def raise_if_production!(method_name = nil)
|
|
59
|
+
if method_name
|
|
60
|
+
warn "DEPRECATION WARNING: Passing method_name is deprecated."
|
|
61
|
+
else
|
|
62
|
+
method_name = caller_locations.map(&:label).find { |label| !label.start_with?("block in") }
|
|
63
|
+
end
|
|
64
|
+
|
|
59
65
|
if ENV["FOOBARA_ENV"].nil? || ENV["FOOBARA_ENV"] == "production"
|
|
60
|
-
raise MethodCantBeCalledInProductionError
|
|
66
|
+
raise MethodCantBeCalledInProductionError, method_name
|
|
61
67
|
end
|
|
62
68
|
end
|
|
63
69
|
end
|