lutaml-store 0.2.0 → 0.2.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/.rubocop_todo.yml +13 -177
- data/CLAUDE.md +22 -9
- data/README.adoc +326 -1103
- data/lib/lutaml/store/adapter/base.rb +4 -0
- data/lib/lutaml/store/adapter/memory.rb +8 -0
- data/lib/lutaml/store/adapter.rb +17 -0
- data/lib/lutaml/store/basic_store.rb +1 -10
- data/lib/lutaml/store/cache_store.rb +11 -16
- data/lib/lutaml/store/database_store.rb +19 -9
- data/lib/lutaml/store/format/base.rb +4 -0
- data/lib/lutaml/store/format/marshal_format.rb +4 -0
- data/lib/lutaml/store/format/xml.rb +37 -0
- data/lib/lutaml/store/format/yamls.rb +1 -1
- data/lib/lutaml/store/format.rb +22 -1
- data/lib/lutaml/store/format_serializer.rb +44 -0
- data/lib/lutaml/store/http_cache.rb +3 -13
- data/lib/lutaml/store/model_registration.rb +5 -2
- data/lib/lutaml/store/model_registry.rb +22 -20
- data/lib/lutaml/store/package_store.rb +2 -18
- data/lib/lutaml/store/package_transport/base.rb +60 -0
- data/lib/lutaml/store/package_transport/directory_transport.rb +196 -0
- data/lib/lutaml/store/package_transport/zip_transport.rb +183 -0
- data/lib/lutaml/store/package_transport.rb +11 -438
- data/lib/lutaml/store/storage_key.rb +1 -1
- data/lib/lutaml/store/version.rb +1 -1
- data/lib/lutaml/store.rb +1 -0
- metadata +14 -77
- data/.github/workflows/main.yml +0 -27
- data/.gitignore +0 -12
- data/CORRECTED_HTTP_CACHE_IMPLEMENTATION.md +0 -209
- data/CORRECTED_HTTP_CACHE_PLAN.md +0 -164
- data/Gemfile +0 -15
- data/Gemfile.lock +0 -227
- data/TODO.impl/0-lutaml-store-self-quality.md +0 -112
- data/TODO.impl/1-lutaml-hal-migration.md +0 -96
- data/TODO.impl/2-glossarist-migration.md +0 -359
- data/TODO.impl/3-lutaml-jsonschema-migration.md +0 -273
- data/bin/console +0 -11
- data/bin/setup +0 -8
- data/demo/Gemfile +0 -15
- data/demo/Gemfile.lock +0 -61
- data/demo/README.adoc +0 -301
- data/demo/data/vcards/co/contact_10_thompson.data +0 -1
- data/demo/data/vcards/co/contact_10_thompson.meta +0 -1
- data/demo/data/vcards/co/contact_1_doe.data +0 -1
- data/demo/data/vcards/co/contact_1_doe.meta +0 -1
- data/demo/data/vcards/co/contact_2_smith.data +0 -1
- data/demo/data/vcards/co/contact_2_smith.meta +0 -1
- data/demo/data/vcards/co/contact_3_johnson.data +0 -1
- data/demo/data/vcards/co/contact_3_johnson.meta +0 -1
- data/demo/data/vcards/co/contact_4_garcia.data +0 -1
- data/demo/data/vcards/co/contact_4_garcia.meta +0 -1
- data/demo/data/vcards/co/contact_5_wilson.data +0 -1
- data/demo/data/vcards/co/contact_5_wilson.meta +0 -1
- data/demo/data/vcards/co/contact_6_brown.data +0 -1
- data/demo/data/vcards/co/contact_6_brown.meta +0 -1
- data/demo/data/vcards/co/contact_7_davis.data +0 -1
- data/demo/data/vcards/co/contact_7_davis.meta +0 -1
- data/demo/data/vcards/co/contact_8_anderson.data +0 -1
- data/demo/data/vcards/co/contact_8_anderson.meta +0 -1
- data/demo/data/vcards/co/contact_9_taylor.data +0 -1
- data/demo/data/vcards/co/contact_9_taylor.meta +0 -1
- data/demo/data/vcards.db +0 -0
- data/demo/pottery_class_demo.rb +0 -164
- data/demo/vcard_models.rb +0 -140
- data/demo/vcard_store_demo.rb +0 -526
- data/lutaml-store.gemspec +0 -36
- data/plan.adoc +0 -606
- data/spec/lutaml/store/adapter_interface_spec.rb +0 -89
- data/spec/lutaml/store/anti_pattern_guard_spec.rb +0 -35
- data/spec/lutaml/store/anti_pattern_spec.rb +0 -78
- data/spec/lutaml/store/autoload_spec.rb +0 -34
- data/spec/lutaml/store/cache_store_spec.rb +0 -271
- data/spec/lutaml/store/compression_spec.rb +0 -78
- data/spec/lutaml/store/config_enhanced_spec.rb +0 -158
- data/spec/lutaml/store/corrected_http_cache_integration_spec.rb +0 -336
- data/spec/lutaml/store/custom_serializer_spec.rb +0 -108
- data/spec/lutaml/store/database_store_spec.rb +0 -279
- data/spec/lutaml/store/file_io_spec.rb +0 -220
- data/spec/lutaml/store/format/yamls_spec.rb +0 -80
- data/spec/lutaml/store/format_round_trip_spec.rb +0 -110
- data/spec/lutaml/store/format_spec.rb +0 -70
- data/spec/lutaml/store/http_cache_entry_spec.rb +0 -203
- data/spec/lutaml/store/http_cache_hal_integration_spec.rb +0 -404
- data/spec/lutaml/store/http_cache_spec.rb +0 -422
- data/spec/lutaml/store/http_header_processor_spec.rb +0 -290
- data/spec/lutaml/store/import_spec.rb +0 -90
- data/spec/lutaml/store/integrity_spec.rb +0 -157
- data/spec/lutaml/store/key_collision_serializer_spec.rb +0 -98
- data/spec/lutaml/store/load_save_spec.rb +0 -107
- data/spec/lutaml/store/lutaml_model_integration_spec.rb +0 -291
- data/spec/lutaml/store/model_serializer_spec.rb +0 -140
- data/spec/lutaml/store/package_definition_spec.rb +0 -89
- data/spec/lutaml/store/package_store_spec.rb +0 -153
- data/spec/lutaml/store/package_transport/directory_transport_spec.rb +0 -139
- data/spec/lutaml/store/package_transport/zip_transport_spec.rb +0 -85
- data/spec/lutaml/store/store_spec.rb +0 -182
- data/spec/lutaml/store_spec.rb +0 -21
- data/spec/spec_helper.rb +0 -16
- data/spec/support/simple_test_model.rb +0 -15
- data/spec/support/yamls_test_model.rb +0 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4917f68f56456a19670424157dd5001d243b9bd6d97618f445d306a7998e2a9f
|
|
4
|
+
data.tar.gz: 7076d765cf18cc91bfa9cf252bb0117ea8870c915bf1e7421648d9490de7e6a5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 897f40bf4972373587528a80afcc44ab2b0c159f2bba63a97f39cb997eff97d3633d7e34cabeb0dac37e1b337781f0aef60b9ffaae2b3a3426d5624b35fb7950
|
|
7
|
+
data.tar.gz: 1b79b56672ace97f0b6e57715b1b56b7f4638b1d426db57b8f57c5ed21eb461a7fd2ff4181f57afaa094d85c9b7da37f9e3d4771c04afecfcef0c268e86ddcd7
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2026-06-
|
|
3
|
+
# on 2026-06-05 09:38:49 UTC using RuboCop version 1.87.0.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -11,131 +11,54 @@ Gemspec/RequiredRubyVersion:
|
|
|
11
11
|
Exclude:
|
|
12
12
|
- 'lutaml-store.gemspec'
|
|
13
13
|
|
|
14
|
-
# Offense count:
|
|
15
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
16
|
-
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
17
|
-
# SupportedStyles: with_first_argument, with_fixed_indentation
|
|
18
|
-
Layout/ArgumentAlignment:
|
|
19
|
-
Exclude:
|
|
20
|
-
- 'lib/lutaml/store/attribute_updater.rb'
|
|
21
|
-
- 'lib/lutaml/store/http_cache.rb'
|
|
22
|
-
- 'lib/lutaml/store/model_registry.rb'
|
|
23
|
-
- 'spec/lutaml/store/package_store_spec.rb'
|
|
24
|
-
- 'spec/lutaml/store/package_transport/directory_transport_spec.rb'
|
|
25
|
-
- 'spec/lutaml/store/package_transport/zip_transport_spec.rb'
|
|
26
|
-
|
|
27
|
-
# Offense count: 8
|
|
28
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
29
|
-
Layout/EmptyLineAfterGuardClause:
|
|
30
|
-
Exclude:
|
|
31
|
-
- 'lib/lutaml/store/package_transport.rb'
|
|
32
|
-
|
|
33
|
-
# Offense count: 1
|
|
34
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
35
|
-
Layout/EmptyLines:
|
|
36
|
-
Exclude:
|
|
37
|
-
- 'lib/lutaml/store/package_store.rb'
|
|
38
|
-
|
|
39
|
-
# Offense count: 3
|
|
40
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
41
|
-
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
|
|
42
|
-
Layout/ExtraSpacing:
|
|
43
|
-
Exclude:
|
|
44
|
-
- 'lib/lutaml/store/package_store.rb'
|
|
45
|
-
- 'lib/lutaml/store/package_transport.rb'
|
|
46
|
-
|
|
47
|
-
# Offense count: 3
|
|
48
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
49
|
-
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
|
50
|
-
# SupportedHashRocketStyles: key, separator, table
|
|
51
|
-
# SupportedColonStyles: key, separator, table
|
|
52
|
-
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
|
53
|
-
Layout/HashAlignment:
|
|
54
|
-
Exclude:
|
|
55
|
-
- 'spec/lutaml/store/package_transport/directory_transport_spec.rb'
|
|
56
|
-
- 'spec/lutaml/store/package_transport/zip_transport_spec.rb'
|
|
57
|
-
|
|
58
|
-
# Offense count: 13
|
|
59
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
60
|
-
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
61
|
-
# SupportedStyles: aligned, indented, indented_relative_to_receiver
|
|
62
|
-
Layout/MultilineMethodCallIndentation:
|
|
63
|
-
Exclude:
|
|
64
|
-
- 'lib/lutaml/store/package_store.rb'
|
|
65
|
-
- 'lib/lutaml/store/package_transport.rb'
|
|
66
|
-
|
|
67
|
-
# Offense count: 3
|
|
68
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
69
|
-
# Configuration parameters: EnforcedStyleInsidePipes.
|
|
70
|
-
# SupportedStylesInsidePipes: space, no_space
|
|
71
|
-
Layout/SpaceAroundBlockParameters:
|
|
72
|
-
Exclude:
|
|
73
|
-
- 'lib/lutaml/store/package_store.rb'
|
|
74
|
-
- 'lib/lutaml/store/package_transport.rb'
|
|
75
|
-
|
|
76
|
-
# Offense count: 5
|
|
77
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
78
|
-
# Configuration parameters: AllowInHeredoc.
|
|
79
|
-
Layout/TrailingWhitespace:
|
|
80
|
-
Exclude:
|
|
81
|
-
- 'lib/lutaml/store/attribute_updater.rb'
|
|
82
|
-
- 'lib/lutaml/store/http_cache.rb'
|
|
83
|
-
- 'lib/lutaml/store/model_registry.rb'
|
|
84
|
-
|
|
85
|
-
# Offense count: 1
|
|
86
|
-
Lint/IneffectiveAccessModifier:
|
|
87
|
-
Exclude:
|
|
88
|
-
- 'lib/lutaml/store/package_store.rb'
|
|
89
|
-
|
|
90
|
-
# Offense count: 30
|
|
14
|
+
# Offense count: 29
|
|
91
15
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
92
16
|
Metrics/AbcSize:
|
|
93
17
|
Max: 112
|
|
94
18
|
|
|
95
|
-
# Offense count:
|
|
19
|
+
# Offense count: 57
|
|
96
20
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
97
21
|
# AllowedMethods: refine
|
|
98
22
|
Metrics/BlockLength:
|
|
99
|
-
Max:
|
|
23
|
+
Max: 387
|
|
100
24
|
|
|
101
|
-
# Offense count:
|
|
25
|
+
# Offense count: 16
|
|
102
26
|
# Configuration parameters: CountComments, CountAsOne.
|
|
103
27
|
Metrics/ClassLength:
|
|
104
28
|
Max: 379
|
|
105
29
|
|
|
106
|
-
# Offense count:
|
|
30
|
+
# Offense count: 9
|
|
107
31
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
108
32
|
Metrics/CyclomaticComplexity:
|
|
109
|
-
Max:
|
|
33
|
+
Max: 12
|
|
110
34
|
|
|
111
|
-
# Offense count:
|
|
35
|
+
# Offense count: 79
|
|
112
36
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
113
37
|
Metrics/MethodLength:
|
|
114
38
|
Max: 84
|
|
115
39
|
|
|
116
|
-
# Offense count:
|
|
40
|
+
# Offense count: 5
|
|
117
41
|
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
|
118
42
|
Metrics/ParameterLists:
|
|
119
43
|
Max: 8
|
|
120
44
|
|
|
121
|
-
# Offense count:
|
|
45
|
+
# Offense count: 4
|
|
122
46
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
123
47
|
Metrics/PerceivedComplexity:
|
|
124
|
-
Max:
|
|
48
|
+
Max: 12
|
|
125
49
|
|
|
126
50
|
# Offense count: 1
|
|
127
51
|
Naming/AccessorMethodName:
|
|
128
52
|
Exclude:
|
|
129
53
|
- 'lib/lutaml/store/adapter/sqlite.rb'
|
|
130
54
|
|
|
131
|
-
# Offense count:
|
|
55
|
+
# Offense count: 3
|
|
132
56
|
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
|
133
57
|
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
|
|
134
58
|
Naming/MethodParameterName:
|
|
135
59
|
Exclude:
|
|
136
60
|
- 'demo/vcard_models.rb'
|
|
137
61
|
- 'demo/vcard_store_demo.rb'
|
|
138
|
-
- 'lib/lutaml/store/package_transport.rb'
|
|
139
62
|
|
|
140
63
|
# Offense count: 1
|
|
141
64
|
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
|
|
@@ -161,94 +84,7 @@ Security/MarshalLoad:
|
|
|
161
84
|
Exclude:
|
|
162
85
|
- 'lib/lutaml/store/format/marshal_format.rb'
|
|
163
86
|
|
|
164
|
-
# Offense count:
|
|
165
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
166
|
-
# Configuration parameters: EnforcedStyle.
|
|
167
|
-
# SupportedStyles: separated, grouped
|
|
168
|
-
Style/AccessorGrouping:
|
|
169
|
-
Exclude:
|
|
170
|
-
- 'lib/lutaml/store/package_store.rb'
|
|
171
|
-
|
|
172
|
-
# Offense count: 2
|
|
173
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
174
|
-
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
|
|
175
|
-
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
|
|
176
|
-
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
|
177
|
-
# FunctionalMethods: let, let!, subject, watch
|
|
178
|
-
# AllowedMethods: lambda, proc, it
|
|
179
|
-
Style/BlockDelimiters:
|
|
180
|
-
Exclude:
|
|
181
|
-
- 'spec/lutaml/store/package_definition_spec.rb'
|
|
182
|
-
- 'spec/lutaml/store/package_transport/directory_transport_spec.rb'
|
|
183
|
-
|
|
184
|
-
# Offense count: 34
|
|
87
|
+
# Offense count: 36
|
|
185
88
|
# Configuration parameters: AllowedConstants.
|
|
186
89
|
Style/Documentation:
|
|
187
90
|
Enabled: false
|
|
188
|
-
|
|
189
|
-
# Offense count: 2
|
|
190
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
191
|
-
# Configuration parameters: AllowedReceivers.
|
|
192
|
-
# AllowedReceivers: Thread.current
|
|
193
|
-
Style/HashEachMethods:
|
|
194
|
-
Exclude:
|
|
195
|
-
- 'lib/lutaml/store/cache_store.rb'
|
|
196
|
-
- 'lib/lutaml/store/database_store.rb'
|
|
197
|
-
|
|
198
|
-
# Offense count: 1
|
|
199
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
200
|
-
Style/KeywordParametersOrder:
|
|
201
|
-
Exclude:
|
|
202
|
-
- 'lib/lutaml/store/package_definition.rb'
|
|
203
|
-
|
|
204
|
-
# Offense count: 5
|
|
205
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
206
|
-
Style/MultilineIfModifier:
|
|
207
|
-
Exclude:
|
|
208
|
-
- 'lib/lutaml/store/attribute_updater.rb'
|
|
209
|
-
- 'lib/lutaml/store/http_cache.rb'
|
|
210
|
-
- 'lib/lutaml/store/model_registry.rb'
|
|
211
|
-
|
|
212
|
-
# Offense count: 2
|
|
213
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
214
|
-
# Configuration parameters: SafeForConstants.
|
|
215
|
-
Style/RedundantFetchBlock:
|
|
216
|
-
Exclude:
|
|
217
|
-
- 'spec/lutaml/store/cache_store_spec.rb'
|
|
218
|
-
|
|
219
|
-
# Offense count: 1
|
|
220
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
221
|
-
Style/RedundantRegexpEscape:
|
|
222
|
-
Exclude:
|
|
223
|
-
- 'lib/lutaml/store/package_transport.rb'
|
|
224
|
-
|
|
225
|
-
# Offense count: 1
|
|
226
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
227
|
-
# Configuration parameters: EnforcedStyleForMultiline.
|
|
228
|
-
# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
|
|
229
|
-
Style/TrailingCommaInArrayLiteral:
|
|
230
|
-
Exclude:
|
|
231
|
-
- 'spec/lutaml/store/format/yamls_spec.rb'
|
|
232
|
-
|
|
233
|
-
# Offense count: 1
|
|
234
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
235
|
-
# Configuration parameters: EnforcedStyleForMultiline.
|
|
236
|
-
# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
|
|
237
|
-
Style/TrailingCommaInHashLiteral:
|
|
238
|
-
Exclude:
|
|
239
|
-
- 'lib/lutaml/store/package_store.rb'
|
|
240
|
-
|
|
241
|
-
# Offense count: 3
|
|
242
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
243
|
-
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods.
|
|
244
|
-
# AllowedMethods: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
|
|
245
|
-
Style/TrivialAccessors:
|
|
246
|
-
Exclude:
|
|
247
|
-
- 'lib/lutaml/store/package_store.rb'
|
|
248
|
-
|
|
249
|
-
# Offense count: 5
|
|
250
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
251
|
-
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
|
|
252
|
-
# URISchemes: http, https
|
|
253
|
-
Layout/LineLength:
|
|
254
|
-
Max: 148
|
data/CLAUDE.md
CHANGED
|
@@ -28,30 +28,43 @@ This is a Ruby gem (`lutaml-store`) providing a store-centric database-style API
|
|
|
28
28
|
|
|
29
29
|
| Class | Role |
|
|
30
30
|
|---|---|
|
|
31
|
-
| `DatabaseStore` | High-level CRUD with model registry, composite models, polymorphism |
|
|
31
|
+
| `DatabaseStore` | High-level CRUD with model registry, composite models, polymorphism, file I/O |
|
|
32
32
|
| `BasicStore` | Low-level key-value store with optional cache/monitor/events |
|
|
33
33
|
| `CacheStore` | TTL-aware cache store extending `BasicStore` |
|
|
34
|
+
| `PackageStore` | Structured multi-model packages with directory/ZIP transport |
|
|
35
|
+
| `PackageDefinition` | Declarative schema for package structure (models, assets, metadata) |
|
|
34
36
|
| `ModelRegistry` / `ModelRegistration` | Register models with their key fields and polymorphic config |
|
|
35
37
|
| `CompositeModelHandler` | Stores nested registered models independently, restores references |
|
|
36
38
|
| `AttributeUpdater` | Processes updates including dot-notation paths and block-based updates |
|
|
37
|
-
| `ModelSerializer` |
|
|
38
|
-
| `
|
|
39
|
+
| `ModelSerializer` | Hash-based serialization/deserialization for key-value storage |
|
|
40
|
+
| `FormatSerializer` | Bridges any Format handler to ModelSerializer interface for DatabaseStore |
|
|
41
|
+
| `Format` | Multi-format file I/O (YAML, YAMLS, JSON, JSONL, Marshal, XML) |
|
|
42
|
+
| `Adapter` | Storage adapter registry and factory (Memory, FileSystem, SQLite) |
|
|
43
|
+
|
|
44
|
+
### Format handlers (`lib/lutaml/store/format/`)
|
|
45
|
+
|
|
46
|
+
All inherit from `Format::Base`. Six formats: `Yaml`, `Yamls`, `Json`, `Jsonl`, `MarshalFormat`, `Xml`. Each implements `serialize`/`deserialize`, optional `serialize_many`/`deserialize_many`, `extension`, `glob_pattern`, and `binary?`. Registered in `Format::FORMATS` hash and resolved via `Format.resolve(:symbol)`.
|
|
39
47
|
|
|
40
48
|
### Storage adapters (`lib/lutaml/store/adapter/`)
|
|
41
49
|
|
|
42
|
-
All inherit from `Adapter::Base`. Three backends: `Memory`, `FileSystem`, `SQLite`.
|
|
50
|
+
All inherit from `Adapter::Base`. Three backends: `Memory`, `FileSystem`, `SQLite`. Registered in `Adapter` module and resolved via `Adapter.resolve(:type, options)`. New adapters can be added with `Adapter.register(:custom, CustomClass)` without modifying existing code (OCP).
|
|
43
51
|
|
|
44
|
-
###
|
|
52
|
+
### PackageStore and transports
|
|
45
53
|
|
|
46
|
-
`
|
|
54
|
+
`PackageStore` provides structured multi-model persistence. `PackageDefinition` declares which models, assets, and metadata the package contains. Transports (`DirectoryTransport`, `ZipTransport`) handle reading/writing to disk. Format handlers determine serialization per model entry.
|
|
47
55
|
|
|
48
|
-
###
|
|
56
|
+
### FormatSerializer pattern
|
|
57
|
+
|
|
58
|
+
`FormatSerializer` wraps a Format handler to implement the serializer interface (serialize/deserialize). This enables `DatabaseStore` to use any format (YAMLS, XML, Marshal, etc.) for key-value storage instead of the default hash serialization. Used for Glossarist-like YAMLS patterns.
|
|
59
|
+
|
|
60
|
+
### HTTP caching
|
|
49
61
|
|
|
50
|
-
`
|
|
62
|
+
`HttpCache` provides HTTP-aware caching with ETags, conditional requests (304), Cache-Control, and Vary header support. Uses `to_json`/`from_json` for model-driven serialization.
|
|
51
63
|
|
|
52
64
|
## Conventions
|
|
53
65
|
|
|
54
66
|
- Double-quoted strings (Rubocop enforced)
|
|
55
67
|
- Specs use `expect` syntax (no `should`)
|
|
56
|
-
- Documentation is in AsciiDoc (README.adoc
|
|
68
|
+
- Documentation is in AsciiDoc (README.adoc)
|
|
69
|
+
- All library code uses Ruby `autoload` (no `require_relative` or internal `require`)
|
|
57
70
|
- Error hierarchy: `Lutaml::Store::Error` → `ConfigurationError`, `BackendError`, `ModelNotRegisteredError`, `InvalidKeyError`, `PolymorphicUpdateError`, `CompositeModelError`
|