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
|
@@ -27,14 +27,14 @@ module Foobara
|
|
|
27
27
|
when 0
|
|
28
28
|
Util.non_full_name_underscore(self).gsub(/_error$/, "").to_sym
|
|
29
29
|
when 1
|
|
30
|
-
arg = args
|
|
30
|
+
arg = args[0]
|
|
31
31
|
singleton_class.define_method :symbol do
|
|
32
32
|
arg
|
|
33
33
|
end
|
|
34
34
|
else
|
|
35
|
-
# :
|
|
35
|
+
# simplecov:disable
|
|
36
36
|
raise ArgumentError, "expected 0 or 1 argument, got #{args_size}"
|
|
37
|
-
# :
|
|
37
|
+
# simplecov:enable
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
@@ -58,14 +58,14 @@ module Foobara
|
|
|
58
58
|
when 0
|
|
59
59
|
Util.humanize(symbol.to_s)
|
|
60
60
|
when 1
|
|
61
|
-
arg = args
|
|
61
|
+
arg = args[0]
|
|
62
62
|
singleton_class.define_method :message do
|
|
63
63
|
arg
|
|
64
64
|
end
|
|
65
65
|
else
|
|
66
|
-
# :
|
|
66
|
+
# simplecov:disable
|
|
67
67
|
raise ArgumentError, "expected 0 or 1 argument, got #{args_size}"
|
|
68
|
-
# :
|
|
68
|
+
# simplecov:enable
|
|
69
69
|
end
|
|
70
70
|
end
|
|
71
71
|
|
|
@@ -79,14 +79,14 @@ module Foobara
|
|
|
79
79
|
when 0
|
|
80
80
|
{}
|
|
81
81
|
when 1
|
|
82
|
-
arg = args
|
|
82
|
+
arg = args[0]
|
|
83
83
|
singleton_class.define_method :context_type_declaration do
|
|
84
84
|
arg
|
|
85
85
|
end
|
|
86
86
|
else
|
|
87
|
-
# :
|
|
87
|
+
# simplecov:disable
|
|
88
88
|
raise ArgumentError, "expected 0 or 1 argument, got #{args_size}"
|
|
89
|
-
# :
|
|
89
|
+
# simplecov:enable
|
|
90
90
|
end
|
|
91
91
|
end
|
|
92
92
|
|
|
@@ -249,9 +249,9 @@ module Foobara
|
|
|
249
249
|
self.is_fatal = is_fatal
|
|
250
250
|
|
|
251
251
|
if !self.message.is_a?(String) || self.message.empty?
|
|
252
|
-
# :
|
|
252
|
+
# simplecov:disable
|
|
253
253
|
raise "Bad error message, expected a string"
|
|
254
|
-
# :
|
|
254
|
+
# simplecov:enable
|
|
255
255
|
end
|
|
256
256
|
|
|
257
257
|
backtrace_when_initialized = caller[1..]
|
|
@@ -19,31 +19,31 @@ module Foobara
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def errors
|
|
22
|
-
# :
|
|
22
|
+
# simplecov:disable
|
|
23
23
|
warn "DEPRECATED: Do not call ErrorCollection#errors instead just use the collection directly."
|
|
24
24
|
self
|
|
25
|
-
# :
|
|
25
|
+
# simplecov:enable
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def error_array
|
|
29
|
-
# :
|
|
29
|
+
# simplecov:disable
|
|
30
30
|
warn "DEPRECATED: Do not call ErrorCollection#error_array instead just use the collection directly."
|
|
31
31
|
self
|
|
32
|
-
# :
|
|
32
|
+
# simplecov:enable
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def each_error(&)
|
|
36
|
-
# :
|
|
36
|
+
# simplecov:disable
|
|
37
37
|
warn "DEPRECATED: This method will be deprecated in the coming version"
|
|
38
38
|
each(&)
|
|
39
|
-
# :
|
|
39
|
+
# simplecov:enable
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def has_error?(error)
|
|
43
43
|
unless error.is_a?(Error)
|
|
44
|
-
# :
|
|
44
|
+
# simplecov:disable
|
|
45
45
|
raise ArgumentError, "Can only check if an Error instance is in the collection"
|
|
46
|
-
# :
|
|
46
|
+
# simplecov:enable
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
include?(error)
|
|
@@ -58,17 +58,17 @@ module Foobara
|
|
|
58
58
|
error_or_collection_or_error_hash.key?(:message)
|
|
59
59
|
Error.new(**error_or_collection_or_error_hash)
|
|
60
60
|
else
|
|
61
|
-
# :
|
|
61
|
+
# simplecov:disable
|
|
62
62
|
raise ArgumentError,
|
|
63
63
|
"if passing a hash of error args it must include symbol and message at least"
|
|
64
|
-
# :
|
|
64
|
+
# simplecov:enable
|
|
65
65
|
end
|
|
66
66
|
else
|
|
67
|
-
# :
|
|
67
|
+
# simplecov:disable
|
|
68
68
|
raise ArgumentError, "Not sure how to convert #{error_or_collection_or_error_hash.inspect} " \
|
|
69
69
|
"into an error. Can handle a hash of error " \
|
|
70
70
|
"args or 3 arguments for symbol, message, and context, or, of course, an Error"
|
|
71
|
-
# :
|
|
71
|
+
# simplecov:enable
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
if has_error?(error)
|
|
@@ -101,10 +101,10 @@ module Foobara
|
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
def to_h
|
|
104
|
-
# :
|
|
104
|
+
# simplecov:disable
|
|
105
105
|
warn "DEPRECATED: Use #errors_hash instead"
|
|
106
106
|
errors_hash
|
|
107
|
-
# :
|
|
107
|
+
# simplecov:enable
|
|
108
108
|
end
|
|
109
109
|
end
|
|
110
110
|
end
|
|
@@ -74,10 +74,12 @@ module Foobara
|
|
|
74
74
|
|
|
75
75
|
def prepend_path!(*prepend_parts)
|
|
76
76
|
if prepend_parts.size == 1
|
|
77
|
-
arg = prepend_parts
|
|
77
|
+
arg = prepend_parts[0]
|
|
78
78
|
|
|
79
79
|
if arg.is_a?(Array)
|
|
80
80
|
prepend_parts = arg
|
|
81
|
+
elsif arg.is_a?(DataPath)
|
|
82
|
+
prepend_parts = arg.path
|
|
81
83
|
end
|
|
82
84
|
end
|
|
83
85
|
|
|
@@ -155,9 +157,9 @@ module Foobara
|
|
|
155
157
|
when String
|
|
156
158
|
key_parts.to_sym
|
|
157
159
|
else
|
|
158
|
-
# :
|
|
160
|
+
# simplecov:disable
|
|
159
161
|
raise ArgumentError, "expected nil, a symbol, or a string, an integer, or an array of such values "
|
|
160
|
-
# :
|
|
162
|
+
# simplecov:enable
|
|
161
163
|
end
|
|
162
164
|
end
|
|
163
165
|
end
|
|
@@ -23,9 +23,9 @@ module Foobara
|
|
|
23
23
|
errors = errors.flatten
|
|
24
24
|
|
|
25
25
|
if errors.empty?
|
|
26
|
-
# :
|
|
26
|
+
# simplecov:disable
|
|
27
27
|
raise "No errors given"
|
|
28
|
-
# :
|
|
28
|
+
# simplecov:enable
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
new.tap do |outcome|
|
|
@@ -56,9 +56,9 @@ module Foobara
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def has_error
|
|
59
|
-
# :
|
|
59
|
+
# simplecov:disable
|
|
60
60
|
error_collection.has_error
|
|
61
|
-
# :
|
|
61
|
+
# simplecov:enable
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def add_errors(*errors)
|
|
@@ -88,7 +88,7 @@ module Foobara
|
|
|
88
88
|
def raise!
|
|
89
89
|
return if success?
|
|
90
90
|
|
|
91
|
-
error = error_collection
|
|
91
|
+
error = error_collection[0]
|
|
92
92
|
original_backtrace = error.backtrace_when_initialized
|
|
93
93
|
|
|
94
94
|
if error_collection.size > 1
|
|
@@ -70,10 +70,10 @@ module Foobara
|
|
|
70
70
|
if processor.scoped_path_set?
|
|
71
71
|
# Unclear why nothing in the test suite passes through here.
|
|
72
72
|
# TODO: either test this or delete it.
|
|
73
|
-
# :
|
|
73
|
+
# simplecov:disable
|
|
74
74
|
to_include << processor
|
|
75
75
|
processor_reference = processor.foobara_manifest_reference
|
|
76
|
-
# :
|
|
76
|
+
# simplecov:enable
|
|
77
77
|
end
|
|
78
78
|
end
|
|
79
79
|
|
|
@@ -56,7 +56,7 @@ module Foobara
|
|
|
56
56
|
if instance_variable_defined?(var_name)
|
|
57
57
|
instance_variable_get(var_name)
|
|
58
58
|
else
|
|
59
|
-
superclass.
|
|
59
|
+
superclass.__send__(name)
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
|
|
@@ -77,9 +77,9 @@ module Foobara
|
|
|
77
77
|
|
|
78
78
|
def foobara_class_methods_module_for(klass)
|
|
79
79
|
unless klass.name
|
|
80
|
-
# :
|
|
80
|
+
# simplecov:disable
|
|
81
81
|
raise "This does not work with anonymous classes"
|
|
82
|
-
# :
|
|
82
|
+
# simplecov:enable
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
if klass.const_defined?(:ClassMethods, false)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
class Module
|
|
2
|
-
# :
|
|
2
|
+
# simplecov:disable
|
|
3
3
|
def foobara_delegate(*method_names, to:, allow_nil: false)
|
|
4
4
|
warn "[DEPRECATION] `foobara_delegate` is deprecated and will be removed in future versions"
|
|
5
5
|
|
|
6
6
|
method_names.each do |method_name|
|
|
7
7
|
define_method method_name do |*args, **opts, &block|
|
|
8
|
-
target = to.is_a?(::Symbol) || to.is_a?(::String) ?
|
|
8
|
+
target = to.is_a?(::Symbol) || to.is_a?(::String) ? __send__(to) : to
|
|
9
9
|
return nil if target.nil? && allow_nil
|
|
10
10
|
|
|
11
|
-
target.
|
|
11
|
+
target.__send__(method_name, *args, **opts, &block)
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
|
-
# :
|
|
15
|
+
# simplecov:enable
|
|
16
16
|
end
|
|
@@ -11,9 +11,9 @@ module Foobara
|
|
|
11
11
|
domain = Namespace.global.foobara_lookup_domain(object)
|
|
12
12
|
|
|
13
13
|
unless domain
|
|
14
|
-
# :
|
|
14
|
+
# simplecov:disable
|
|
15
15
|
raise NoSuchDomain, "Couldn't determine domain for #{object}"
|
|
16
|
-
# :
|
|
16
|
+
# simplecov:enable
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
domain
|
|
@@ -28,9 +28,9 @@ module Foobara
|
|
|
28
28
|
to_domain(object.scoped_namespace)
|
|
29
29
|
end
|
|
30
30
|
else
|
|
31
|
-
# :
|
|
31
|
+
# simplecov:disable
|
|
32
32
|
raise NoSuchDomain, "Couldn't determine domain for #{object}"
|
|
33
|
-
# :
|
|
33
|
+
# simplecov:enable
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
@@ -84,7 +84,7 @@ module Foobara
|
|
|
84
84
|
if new_class.const_defined?(const_name)
|
|
85
85
|
to_replace = new_class.const_get(const_name)
|
|
86
86
|
if to_replace != value
|
|
87
|
-
new_class.
|
|
87
|
+
new_class.__send__(:remove_const, const_name)
|
|
88
88
|
new_class.const_set(const_name, value)
|
|
89
89
|
end
|
|
90
90
|
else
|
|
@@ -20,28 +20,28 @@ module Foobara
|
|
|
20
20
|
def foobara_domain_map(*args, to: nil, strict: false, criteria: nil, should_raise: false, **opts)
|
|
21
21
|
case args.size
|
|
22
22
|
when 1
|
|
23
|
-
value = args
|
|
23
|
+
value = args[0]
|
|
24
24
|
when 0
|
|
25
25
|
if opts.empty?
|
|
26
|
-
# :
|
|
26
|
+
# simplecov:disable
|
|
27
27
|
raise ArgumentError, "Expected at least one argument"
|
|
28
|
-
# :
|
|
28
|
+
# simplecov:enable
|
|
29
29
|
else
|
|
30
30
|
value = opts
|
|
31
31
|
opts = {}
|
|
32
32
|
end
|
|
33
33
|
else
|
|
34
|
-
# :
|
|
34
|
+
# simplecov:disable
|
|
35
35
|
raise ArgumentError, "Expected 1 argument but got #{args.size}"
|
|
36
|
-
# :
|
|
36
|
+
# simplecov:enable
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
invalid_keys = opts.keys - [:from]
|
|
40
40
|
|
|
41
41
|
if invalid_keys.any?
|
|
42
|
-
# :
|
|
42
|
+
# simplecov:disable
|
|
43
43
|
raise ArgumentError, "Invalid options: #{invalid_keys.join(", ")}"
|
|
44
|
-
# :
|
|
44
|
+
# simplecov:enable
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
from = if opts.key?(:from)
|
|
@@ -91,9 +91,9 @@ module Foobara
|
|
|
91
91
|
return parent if parent&.foobara_organization?
|
|
92
92
|
|
|
93
93
|
# TODO: we really should test this path
|
|
94
|
-
# :
|
|
94
|
+
# simplecov:disable
|
|
95
95
|
parent = parent.foobara_parent_namespace
|
|
96
|
-
# :
|
|
96
|
+
# simplecov:enable
|
|
97
97
|
end || GlobalOrganization
|
|
98
98
|
end
|
|
99
99
|
|
|
@@ -110,8 +110,8 @@ module Foobara
|
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
def foobara_type_from_declaration(*args, **opts, &block)
|
|
113
|
-
if opts.empty? && block.nil? && args.size == 1 && args.
|
|
114
|
-
return args
|
|
113
|
+
if opts.empty? && block.nil? && args.size == 1 && args[0].is_a?(Types::Type)
|
|
114
|
+
return args[0]
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
Foobara::Namespace.use self do
|
|
@@ -132,8 +132,8 @@ module Foobara
|
|
|
132
132
|
end
|
|
133
133
|
|
|
134
134
|
def foobara_register_type(type_symbol, *type_declaration_bits, &block)
|
|
135
|
-
type = if block.nil? && type_declaration_bits.size == 1 && type_declaration_bits.
|
|
136
|
-
type_declaration_bits
|
|
135
|
+
type = if block.nil? && type_declaration_bits.size == 1 && type_declaration_bits[0].is_a?(Types::Type)
|
|
136
|
+
type_declaration_bits[0]
|
|
137
137
|
else
|
|
138
138
|
foobara_type_from_declaration(*type_declaration_bits, &block)
|
|
139
139
|
end
|
|
@@ -157,12 +157,12 @@ module Foobara
|
|
|
157
157
|
type.type_symbol = new_type_symbol
|
|
158
158
|
|
|
159
159
|
foobara_register(type)
|
|
160
|
-
# :
|
|
160
|
+
# simplecov:disable
|
|
161
161
|
elsif old_type != type
|
|
162
162
|
# TODO: delete this check if it's not really helping
|
|
163
163
|
|
|
164
164
|
raise "Didn't expect to find an old type"
|
|
165
|
-
# :
|
|
165
|
+
# simplecov:enable
|
|
166
166
|
end
|
|
167
167
|
else
|
|
168
168
|
type.scoped_path = new_scoped_path
|
|
@@ -172,16 +172,16 @@ module Foobara
|
|
|
172
172
|
|
|
173
173
|
if old_type && old_type != type
|
|
174
174
|
# TODO: delete this check if it's not really helping
|
|
175
|
-
# :
|
|
175
|
+
# simplecov:disable
|
|
176
176
|
raise "Didn't expect to find an old type"
|
|
177
|
-
# :
|
|
177
|
+
# simplecov:enable
|
|
178
178
|
end
|
|
179
179
|
|
|
180
180
|
if foobara_registered?(type, mode: Namespace::LookupMode::DIRECT)
|
|
181
181
|
# TODO: delete this check if it's not really helping
|
|
182
|
-
# :
|
|
182
|
+
# simplecov:disable
|
|
183
183
|
raise "Already registered: #{type.inspect}"
|
|
184
|
-
# :
|
|
184
|
+
# simplecov:enable
|
|
185
185
|
end
|
|
186
186
|
|
|
187
187
|
foobara_register(type)
|
|
@@ -201,7 +201,7 @@ module Foobara
|
|
|
201
201
|
end
|
|
202
202
|
|
|
203
203
|
if domains.length == 1
|
|
204
|
-
domains = Util.array(domains
|
|
204
|
+
domains = Util.array(domains[0])
|
|
205
205
|
end
|
|
206
206
|
|
|
207
207
|
domains.each do |domain|
|
|
@@ -210,9 +210,9 @@ module Foobara
|
|
|
210
210
|
domain_name = domain.foobara_full_domain_name
|
|
211
211
|
|
|
212
212
|
if foobara_depends_on.include?(domain_name)
|
|
213
|
-
# :
|
|
213
|
+
# simplecov:disable
|
|
214
214
|
raise AlreadyRegisteredDomainDependency, "Already registered #{domain_name} as a dependency of #{self}"
|
|
215
|
-
# :
|
|
215
|
+
# simplecov:enable
|
|
216
216
|
end
|
|
217
217
|
|
|
218
218
|
foobara_depends_on_namespaces << domain
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
module Foobara
|
|
2
2
|
class << self
|
|
3
3
|
def manifest
|
|
4
|
+
# simplecov:disable
|
|
5
|
+
warn "Foobara.manifest is deprecated in favor of CommandConnector#foobara_manifest" \
|
|
6
|
+
"\nIf this breaks a legit use case for Foobara.manifest please let us know and we will consider keeping it!"
|
|
7
|
+
debug_manifest
|
|
8
|
+
# simplecov:enable
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
private def debug_manifest
|
|
4
12
|
to_include = Namespace.global.foobara_all_organization.to_set
|
|
5
13
|
|
|
6
14
|
TypeDeclarations.with_manifest_context(to_include:) do
|
|
@@ -13,27 +21,27 @@ module Foobara
|
|
|
13
21
|
to_include.delete(object)
|
|
14
22
|
|
|
15
23
|
unless object.scoped_path_set?
|
|
16
|
-
# :
|
|
24
|
+
# simplecov:disable
|
|
17
25
|
raise "no scoped path set for #{object}"
|
|
18
|
-
# :
|
|
26
|
+
# simplecov:enable
|
|
19
27
|
end
|
|
20
28
|
|
|
21
29
|
manifest_reference = object.foobara_manifest_reference.to_sym
|
|
22
30
|
category_symbol = Namespace.global.foobara_category_symbol_for(object)
|
|
23
31
|
|
|
24
32
|
unless category_symbol
|
|
25
|
-
# :
|
|
33
|
+
# simplecov:disable
|
|
26
34
|
raise "no category symbol for #{object}"
|
|
27
|
-
# :
|
|
35
|
+
# simplecov:enable
|
|
28
36
|
end
|
|
29
37
|
|
|
30
38
|
if included.key?(manifest_reference)
|
|
31
39
|
if included[manifest_reference] == category_symbol
|
|
32
40
|
next
|
|
33
41
|
else
|
|
34
|
-
# :
|
|
42
|
+
# simplecov:disable
|
|
35
43
|
raise "Collision for #{manifest_reference}: #{included[manifest_reference]} and #{category_symbol}"
|
|
36
|
-
# :
|
|
44
|
+
# simplecov:enable
|
|
37
45
|
end
|
|
38
46
|
end
|
|
39
47
|
|
|
@@ -12,9 +12,9 @@ module Foobara
|
|
|
12
12
|
|
|
13
13
|
def foobara_domain!
|
|
14
14
|
if foobara_organization?
|
|
15
|
-
# :
|
|
15
|
+
# simplecov:disable
|
|
16
16
|
raise CannotBeOrganizationAndDomainAtSameTime
|
|
17
|
-
# :
|
|
17
|
+
# simplecov:enable
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
unless is_a?(Namespace::IsNamespace)
|
|
@@ -30,9 +30,9 @@ module Foobara
|
|
|
30
30
|
|
|
31
31
|
def foobara_organization!
|
|
32
32
|
if foobara_domain?
|
|
33
|
-
# :
|
|
33
|
+
# simplecov:disable
|
|
34
34
|
raise CannotBeOrganizationAndDomainAtSameTime
|
|
35
|
-
# :
|
|
35
|
+
# simplecov:enable
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
include(OrganizationModuleExtension)
|
|
@@ -12,9 +12,9 @@ module Foobara
|
|
|
12
12
|
organization = Namespace.global.foobara_lookup_organization(object)
|
|
13
13
|
|
|
14
14
|
unless organization
|
|
15
|
-
# :
|
|
15
|
+
# simplecov:disable
|
|
16
16
|
raise NoSuchOrganization, "Couldn't determine organization for #{object}"
|
|
17
|
-
# :
|
|
17
|
+
# simplecov:enable
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
organization
|
|
@@ -31,17 +31,17 @@ module Foobara
|
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
else
|
|
34
|
-
# :
|
|
34
|
+
# simplecov:disable
|
|
35
35
|
raise NoSuchOrganization, "Couldn't determine organization for #{object}"
|
|
36
|
-
# :
|
|
36
|
+
# simplecov:enable
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def create(full_organization_name)
|
|
41
41
|
if Organization.to_organization(full_organization_name)
|
|
42
|
-
# :
|
|
42
|
+
# simplecov:disable
|
|
43
43
|
raise OrganizationAlreadyExistsError, "Organization #{full_organization_name} already exists"
|
|
44
|
-
# :
|
|
44
|
+
# simplecov:enable
|
|
45
45
|
end
|
|
46
46
|
rescue Organization::NoSuchOrganization
|
|
47
47
|
Util.make_module_p(full_organization_name) { foobara_organization! }
|
|
@@ -18,10 +18,10 @@ module Foobara
|
|
|
18
18
|
values_source = begin
|
|
19
19
|
Util.const_get_up_hierarchy(self, module_name)
|
|
20
20
|
rescue NameError
|
|
21
|
-
# :
|
|
21
|
+
# simplecov:disable
|
|
22
22
|
raise CannotDetermineModuleAutomatically,
|
|
23
23
|
"could not find a module for #{module_name}. Maybe consider passing it in explicitly."
|
|
24
|
-
# :
|
|
24
|
+
# simplecov:enable
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -29,9 +29,9 @@ module Foobara
|
|
|
29
29
|
|
|
30
30
|
attribute_name = attribute_name.to_sym
|
|
31
31
|
|
|
32
|
-
# :
|
|
32
|
+
# simplecov:disable
|
|
33
33
|
unless respond_to?(:enumerated_type_metadata)
|
|
34
|
-
# :
|
|
34
|
+
# simplecov:enable
|
|
35
35
|
class << self
|
|
36
36
|
attr_accessor :enumerated_type_metadata
|
|
37
37
|
end
|
|
@@ -15,9 +15,9 @@ module Foobara
|
|
|
15
15
|
|
|
16
16
|
def normalize_value(value)
|
|
17
17
|
unless Values.valid_value_type?(value)
|
|
18
|
-
# :
|
|
18
|
+
# simplecov:disable
|
|
19
19
|
raise BadValueType, "Expected nil, String, or Symbol, but got #{value} which is a #{value.class}"
|
|
20
|
-
# :
|
|
20
|
+
# simplecov:enable
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
value&.to_sym
|
|
@@ -38,17 +38,17 @@ module Foobara
|
|
|
38
38
|
def validate_symbol_map_types(symbol_map)
|
|
39
39
|
symbol_map.each_pair do |name, value|
|
|
40
40
|
unless valid_name_type?(name)
|
|
41
|
-
# :
|
|
41
|
+
# simplecov:disable
|
|
42
42
|
raise BadNameType, "name is #{name} which is a #{name.class} but expected String, or Symbol"
|
|
43
|
-
# :
|
|
43
|
+
# simplecov:enable
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
unless valid_value_type?(value)
|
|
47
|
-
# :
|
|
47
|
+
# simplecov:disable
|
|
48
48
|
raise BadValueType, "#{
|
|
49
49
|
name
|
|
50
50
|
} is #{value} which is a #{value.class} but expected nil, String, or Symbol"
|
|
51
|
-
# :
|
|
51
|
+
# simplecov:enable
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
end
|
|
@@ -66,13 +66,13 @@ module Foobara
|
|
|
66
66
|
|
|
67
67
|
def initialize(*args)
|
|
68
68
|
if args.empty?
|
|
69
|
-
# :
|
|
69
|
+
# simplecov:disable
|
|
70
70
|
raise ArgumentError, "Expected Module, Hash, or Array"
|
|
71
|
-
# :
|
|
71
|
+
# simplecov:enable
|
|
72
72
|
elsif args.size > 1
|
|
73
73
|
initialize(args)
|
|
74
74
|
else
|
|
75
|
-
symbol_map = args
|
|
75
|
+
symbol_map = args[0]
|
|
76
76
|
|
|
77
77
|
case symbol_map
|
|
78
78
|
when ::Hash
|
|
@@ -84,9 +84,9 @@ module Foobara
|
|
|
84
84
|
when ::Array
|
|
85
85
|
initialize(symbol_map.to_h { |name| [name, name] })
|
|
86
86
|
else
|
|
87
|
-
# :
|
|
87
|
+
# simplecov:disable
|
|
88
88
|
raise ArgumentError, "Expected Module, Hash, or Array"
|
|
89
|
-
# :
|
|
89
|
+
# simplecov:enable
|
|
90
90
|
end
|
|
91
91
|
end
|
|
92
92
|
end
|
|
@@ -105,9 +105,9 @@ module Foobara
|
|
|
105
105
|
|
|
106
106
|
def method_missing(name)
|
|
107
107
|
unless respond_to_missing?(name)
|
|
108
|
-
# :
|
|
108
|
+
# simplecov:disable
|
|
109
109
|
super
|
|
110
|
-
# :
|
|
110
|
+
# simplecov:enable
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
@symbol_map[name]
|
|
@@ -127,7 +127,7 @@ module Foobara
|
|
|
127
127
|
|
|
128
128
|
[:all, :all_names, :all_values, :value?].each do |method_name|
|
|
129
129
|
mod.singleton_class.define_method method_name do |*args, **opts, &block|
|
|
130
|
-
enumerated.
|
|
130
|
+
enumerated.__send__(method_name, *args, **opts, &block)
|
|
131
131
|
end
|
|
132
132
|
end
|
|
133
133
|
|