familia 2.0.0.pre16 → 2.0.0.pre18
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/.github/workflows/ci.yml +2 -2
- data/.github/workflows/{code-smellage.yml → code-smells.yml} +3 -63
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -0
- data/CHANGELOG.rst +82 -0
- data/CLAUDE.md +47 -2
- data/Gemfile.lock +1 -1
- data/README.md +13 -0
- data/bin/irb +1 -1
- data/docs/archive/FAMILIA_TECHNICAL.md +1 -1
- data/docs/guides/core-field-system.md +48 -26
- data/docs/migrating/v2.0.0-pre18.md +58 -0
- data/docs/overview.md +2 -2
- data/docs/qodo-merge-compliance.md +96 -0
- data/docs/reference/api-technical.md +1 -1
- data/examples/encrypted_fields.rb +1 -1
- data/examples/safe_dump.rb +1 -1
- data/lib/familia/base.rb +6 -6
- data/lib/familia/connection/middleware.rb +58 -4
- data/lib/familia/connection.rb +1 -1
- data/lib/familia/data_type/class_methods.rb +63 -0
- data/lib/familia/data_type/connection.rb +83 -0
- data/lib/familia/data_type/{commands.rb → database_commands.rb} +2 -2
- data/lib/familia/data_type/serialization.rb +5 -5
- data/lib/familia/data_type/settings.rb +96 -0
- data/lib/familia/data_type/types/hashkey.rb +2 -1
- data/lib/familia/data_type/types/sorted_set.rb +113 -10
- data/lib/familia/data_type/types/stringkey.rb +0 -4
- data/lib/familia/data_type.rb +8 -195
- data/lib/familia/encryption/encrypted_data.rb +12 -2
- data/lib/familia/encryption/manager.rb +11 -4
- data/lib/familia/features/autoloader.rb +3 -1
- data/lib/familia/features/encrypted_fields/encrypted_field_type.rb +11 -3
- data/lib/familia/features/encrypted_fields.rb +5 -2
- data/lib/familia/features/external_identifier.rb +49 -8
- data/lib/familia/features/object_identifier.rb +84 -12
- data/lib/familia/features/relationships/indexing/multi_index_generators.rb +9 -9
- data/lib/familia/features/relationships/indexing/unique_index_generators.rb +45 -26
- data/lib/familia/features/relationships/indexing.rb +7 -1
- data/lib/familia/features/relationships/participation/participant_methods.rb +6 -2
- data/lib/familia/features/safe_dump.rb +2 -3
- data/lib/familia/features/transient_fields.rb +7 -2
- data/lib/familia/features.rb +6 -1
- data/lib/familia/field_type.rb +0 -18
- data/lib/familia/horreum/{core/connection.rb → connection.rb} +21 -0
- data/lib/familia/horreum/{core/database_commands.rb → database_commands.rb} +1 -1
- data/lib/familia/horreum/{subclass/definition.rb → definition.rb} +102 -56
- data/lib/familia/horreum/{subclass/management.rb → management.rb} +18 -15
- data/lib/familia/horreum/{core/serialization.rb → persistence.rb} +73 -170
- data/lib/familia/horreum/{subclass/related_fields_management.rb → related_fields.rb} +22 -2
- data/lib/familia/horreum/serialization.rb +190 -0
- data/lib/familia/horreum.rb +39 -14
- data/lib/familia/identifier_extractor.rb +60 -0
- data/lib/familia/logging.rb +271 -112
- data/lib/familia/refinements.rb +0 -1
- data/lib/familia/version.rb +1 -1
- data/lib/familia.rb +2 -2
- data/lib/middleware/{database_middleware.rb → database_logger.rb} +47 -14
- data/pr_agent.toml +31 -0
- data/pr_compliance_checklist.yaml +45 -0
- data/try/edge_cases/empty_identifiers_try.rb +1 -1
- data/try/edge_cases/hash_symbolization_try.rb +31 -31
- data/try/edge_cases/json_serialization_try.rb +2 -2
- data/try/edge_cases/legacy_data_detection/deserialization_edge_cases_try.rb +170 -0
- data/try/edge_cases/race_conditions_try.rb +1 -1
- data/try/edge_cases/reserved_keywords_try.rb +1 -1
- data/try/edge_cases/string_coercion_try.rb +1 -1
- data/try/edge_cases/ttl_side_effects_try.rb +1 -1
- data/try/features/encrypted_fields/aad_protection_try.rb +1 -1
- data/try/features/encrypted_fields/concealed_string_core_try.rb +1 -1
- data/try/features/encrypted_fields/context_isolation_try.rb +1 -1
- data/try/features/encrypted_fields/encrypted_fields_core_try.rb +1 -1
- data/try/features/encrypted_fields/encrypted_fields_integration_try.rb +1 -1
- data/try/features/encrypted_fields/encrypted_fields_no_cache_security_try.rb +1 -1
- data/try/features/encrypted_fields/encrypted_fields_security_try.rb +1 -1
- data/try/features/encrypted_fields/error_conditions_try.rb +1 -1
- data/try/features/encrypted_fields/fresh_key_derivation_try.rb +1 -1
- data/try/features/encrypted_fields/fresh_key_try.rb +1 -1
- data/try/features/encrypted_fields/key_rotation_try.rb +1 -1
- data/try/features/encrypted_fields/memory_security_try.rb +1 -1
- data/try/features/encrypted_fields/missing_current_key_version_try.rb +1 -1
- data/try/features/encrypted_fields/nonce_uniqueness_try.rb +1 -1
- data/try/features/encrypted_fields/secure_by_default_behavior_try.rb +1 -1
- data/try/features/encrypted_fields/thread_safety_try.rb +1 -1
- data/try/features/encrypted_fields/universal_serialization_safety_try.rb +1 -1
- data/try/{encryption → features/encryption}/config_persistence_try.rb +1 -1
- data/try/{encryption/encryption_core_try.rb → features/encryption/core_try.rb} +2 -2
- data/try/{encryption → features/encryption}/instance_variable_scope_try.rb +1 -1
- data/try/{encryption → features/encryption}/module_loading_try.rb +1 -1
- data/try/{encryption → features/encryption}/providers/aes_gcm_provider_try.rb +1 -1
- data/try/{encryption → features/encryption}/providers/xchacha20_poly1305_provider_try.rb +1 -1
- data/try/{encryption → features/encryption}/roundtrip_validation_try.rb +1 -1
- data/try/{encryption → features/encryption}/secure_memory_handling_try.rb +2 -2
- data/try/features/expiration/expiration_try.rb +1 -1
- data/try/features/external_identifier/external_identifier_try.rb +1 -1
- data/try/features/feature_dependencies_try.rb +1 -1
- data/try/features/feature_improvements_try.rb +1 -1
- data/try/features/field_groups_try.rb +244 -0
- data/try/features/object_identifier/object_identifier_integration_try.rb +1 -1
- data/try/features/object_identifier/object_identifier_try.rb +1 -1
- data/try/features/quantization/quantization_try.rb +1 -1
- data/try/features/real_feature_integration_try.rb +17 -14
- data/try/features/relationships/indexing_commands_verification_try.rb +8 -3
- data/try/features/relationships/indexing_try.rb +16 -1
- data/try/features/relationships/participation_commands_verification_spec.rb +1 -1
- data/try/features/relationships/participation_commands_verification_try.rb +4 -4
- data/try/features/relationships/participation_performance_improvements_try.rb +1 -1
- data/try/features/relationships/participation_reverse_index_try.rb +1 -1
- data/try/features/relationships/relationships_api_changes_try.rb +1 -1
- data/try/features/relationships/relationships_edge_cases_try.rb +3 -3
- data/try/features/relationships/relationships_performance_minimal_try.rb +1 -1
- data/try/features/relationships/relationships_performance_simple_try.rb +1 -1
- data/try/features/relationships/relationships_performance_try.rb +1 -1
- data/try/features/relationships/relationships_performance_working_try.rb +1 -1
- data/try/features/relationships/relationships_try.rb +1 -1
- data/try/features/safe_dump/safe_dump_advanced_try.rb +1 -1
- data/try/features/safe_dump/safe_dump_try.rb +1 -1
- data/try/features/transient_fields/redacted_string_try.rb +1 -1
- data/try/features/transient_fields/refresh_reset_try.rb +3 -1
- data/try/features/transient_fields/single_use_redacted_string_try.rb +1 -1
- data/try/features/transient_fields/transient_fields_core_try.rb +1 -1
- data/try/features/transient_fields/transient_fields_integration_try.rb +1 -1
- data/try/{connection → integration/connection}/fiber_context_preservation_try.rb +1 -1
- data/try/{connection → integration/connection}/handler_constraints_try.rb +1 -1
- data/try/{core → integration/connection}/isolated_dbclient_try.rb +3 -3
- data/try/integration/connection/middleware_reconnect_try.rb +87 -0
- data/try/{connection → integration/connection}/operation_mode_guards_try.rb +1 -1
- data/try/{connection → integration/connection}/pipeline_fallback_integration_try.rb +1 -1
- data/try/{core → integration/connection}/pools_try.rb +1 -1
- data/try/{connection → integration/connection}/responsibility_chain_tracking_try.rb +1 -1
- data/try/{connection → integration/connection}/transaction_fallback_integration_try.rb +1 -1
- data/try/{connection → integration/connection}/transaction_mode_permissive_try.rb +1 -1
- data/try/{connection → integration/connection}/transaction_mode_strict_try.rb +1 -1
- data/try/{connection → integration/connection}/transaction_mode_warn_try.rb +1 -1
- data/try/{connection → integration/connection}/transaction_modes_try.rb +1 -1
- data/try/{core → integration}/conventional_inheritance_try.rb +1 -1
- data/try/{core → integration}/create_method_try.rb +1 -1
- data/try/integration/cross_component_try.rb +1 -1
- data/try/{core → integration}/database_consistency_try.rb +12 -8
- data/try/{core → integration}/familia_extended_try.rb +1 -1
- data/try/{core → integration}/familia_members_methods_try.rb +1 -1
- data/try/{models → integration/models}/customer_safe_dump_try.rb +1 -1
- data/try/{models → integration/models}/customer_try.rb +6 -6
- data/try/{models → integration/models}/datatype_base_try.rb +1 -1
- data/try/{models → integration/models}/familia_object_try.rb +1 -1
- data/try/{core → integration}/persistence_operations_try.rb +1 -1
- data/try/integration/relationships_persistence_round_trip_try.rb +441 -0
- data/try/{configuration → integration}/scenarios_try.rb +2 -2
- data/try/{core → integration}/secure_identifier_try.rb +1 -1
- data/try/{core → integration}/verifiable_identifier_try.rb +1 -1
- data/try/performance/benchmarks_try.rb +2 -2
- data/try/support/benchmarks/deserialization_benchmark.rb +180 -0
- data/try/support/benchmarks/deserialization_correctness_test.rb +237 -0
- data/try/{helpers → support/helpers}/test_helpers.rb +15 -7
- data/try/{memory → support/memory}/memory_docker_ruby_dump.sh +1 -1
- data/try/{core → unit/core}/autoloader_try.rb +1 -1
- data/try/{core → unit/core}/base_enhancements_try.rb +1 -9
- data/try/{core → unit/core}/connection_try.rb +5 -5
- data/try/{core → unit/core}/errors_try.rb +4 -4
- data/try/{core → unit/core}/extensions_try.rb +1 -1
- data/try/unit/core/familia_logger_try.rb +110 -0
- data/try/{core → unit/core}/familia_try.rb +2 -2
- data/try/{core → unit/core}/middleware_try.rb +41 -1
- data/try/{core → unit/core}/settings_try.rb +1 -1
- data/try/{core → unit/core}/time_utils_try.rb +1 -1
- data/try/{core → unit/core}/tools_try.rb +3 -3
- data/try/{core → unit/core}/utils_try.rb +17 -14
- data/try/{data_types → unit/data_types}/boolean_try.rb +1 -1
- data/try/{data_types → unit/data_types}/counter_try.rb +1 -1
- data/try/{data_types → unit/data_types}/datatype_base_try.rb +1 -1
- data/try/{data_types → unit/data_types}/hash_try.rb +1 -1
- data/try/{data_types → unit/data_types}/list_try.rb +1 -1
- data/try/{data_types → unit/data_types}/lock_try.rb +1 -1
- data/try/{data_types → unit/data_types}/sorted_set_try.rb +1 -1
- data/try/unit/data_types/sorted_set_zadd_options_try.rb +625 -0
- data/try/{data_types → unit/data_types}/string_try.rb +1 -1
- data/try/{data_types → unit/data_types}/unsortedset_try.rb +1 -1
- data/try/unit/horreum/auto_indexing_on_save_try.rb +212 -0
- data/try/{horreum → unit/horreum}/base_try.rb +3 -3
- data/try/{horreum → unit/horreum}/class_methods_try.rb +1 -1
- data/try/{horreum → unit/horreum}/commands_try.rb +3 -1
- data/try/unit/horreum/defensive_initialization_try.rb +86 -0
- data/try/{horreum → unit/horreum}/destroy_related_fields_cleanup_try.rb +3 -1
- data/try/{horreum → unit/horreum}/enhanced_conflict_handling_try.rb +1 -1
- data/try/{horreum → unit/horreum}/field_categories_try.rb +27 -18
- data/try/{horreum → unit/horreum}/field_definition_try.rb +1 -1
- data/try/{horreum → unit/horreum}/initialization_try.rb +2 -2
- data/try/unit/horreum/json_type_preservation_try.rb +248 -0
- data/try/{horreum → unit/horreum}/relations_try.rb +1 -1
- data/try/{horreum → unit/horreum}/serialization_persistent_fields_try.rb +24 -18
- data/try/{horreum → unit/horreum}/serialization_try.rb +4 -4
- data/try/{horreum → unit/horreum}/settings_try.rb +3 -1
- data/try/{refinements → unit/refinements}/dear_json_array_methods_try.rb +1 -1
- data/try/{refinements → unit/refinements}/dear_json_hash_methods_try.rb +1 -1
- data/try/{refinements → unit/refinements}/time_literals_numeric_methods_try.rb +1 -1
- data/try/{refinements → unit/refinements}/time_literals_string_methods_try.rb +1 -1
- data/try/valkey.conf +26 -0
- metadata +149 -132
- data/lib/familia/distinguisher.rb +0 -85
- data/lib/familia/horreum/core.rb +0 -21
- data/lib/familia/refinements/logger_trace.rb +0 -60
- data/try/refinements/logger_trace_methods_try.rb +0 -44
- /data/lib/familia/horreum/{shared/settings.rb → settings.rb} +0 -0
- /data/lib/familia/horreum/{core/utils.rb → utils.rb} +0 -0
- /data/try/{debugging → support/debugging}/README.md +0 -0
- /data/try/{debugging → support/debugging}/cache_behavior_tracer.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_aad_process.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_concealed_internal.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_concealed_reveal.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_context_aad.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_context_simple.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_cross_context.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_database_load.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_encrypted_json_check.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_encrypted_json_step_by_step.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_exists_lifecycle.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_field_decrypt.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_fresh_cross_context.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_load_path.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_method_definition.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_method_resolution.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_minimal.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_provider.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_secure_behavior.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_string_class.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_test.rb +0 -0
- /data/try/{debugging → support/debugging}/debug_test_design.rb +0 -0
- /data/try/{debugging → support/debugging}/encryption_method_tracer.rb +0 -0
- /data/try/{debugging → support/debugging}/provider_diagnostics.rb +0 -0
- /data/try/{helpers → support/helpers}/test_cleanup.rb +0 -0
- /data/try/{memory → support/memory}/memory_basic_test.rb +0 -0
- /data/try/{memory → support/memory}/memory_detailed_test.rb +0 -0
- /data/try/{memory → support/memory}/memory_search_for_string.rb +0 -0
- /data/try/{memory → support/memory}/test_actual_redactedstring_protection.rb +0 -0
- /data/try/{prototypes → support/prototypes}/atomic_saves_v1_context_proxy.rb +0 -0
- /data/try/{prototypes → support/prototypes}/atomic_saves_v2_connection_switching.rb +0 -0
- /data/try/{prototypes → support/prototypes}/atomic_saves_v3_connection_pool.rb +0 -0
- /data/try/{prototypes → support/prototypes}/atomic_saves_v4.rb +0 -0
- /data/try/{prototypes → support/prototypes}/lib/atomic_saves_v2_connection_switching_helpers.rb +0 -0
- /data/try/{prototypes → support/prototypes}/lib/atomic_saves_v3_connection_pool_helpers.rb +0 -0
- /data/try/{prototypes → support/prototypes}/pooling/README.md +0 -0
- /data/try/{prototypes → support/prototypes}/pooling/configurable_stress_test.rb +0 -0
- /data/try/{prototypes → support/prototypes}/pooling/lib/atomic_saves_v3_connection_pool_helpers.rb +0 -0
- /data/try/{prototypes → support/prototypes}/pooling/lib/connection_pool_metrics.rb +0 -0
- /data/try/{prototypes → support/prototypes}/pooling/lib/connection_pool_stress_test.rb +0 -0
- /data/try/{prototypes → support/prototypes}/pooling/lib/connection_pool_threading_models.rb +0 -0
- /data/try/{prototypes → support/prototypes}/pooling/lib/visualize_stress_results.rb +0 -0
- /data/try/{prototypes → support/prototypes}/pooling/pool_siege.rb +0 -0
- /data/try/{prototypes → support/prototypes}/pooling/run_stress_tests.rb +0 -0
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: familia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.pre18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
@@ -138,7 +138,7 @@ files:
|
|
138
138
|
- ".github/workflows/claude-code-review.yml"
|
139
139
|
- ".github/workflows/claude.yml"
|
140
140
|
- ".github/workflows/code-quality.yml"
|
141
|
-
- ".github/workflows/code-
|
141
|
+
- ".github/workflows/code-smells.yml"
|
142
142
|
- ".github/workflows/docs.yml"
|
143
143
|
- ".gitignore"
|
144
144
|
- ".pre-commit-config.yaml"
|
@@ -184,10 +184,12 @@ files:
|
|
184
184
|
- docs/migrating/v2.0.0-pre12.md
|
185
185
|
- docs/migrating/v2.0.0-pre13.md
|
186
186
|
- docs/migrating/v2.0.0-pre14.md
|
187
|
+
- docs/migrating/v2.0.0-pre18.md
|
187
188
|
- docs/migrating/v2.0.0-pre5.md
|
188
189
|
- docs/migrating/v2.0.0-pre6.md
|
189
190
|
- docs/migrating/v2.0.0-pre7.md
|
190
191
|
- docs/overview.md
|
192
|
+
- docs/qodo-merge-compliance.md
|
191
193
|
- docs/reference/api-technical.md
|
192
194
|
- examples/autoloader/mega_customer.rb
|
193
195
|
- examples/autoloader/mega_customer/features/deprecated_fields.rb
|
@@ -209,8 +211,11 @@ files:
|
|
209
211
|
- lib/familia/connection/pipeline_core.rb
|
210
212
|
- lib/familia/connection/transaction_core.rb
|
211
213
|
- lib/familia/data_type.rb
|
212
|
-
- lib/familia/data_type/
|
214
|
+
- lib/familia/data_type/class_methods.rb
|
215
|
+
- lib/familia/data_type/connection.rb
|
216
|
+
- lib/familia/data_type/database_commands.rb
|
213
217
|
- lib/familia/data_type/serialization.rb
|
218
|
+
- lib/familia/data_type/settings.rb
|
214
219
|
- lib/familia/data_type/types/counter.rb
|
215
220
|
- lib/familia/data_type/types/hashkey.rb
|
216
221
|
- lib/familia/data_type/types/listkey.rb
|
@@ -218,7 +223,6 @@ files:
|
|
218
223
|
- lib/familia/data_type/types/sorted_set.rb
|
219
224
|
- lib/familia/data_type/types/stringkey.rb
|
220
225
|
- lib/familia/data_type/types/unsorted_set.rb
|
221
|
-
- lib/familia/distinguisher.rb
|
222
226
|
- lib/familia/encryption.rb
|
223
227
|
- lib/familia/encryption/encrypted_data.rb
|
224
228
|
- lib/familia/encryption/manager.rb
|
@@ -258,20 +262,20 @@ files:
|
|
258
262
|
- lib/familia/features/transient_fields/transient_field_type.rb
|
259
263
|
- lib/familia/field_type.rb
|
260
264
|
- lib/familia/horreum.rb
|
261
|
-
- lib/familia/horreum/
|
262
|
-
- lib/familia/horreum/
|
263
|
-
- lib/familia/horreum/
|
264
|
-
- lib/familia/horreum/
|
265
|
-
- lib/familia/horreum/
|
266
|
-
- lib/familia/horreum/
|
267
|
-
- lib/familia/horreum/
|
268
|
-
- lib/familia/horreum/
|
269
|
-
- lib/familia/horreum/
|
265
|
+
- lib/familia/horreum/connection.rb
|
266
|
+
- lib/familia/horreum/database_commands.rb
|
267
|
+
- lib/familia/horreum/definition.rb
|
268
|
+
- lib/familia/horreum/management.rb
|
269
|
+
- lib/familia/horreum/persistence.rb
|
270
|
+
- lib/familia/horreum/related_fields.rb
|
271
|
+
- lib/familia/horreum/serialization.rb
|
272
|
+
- lib/familia/horreum/settings.rb
|
273
|
+
- lib/familia/horreum/utils.rb
|
274
|
+
- lib/familia/identifier_extractor.rb
|
270
275
|
- lib/familia/json_serializer.rb
|
271
276
|
- lib/familia/logging.rb
|
272
277
|
- lib/familia/refinements.rb
|
273
278
|
- lib/familia/refinements/dear_json.rb
|
274
|
-
- lib/familia/refinements/logger_trace.rb
|
275
279
|
- lib/familia/refinements/stylize_words.rb
|
276
280
|
- lib/familia/refinements/time_literals.rb
|
277
281
|
- lib/familia/secure_identifier.rb
|
@@ -279,89 +283,18 @@ files:
|
|
279
283
|
- lib/familia/utils.rb
|
280
284
|
- lib/familia/verifiable_identifier.rb
|
281
285
|
- lib/familia/version.rb
|
282
|
-
- lib/middleware/
|
286
|
+
- lib/middleware/database_logger.rb
|
283
287
|
- lib/multi_result.rb
|
284
|
-
-
|
285
|
-
-
|
286
|
-
- try/connection/handler_constraints_try.rb
|
287
|
-
- try/connection/operation_mode_guards_try.rb
|
288
|
-
- try/connection/pipeline_fallback_integration_try.rb
|
289
|
-
- try/connection/responsibility_chain_tracking_try.rb
|
290
|
-
- try/connection/transaction_fallback_integration_try.rb
|
291
|
-
- try/connection/transaction_mode_permissive_try.rb
|
292
|
-
- try/connection/transaction_mode_strict_try.rb
|
293
|
-
- try/connection/transaction_mode_warn_try.rb
|
294
|
-
- try/connection/transaction_modes_try.rb
|
295
|
-
- try/core/autoloader_try.rb
|
296
|
-
- try/core/base_enhancements_try.rb
|
297
|
-
- try/core/connection_try.rb
|
298
|
-
- try/core/conventional_inheritance_try.rb
|
299
|
-
- try/core/create_method_try.rb
|
300
|
-
- try/core/database_consistency_try.rb
|
301
|
-
- try/core/errors_try.rb
|
302
|
-
- try/core/extensions_try.rb
|
303
|
-
- try/core/familia_extended_try.rb
|
304
|
-
- try/core/familia_members_methods_try.rb
|
305
|
-
- try/core/familia_try.rb
|
306
|
-
- try/core/isolated_dbclient_try.rb
|
307
|
-
- try/core/middleware_try.rb
|
308
|
-
- try/core/persistence_operations_try.rb
|
309
|
-
- try/core/pools_try.rb
|
310
|
-
- try/core/secure_identifier_try.rb
|
311
|
-
- try/core/settings_try.rb
|
312
|
-
- try/core/time_utils_try.rb
|
313
|
-
- try/core/tools_try.rb
|
314
|
-
- try/core/utils_try.rb
|
315
|
-
- try/core/verifiable_identifier_try.rb
|
316
|
-
- try/data_types/boolean_try.rb
|
317
|
-
- try/data_types/counter_try.rb
|
318
|
-
- try/data_types/datatype_base_try.rb
|
319
|
-
- try/data_types/hash_try.rb
|
320
|
-
- try/data_types/list_try.rb
|
321
|
-
- try/data_types/lock_try.rb
|
322
|
-
- try/data_types/sorted_set_try.rb
|
323
|
-
- try/data_types/string_try.rb
|
324
|
-
- try/data_types/unsortedset_try.rb
|
325
|
-
- try/debugging/README.md
|
326
|
-
- try/debugging/cache_behavior_tracer.rb
|
327
|
-
- try/debugging/debug_aad_process.rb
|
328
|
-
- try/debugging/debug_concealed_internal.rb
|
329
|
-
- try/debugging/debug_concealed_reveal.rb
|
330
|
-
- try/debugging/debug_context_aad.rb
|
331
|
-
- try/debugging/debug_context_simple.rb
|
332
|
-
- try/debugging/debug_cross_context.rb
|
333
|
-
- try/debugging/debug_database_load.rb
|
334
|
-
- try/debugging/debug_encrypted_json_check.rb
|
335
|
-
- try/debugging/debug_encrypted_json_step_by_step.rb
|
336
|
-
- try/debugging/debug_exists_lifecycle.rb
|
337
|
-
- try/debugging/debug_field_decrypt.rb
|
338
|
-
- try/debugging/debug_fresh_cross_context.rb
|
339
|
-
- try/debugging/debug_load_path.rb
|
340
|
-
- try/debugging/debug_method_definition.rb
|
341
|
-
- try/debugging/debug_method_resolution.rb
|
342
|
-
- try/debugging/debug_minimal.rb
|
343
|
-
- try/debugging/debug_provider.rb
|
344
|
-
- try/debugging/debug_secure_behavior.rb
|
345
|
-
- try/debugging/debug_string_class.rb
|
346
|
-
- try/debugging/debug_test.rb
|
347
|
-
- try/debugging/debug_test_design.rb
|
348
|
-
- try/debugging/encryption_method_tracer.rb
|
349
|
-
- try/debugging/provider_diagnostics.rb
|
288
|
+
- pr_agent.toml
|
289
|
+
- pr_compliance_checklist.yaml
|
350
290
|
- try/edge_cases/empty_identifiers_try.rb
|
351
291
|
- try/edge_cases/hash_symbolization_try.rb
|
352
292
|
- try/edge_cases/json_serialization_try.rb
|
293
|
+
- try/edge_cases/legacy_data_detection/deserialization_edge_cases_try.rb
|
353
294
|
- try/edge_cases/race_conditions_try.rb
|
354
295
|
- try/edge_cases/reserved_keywords_try.rb
|
355
296
|
- try/edge_cases/string_coercion_try.rb
|
356
297
|
- try/edge_cases/ttl_side_effects_try.rb
|
357
|
-
- try/encryption/config_persistence_try.rb
|
358
|
-
- try/encryption/encryption_core_try.rb
|
359
|
-
- try/encryption/instance_variable_scope_try.rb
|
360
|
-
- try/encryption/module_loading_try.rb
|
361
|
-
- try/encryption/providers/aes_gcm_provider_try.rb
|
362
|
-
- try/encryption/providers/xchacha20_poly1305_provider_try.rb
|
363
|
-
- try/encryption/roundtrip_validation_try.rb
|
364
|
-
- try/encryption/secure_memory_handling_try.rb
|
365
298
|
- try/features/encrypted_fields/aad_protection_try.rb
|
366
299
|
- try/features/encrypted_fields/concealed_string_core_try.rb
|
367
300
|
- try/features/encrypted_fields/context_isolation_try.rb
|
@@ -379,10 +312,19 @@ files:
|
|
379
312
|
- try/features/encrypted_fields/secure_by_default_behavior_try.rb
|
380
313
|
- try/features/encrypted_fields/thread_safety_try.rb
|
381
314
|
- try/features/encrypted_fields/universal_serialization_safety_try.rb
|
315
|
+
- try/features/encryption/config_persistence_try.rb
|
316
|
+
- try/features/encryption/core_try.rb
|
317
|
+
- try/features/encryption/instance_variable_scope_try.rb
|
318
|
+
- try/features/encryption/module_loading_try.rb
|
319
|
+
- try/features/encryption/providers/aes_gcm_provider_try.rb
|
320
|
+
- try/features/encryption/providers/xchacha20_poly1305_provider_try.rb
|
321
|
+
- try/features/encryption/roundtrip_validation_try.rb
|
322
|
+
- try/features/encryption/secure_memory_handling_try.rb
|
382
323
|
- try/features/expiration/expiration_try.rb
|
383
324
|
- try/features/external_identifier/external_identifier_try.rb
|
384
325
|
- try/features/feature_dependencies_try.rb
|
385
326
|
- try/features/feature_improvements_try.rb
|
327
|
+
- try/features/field_groups_try.rb
|
386
328
|
- try/features/object_identifier/object_identifier_integration_try.rb
|
387
329
|
- try/features/object_identifier/object_identifier_try.rb
|
388
330
|
- try/features/quantization/quantization_try.rb
|
@@ -408,51 +350,126 @@ files:
|
|
408
350
|
- try/features/transient_fields/single_use_redacted_string_try.rb
|
409
351
|
- try/features/transient_fields/transient_fields_core_try.rb
|
410
352
|
- try/features/transient_fields/transient_fields_integration_try.rb
|
411
|
-
- try/
|
412
|
-
- try/
|
413
|
-
- try/
|
414
|
-
- try/
|
415
|
-
- try/
|
416
|
-
- try/
|
417
|
-
- try/
|
418
|
-
- try/
|
419
|
-
- try/
|
420
|
-
- try/
|
421
|
-
- try/
|
422
|
-
- try/
|
423
|
-
- try/
|
424
|
-
- try/
|
353
|
+
- try/integration/connection/fiber_context_preservation_try.rb
|
354
|
+
- try/integration/connection/handler_constraints_try.rb
|
355
|
+
- try/integration/connection/isolated_dbclient_try.rb
|
356
|
+
- try/integration/connection/middleware_reconnect_try.rb
|
357
|
+
- try/integration/connection/operation_mode_guards_try.rb
|
358
|
+
- try/integration/connection/pipeline_fallback_integration_try.rb
|
359
|
+
- try/integration/connection/pools_try.rb
|
360
|
+
- try/integration/connection/responsibility_chain_tracking_try.rb
|
361
|
+
- try/integration/connection/transaction_fallback_integration_try.rb
|
362
|
+
- try/integration/connection/transaction_mode_permissive_try.rb
|
363
|
+
- try/integration/connection/transaction_mode_strict_try.rb
|
364
|
+
- try/integration/connection/transaction_mode_warn_try.rb
|
365
|
+
- try/integration/connection/transaction_modes_try.rb
|
366
|
+
- try/integration/conventional_inheritance_try.rb
|
367
|
+
- try/integration/create_method_try.rb
|
425
368
|
- try/integration/cross_component_try.rb
|
426
|
-
- try/
|
427
|
-
- try/
|
428
|
-
- try/
|
429
|
-
- try/
|
430
|
-
- try/
|
431
|
-
- try/models/
|
432
|
-
- try/models/
|
433
|
-
- try/
|
434
|
-
- try/
|
369
|
+
- try/integration/database_consistency_try.rb
|
370
|
+
- try/integration/familia_extended_try.rb
|
371
|
+
- try/integration/familia_members_methods_try.rb
|
372
|
+
- try/integration/models/customer_safe_dump_try.rb
|
373
|
+
- try/integration/models/customer_try.rb
|
374
|
+
- try/integration/models/datatype_base_try.rb
|
375
|
+
- try/integration/models/familia_object_try.rb
|
376
|
+
- try/integration/persistence_operations_try.rb
|
377
|
+
- try/integration/relationships_persistence_round_trip_try.rb
|
378
|
+
- try/integration/scenarios_try.rb
|
379
|
+
- try/integration/secure_identifier_try.rb
|
380
|
+
- try/integration/verifiable_identifier_try.rb
|
435
381
|
- try/performance/benchmarks_try.rb
|
436
|
-
- try/
|
437
|
-
- try/
|
438
|
-
- try/
|
439
|
-
- try/
|
440
|
-
- try/
|
441
|
-
- try/
|
442
|
-
- try/
|
443
|
-
- try/
|
444
|
-
- try/
|
445
|
-
- try/
|
446
|
-
- try/
|
447
|
-
- try/
|
448
|
-
- try/
|
449
|
-
- try/
|
450
|
-
- try/
|
451
|
-
- try/
|
452
|
-
- try/
|
453
|
-
- try/
|
454
|
-
- try/
|
455
|
-
- try/
|
382
|
+
- try/support/benchmarks/deserialization_benchmark.rb
|
383
|
+
- try/support/benchmarks/deserialization_correctness_test.rb
|
384
|
+
- try/support/debugging/README.md
|
385
|
+
- try/support/debugging/cache_behavior_tracer.rb
|
386
|
+
- try/support/debugging/debug_aad_process.rb
|
387
|
+
- try/support/debugging/debug_concealed_internal.rb
|
388
|
+
- try/support/debugging/debug_concealed_reveal.rb
|
389
|
+
- try/support/debugging/debug_context_aad.rb
|
390
|
+
- try/support/debugging/debug_context_simple.rb
|
391
|
+
- try/support/debugging/debug_cross_context.rb
|
392
|
+
- try/support/debugging/debug_database_load.rb
|
393
|
+
- try/support/debugging/debug_encrypted_json_check.rb
|
394
|
+
- try/support/debugging/debug_encrypted_json_step_by_step.rb
|
395
|
+
- try/support/debugging/debug_exists_lifecycle.rb
|
396
|
+
- try/support/debugging/debug_field_decrypt.rb
|
397
|
+
- try/support/debugging/debug_fresh_cross_context.rb
|
398
|
+
- try/support/debugging/debug_load_path.rb
|
399
|
+
- try/support/debugging/debug_method_definition.rb
|
400
|
+
- try/support/debugging/debug_method_resolution.rb
|
401
|
+
- try/support/debugging/debug_minimal.rb
|
402
|
+
- try/support/debugging/debug_provider.rb
|
403
|
+
- try/support/debugging/debug_secure_behavior.rb
|
404
|
+
- try/support/debugging/debug_string_class.rb
|
405
|
+
- try/support/debugging/debug_test.rb
|
406
|
+
- try/support/debugging/debug_test_design.rb
|
407
|
+
- try/support/debugging/encryption_method_tracer.rb
|
408
|
+
- try/support/debugging/provider_diagnostics.rb
|
409
|
+
- try/support/helpers/test_cleanup.rb
|
410
|
+
- try/support/helpers/test_helpers.rb
|
411
|
+
- try/support/memory/memory_basic_test.rb
|
412
|
+
- try/support/memory/memory_detailed_test.rb
|
413
|
+
- try/support/memory/memory_docker_ruby_dump.sh
|
414
|
+
- try/support/memory/memory_search_for_string.rb
|
415
|
+
- try/support/memory/test_actual_redactedstring_protection.rb
|
416
|
+
- try/support/prototypes/atomic_saves_v1_context_proxy.rb
|
417
|
+
- try/support/prototypes/atomic_saves_v2_connection_switching.rb
|
418
|
+
- try/support/prototypes/atomic_saves_v3_connection_pool.rb
|
419
|
+
- try/support/prototypes/atomic_saves_v4.rb
|
420
|
+
- try/support/prototypes/lib/atomic_saves_v2_connection_switching_helpers.rb
|
421
|
+
- try/support/prototypes/lib/atomic_saves_v3_connection_pool_helpers.rb
|
422
|
+
- try/support/prototypes/pooling/README.md
|
423
|
+
- try/support/prototypes/pooling/configurable_stress_test.rb
|
424
|
+
- try/support/prototypes/pooling/lib/atomic_saves_v3_connection_pool_helpers.rb
|
425
|
+
- try/support/prototypes/pooling/lib/connection_pool_metrics.rb
|
426
|
+
- try/support/prototypes/pooling/lib/connection_pool_stress_test.rb
|
427
|
+
- try/support/prototypes/pooling/lib/connection_pool_threading_models.rb
|
428
|
+
- try/support/prototypes/pooling/lib/visualize_stress_results.rb
|
429
|
+
- try/support/prototypes/pooling/pool_siege.rb
|
430
|
+
- try/support/prototypes/pooling/run_stress_tests.rb
|
431
|
+
- try/unit/core/autoloader_try.rb
|
432
|
+
- try/unit/core/base_enhancements_try.rb
|
433
|
+
- try/unit/core/connection_try.rb
|
434
|
+
- try/unit/core/errors_try.rb
|
435
|
+
- try/unit/core/extensions_try.rb
|
436
|
+
- try/unit/core/familia_logger_try.rb
|
437
|
+
- try/unit/core/familia_try.rb
|
438
|
+
- try/unit/core/middleware_try.rb
|
439
|
+
- try/unit/core/settings_try.rb
|
440
|
+
- try/unit/core/time_utils_try.rb
|
441
|
+
- try/unit/core/tools_try.rb
|
442
|
+
- try/unit/core/utils_try.rb
|
443
|
+
- try/unit/data_types/boolean_try.rb
|
444
|
+
- try/unit/data_types/counter_try.rb
|
445
|
+
- try/unit/data_types/datatype_base_try.rb
|
446
|
+
- try/unit/data_types/hash_try.rb
|
447
|
+
- try/unit/data_types/list_try.rb
|
448
|
+
- try/unit/data_types/lock_try.rb
|
449
|
+
- try/unit/data_types/sorted_set_try.rb
|
450
|
+
- try/unit/data_types/sorted_set_zadd_options_try.rb
|
451
|
+
- try/unit/data_types/string_try.rb
|
452
|
+
- try/unit/data_types/unsortedset_try.rb
|
453
|
+
- try/unit/horreum/auto_indexing_on_save_try.rb
|
454
|
+
- try/unit/horreum/base_try.rb
|
455
|
+
- try/unit/horreum/class_methods_try.rb
|
456
|
+
- try/unit/horreum/commands_try.rb
|
457
|
+
- try/unit/horreum/defensive_initialization_try.rb
|
458
|
+
- try/unit/horreum/destroy_related_fields_cleanup_try.rb
|
459
|
+
- try/unit/horreum/enhanced_conflict_handling_try.rb
|
460
|
+
- try/unit/horreum/field_categories_try.rb
|
461
|
+
- try/unit/horreum/field_definition_try.rb
|
462
|
+
- try/unit/horreum/initialization_try.rb
|
463
|
+
- try/unit/horreum/json_type_preservation_try.rb
|
464
|
+
- try/unit/horreum/relations_try.rb
|
465
|
+
- try/unit/horreum/serialization_persistent_fields_try.rb
|
466
|
+
- try/unit/horreum/serialization_try.rb
|
467
|
+
- try/unit/horreum/settings_try.rb
|
468
|
+
- try/unit/refinements/dear_json_array_methods_try.rb
|
469
|
+
- try/unit/refinements/dear_json_hash_methods_try.rb
|
470
|
+
- try/unit/refinements/time_literals_numeric_methods_try.rb
|
471
|
+
- try/unit/refinements/time_literals_string_methods_try.rb
|
472
|
+
- try/valkey.conf
|
456
473
|
homepage: https://github.com/delano/familia
|
457
474
|
licenses:
|
458
475
|
- MIT
|
@@ -1,85 +0,0 @@
|
|
1
|
-
# lib/familia/distinguisher.rb
|
2
|
-
|
3
|
-
module Familia
|
4
|
-
module Distinguisher
|
5
|
-
# This method determines the appropriate transformation to apply based on
|
6
|
-
# the class of the input argument.
|
7
|
-
#
|
8
|
-
# @param [Object] value_to_distinguish The value to be processed. Keep in
|
9
|
-
# mind that all data is stored as a string so whatever the type
|
10
|
-
# of the value, it will be converted to a string.
|
11
|
-
# @param [Boolean] strict_values Whether to enforce strict value handling.
|
12
|
-
# Defaults to true.
|
13
|
-
# @return [String, nil] The processed value as a string or nil for unsupported
|
14
|
-
# classes.
|
15
|
-
#
|
16
|
-
# The method uses a case statement to handle different classes:
|
17
|
-
# - For `Symbol`, `String`, `Integer`, and `Float` classes, it traces the
|
18
|
-
# operation and converts the value to a string.
|
19
|
-
# - For `Familia::Horreum` class, it traces the operation and returns the
|
20
|
-
# identifier of the value.
|
21
|
-
# - For `TrueClass`, `FalseClass`, and `NilClass`, it traces the operation and
|
22
|
-
# converts the value to a string ("true", "false", or "").
|
23
|
-
# - For any other class, it traces the operation and returns nil.
|
24
|
-
#
|
25
|
-
# Alternative names for `value_to_distinguish` could be `input_value`, `value`,
|
26
|
-
# or `object`.
|
27
|
-
#
|
28
|
-
def distinguisher(value_to_distinguish, strict_values: true)
|
29
|
-
case value_to_distinguish
|
30
|
-
when ::Symbol, ::String, ::Integer, ::Float
|
31
|
-
Familia.trace :TOREDIS_DISTINGUISHER, nil, 'string' if Familia.debug?
|
32
|
-
|
33
|
-
# Symbols and numerics are naturally serializable to strings
|
34
|
-
# so it's a relatively low risk operation.
|
35
|
-
value_to_distinguish.to_s
|
36
|
-
|
37
|
-
when ::TrueClass, ::FalseClass, ::NilClass
|
38
|
-
Familia.trace :TOREDIS_DISTINGUISHER, nil, 'true/false/nil' if Familia.debug?
|
39
|
-
|
40
|
-
# TrueClass, FalseClass, and NilClass are considered high risk because their
|
41
|
-
# original types cannot be reliably determined from their serialized string
|
42
|
-
# representations. This can lead to unexpected behavior during deserialization.
|
43
|
-
# For instance, a TrueClass value serialized as "true" might be deserialized as
|
44
|
-
# a String, causing application errors. Even more problematic, a NilClass value
|
45
|
-
# serialized as an empty string makes it impossible to distinguish between a
|
46
|
-
# nil value and an empty string upon deserialization. Such scenarios can result
|
47
|
-
# in subtle, hard-to-diagnose bugs. To mitigate these risks, we raise an
|
48
|
-
# exception when encountering these types unless the strict_values option is
|
49
|
-
# explicitly set to false.
|
50
|
-
#
|
51
|
-
raise Familia::NotDistinguishableError, value_to_distinguish if strict_values
|
52
|
-
|
53
|
-
value_to_distinguish.to_s #=> "true", "false", ""
|
54
|
-
|
55
|
-
when Familia::Base, Class
|
56
|
-
Familia.trace :TOREDIS_DISTINGUISHER, nil, 'base' if Familia.debug?
|
57
|
-
|
58
|
-
# When called with a class we simply transform it to its name. For
|
59
|
-
# instances of Familia class, we store the identifier.
|
60
|
-
if value_to_distinguish.is_a?(Class)
|
61
|
-
value_to_distinguish.name
|
62
|
-
else
|
63
|
-
value_to_distinguish.identifier
|
64
|
-
end
|
65
|
-
|
66
|
-
else
|
67
|
-
Familia.trace :TOREDIS_DISTINGUISHER, nil, "else1 #{strict_values}" if Familia.debug?
|
68
|
-
|
69
|
-
if value_to_distinguish.class.ancestors.member?(Familia::Base)
|
70
|
-
Familia.trace :TOREDIS_DISTINGUISHER, nil, 'isabase' if Familia.debug?
|
71
|
-
|
72
|
-
value_to_distinguish.identifier
|
73
|
-
|
74
|
-
else
|
75
|
-
Familia.trace :TOREDIS_DISTINGUISHER, nil, "else2 #{strict_values}" if Familia.debug?
|
76
|
-
raise Familia::NotDistinguishableError, value_to_distinguish if strict_values
|
77
|
-
|
78
|
-
nil
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
extend Distinguisher
|
85
|
-
end
|
data/lib/familia/horreum/core.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# lib/familia/horreum/core.rb
|
2
|
-
|
3
|
-
require_relative 'core/database_commands'
|
4
|
-
require_relative 'core/serialization'
|
5
|
-
require_relative 'core/connection'
|
6
|
-
require_relative 'core/utils'
|
7
|
-
|
8
|
-
module Familia
|
9
|
-
class Horreum
|
10
|
-
module Core
|
11
|
-
include Familia::Horreum::DatabaseCommands
|
12
|
-
include Familia::Horreum::Serialization
|
13
|
-
# include for instance methods after it's loaded. Note that Horreum::Utils
|
14
|
-
# are also included and at one time also has a uri method. This connection
|
15
|
-
# module is also extended for the class level methods. It will require some
|
16
|
-
# disambiguation at some point.
|
17
|
-
include Familia::Horreum::Connection
|
18
|
-
include Familia::Horreum::Utils
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
# lib/familia/refinements/logger_trace.rb
|
2
|
-
|
3
|
-
require 'pathname'
|
4
|
-
require 'logger'
|
5
|
-
|
6
|
-
# Controls whether tracing is enabled via an environment variable
|
7
|
-
FAMILIA_TRACE = ENV.fetch('FAMILIA_TRACE', 'false').downcase
|
8
|
-
|
9
|
-
# Familia::Refinements::LoggerTrace
|
10
|
-
#
|
11
|
-
# This module adds a 'trace' log level to the Ruby Logger class.
|
12
|
-
# It is enabled when the FAMILIA_TRACE environment variable is set to
|
13
|
-
# '1', 'true', or 'yes' (case-insensitive).
|
14
|
-
#
|
15
|
-
# @example Enabling trace logging
|
16
|
-
# # UnsortedSet environment variable
|
17
|
-
# ENV['FAMILIA_TRACE'] = 'true'
|
18
|
-
#
|
19
|
-
# # In your Ruby code
|
20
|
-
# require 'logger'
|
21
|
-
# using Familia::Refinements::LoggerTrace
|
22
|
-
#
|
23
|
-
# logger = Logger.new(STDOUT)
|
24
|
-
# logger.trace("This is a trace message")
|
25
|
-
#
|
26
|
-
module Familia
|
27
|
-
module Refinements
|
28
|
-
# Familia::Refinements::LoggerTrace
|
29
|
-
module LoggerTraceMethods
|
30
|
-
##
|
31
|
-
# Logs a message at the TRACE level.
|
32
|
-
#
|
33
|
-
# @param progname [String] The program name to include in the log message
|
34
|
-
# @yield A block that evaluates to the message to log
|
35
|
-
# @return [true] Always returns true
|
36
|
-
#
|
37
|
-
# @example Logging a trace message
|
38
|
-
# logger.trace("MyApp") { "Detailed trace information" }
|
39
|
-
def trace(progname = nil, &)
|
40
|
-
Fiber[:severity_letter] = 'T'
|
41
|
-
add(Familia::Refinements::LoggerTrace::TRACE, nil, progname, &)
|
42
|
-
ensure
|
43
|
-
Fiber[:severity_letter] = nil
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
module LoggerTrace
|
48
|
-
unless defined?(ENABLED)
|
49
|
-
# Indicates whether trace logging is enabled
|
50
|
-
ENABLED = %w[1 true yes].include?(FAMILIA_TRACE).freeze
|
51
|
-
# The numeric level for trace logging (same as DEBUG)
|
52
|
-
TRACE = 0
|
53
|
-
end
|
54
|
-
|
55
|
-
refine Logger do
|
56
|
-
import_methods LoggerTraceMethods
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# try/refinements/logger_trace_methods_try.rb
|
2
|
-
|
3
|
-
require_relative '../helpers/test_helpers'
|
4
|
-
require 'logger'
|
5
|
-
require 'stringio'
|
6
|
-
|
7
|
-
class TestLoggerWithTrace < Logger
|
8
|
-
include Familia::Refinements::LoggerTraceMethods
|
9
|
-
end
|
10
|
-
|
11
|
-
## Can create a logger with trace methods
|
12
|
-
output = StringIO.new
|
13
|
-
logger = TestLoggerWithTrace.new(output)
|
14
|
-
logger.respond_to?(:trace)
|
15
|
-
#=> true
|
16
|
-
|
17
|
-
## trace method logs with TRACE level
|
18
|
-
output = StringIO.new
|
19
|
-
logger = TestLoggerWithTrace.new(output)
|
20
|
-
logger.trace('Test message')
|
21
|
-
output.string
|
22
|
-
#=~> /Test message/
|
23
|
-
|
24
|
-
## trace method sets and clears severity letter
|
25
|
-
output = StringIO.new
|
26
|
-
logger = TestLoggerWithTrace.new(output)
|
27
|
-
logger.trace('Test message')
|
28
|
-
Fiber[:severity_letter]
|
29
|
-
#=> nil
|
30
|
-
|
31
|
-
## trace method accepts progname parameter
|
32
|
-
output = StringIO.new
|
33
|
-
logger = TestLoggerWithTrace.new(output)
|
34
|
-
logger.trace('MyApp') { 'Test message' }
|
35
|
-
output.string
|
36
|
-
#=~> /MyApp/
|
37
|
-
#=~> /Test message/
|
38
|
-
|
39
|
-
## trace method accepts block for message
|
40
|
-
output = StringIO.new
|
41
|
-
logger = TestLoggerWithTrace.new(output)
|
42
|
-
logger.trace { 'Block message' }
|
43
|
-
output.string
|
44
|
-
#=~> /Block message/
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|