lutaml-model 0.6.7 → 0.7.1

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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/dependent-repos-todo.json +7 -0
  3. data/.github/workflows/dependent-repos.json +17 -9
  4. data/.rubocop_todo.yml +18 -33
  5. data/README.adoc +4380 -2557
  6. data/lib/lutaml/model/attribute.rb +94 -15
  7. data/lib/lutaml/model/choice.rb +7 -0
  8. data/lib/lutaml/model/comparable_model.rb +48 -9
  9. data/lib/lutaml/model/error/collection_count_out_of_range_error.rb +1 -1
  10. data/lib/lutaml/model/error/polymorphic_error.rb +9 -0
  11. data/lib/lutaml/model/error.rb +1 -0
  12. data/lib/lutaml/model/mapping/json_mapping.rb +17 -0
  13. data/lib/lutaml/model/{key_value_mapping.rb → mapping/key_value_mapping.rb} +58 -14
  14. data/lib/lutaml/model/{key_value_mapping_rule.rb → mapping/key_value_mapping_rule.rb} +18 -2
  15. data/lib/lutaml/model/mapping/mapping_rule.rb +299 -0
  16. data/lib/lutaml/model/mapping/toml_mapping.rb +25 -0
  17. data/lib/lutaml/model/{xml_mapping.rb → mapping/xml_mapping.rb} +97 -15
  18. data/lib/lutaml/model/{xml_mapping_rule.rb → mapping/xml_mapping_rule.rb} +20 -3
  19. data/lib/lutaml/model/mapping/yaml_mapping.rb +17 -0
  20. data/lib/lutaml/model/mapping.rb +14 -0
  21. data/lib/lutaml/model/schema/xml_compiler.rb +15 -15
  22. data/lib/lutaml/model/sequence.rb +2 -2
  23. data/lib/lutaml/model/serialize.rb +247 -97
  24. data/lib/lutaml/model/type/date.rb +1 -1
  25. data/lib/lutaml/model/type/date_time.rb +2 -2
  26. data/lib/lutaml/model/type/hash.rb +1 -1
  27. data/lib/lutaml/model/type/time.rb +2 -2
  28. data/lib/lutaml/model/type/time_without_date.rb +2 -2
  29. data/lib/lutaml/model/uninitialized_class.rb +64 -0
  30. data/lib/lutaml/model/utils.rb +14 -0
  31. data/lib/lutaml/model/validation.rb +1 -0
  32. data/lib/lutaml/model/version.rb +1 -1
  33. data/lib/lutaml/model/xml_adapter/nokogiri_adapter.rb +1 -1
  34. data/lib/lutaml/model/xml_adapter/oga_adapter.rb +1 -1
  35. data/lib/lutaml/model/xml_adapter/ox_adapter.rb +1 -1
  36. data/lib/lutaml/model/xml_adapter/xml_document.rb +38 -17
  37. data/lib/lutaml/model/xml_adapter/xml_element.rb +17 -7
  38. data/lib/lutaml/model.rb +1 -0
  39. data/spec/benchmarks/xml_parsing_benchmark_spec.rb +3 -3
  40. data/spec/fixtures/person.rb +5 -5
  41. data/spec/lutaml/model/attribute_spec.rb +37 -1
  42. data/spec/lutaml/model/cdata_spec.rb +2 -2
  43. data/spec/lutaml/model/collection_spec.rb +50 -2
  44. data/spec/lutaml/model/comparable_model_spec.rb +92 -27
  45. data/spec/lutaml/model/defaults_spec.rb +1 -1
  46. data/spec/lutaml/model/enum_spec.rb +1 -1
  47. data/spec/lutaml/model/group_spec.rb +316 -14
  48. data/spec/lutaml/model/key_value_mapping_spec.rb +41 -3
  49. data/spec/lutaml/model/polymorphic_spec.rb +348 -0
  50. data/spec/lutaml/model/render_empty_spec.rb +194 -0
  51. data/spec/lutaml/model/render_nil_spec.rb +206 -22
  52. data/spec/lutaml/model/simple_model_spec.rb +9 -9
  53. data/spec/lutaml/model/value_map_spec.rb +240 -0
  54. data/spec/lutaml/model/xml/namespace/nested_with_explicit_namespace_spec.rb +85 -0
  55. data/spec/lutaml/model/xml/xml_element_spec.rb +93 -0
  56. data/spec/lutaml/model/xml_mapping_rule_spec.rb +102 -2
  57. data/spec/lutaml/model/xml_mapping_spec.rb +45 -3
  58. data/spec/sample_model_spec.rb +3 -3
  59. metadata +20 -8
  60. data/lib/lutaml/model/mapping_rule.rb +0 -109
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da09d917512e0b5f82b847627920cb874b9bf4506ef568d95b45dd26aefef054
4
- data.tar.gz: c31a188213089b94d752ba6e679ba8ac80f33c9f8e4f36f5bffddebf949b4a10
3
+ metadata.gz: cecafb59be2b3688099d64dac6ba5f3908062b4fc4ec378c122a4e2b614e8b98
4
+ data.tar.gz: 71695f79ad3b38145e775f5d64c2b9fd39f359d0503aecea53789f020f815e64
5
5
  SHA512:
6
- metadata.gz: 4b3f701841e4ac8d6b76f1afb7cccf1e2476200e9842ab1c5f3c664b4ec064f79831886963b0b7436ea16a8944158d7d50abe7a1e29b786e08486ad0fb2a0e10
7
- data.tar.gz: c2c4ddb8166ccde0274acc9f38ba36a2058de7b3fc61c88ab82cc8f29cbc046d43e6844da874367720d59b4c35553a9cb5adccbfd17429a1be52a8f623f96992
6
+ metadata.gz: 38cc6c40d4956f5056932d2fd72becb8ea488948639b197cff73a9b927762365a48e81822cd8408970725d7cadb998a2c7f5fca1c70ac61ec72948ba08aee499
7
+ data.tar.gz: '08b511a0d9543c3553e8d9a3b7cc669484ba03d7dac37dcd096ba2a9e44de1853a4a15744e710a8b3bbe883461716b8556ede6330a371cb9c82bf3a811b59fab'
@@ -0,0 +1,7 @@
1
+ {
2
+ "repo": [
3
+ "lutaml/ali",
4
+ "lutaml/oasis-etm",
5
+ "lutaml/reqif"
6
+ ]
7
+ }
@@ -1,17 +1,25 @@
1
1
  {
2
2
  "repo": [
3
+ "glossarist/glossarist-ruby",
4
+ "glossarist/iev",
5
+ "glossarist/termium",
3
6
  "lutaml/genericode",
7
+ "lutaml/lutaml-xsd",
8
+ "lutaml/metaschema",
4
9
  "lutaml/ogc-gml",
10
+ "lutaml/xmi",
11
+ "metanorma/atmospheric",
12
+ "metanorma/metanorma-cli",
5
13
  "metanorma/modspec-ruby",
6
- "metanorma/rfcxml",
7
14
  "metanorma/niso-jats",
15
+ "metanorma/revix",
16
+ "metanorma/rfcxml",
8
17
  "metanorma/sts-ruby",
9
- "lutaml/metaschema",
10
- "glossarist/termium",
11
- "glossarist/glossarist-ruby",
12
- "lutaml/oasis-etm",
13
- "lutaml/ali",
14
- "lutaml/reqif",
15
- "lutaml/lutaml-xsd"
18
+ "plurimath/mml",
19
+ "plurimath/plurimath",
20
+ "relaton/ieee-idams",
21
+ "relaton/loc_mods",
22
+ "relaton/w3c_api",
23
+ "unitsml/unitsml-ruby"
16
24
  ]
17
- }
25
+ }
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-02-21 13:26:38 UTC using RuboCop version 1.71.2.
3
+ # on 2025-03-19 06:02:51 UTC using RuboCop version 1.73.2.
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
@@ -27,7 +27,7 @@ Layout/IndentationWidth:
27
27
  Exclude:
28
28
  - 'lib/lutaml/model/schema/xml_compiler.rb'
29
29
 
30
- # Offense count: 468
30
+ # Offense count: 484
31
31
  # This cop supports safe autocorrection (--autocorrect).
32
32
  # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
33
33
  # URISchemes: http, https
@@ -42,14 +42,16 @@ Lint/ConstantDefinitionInBlock:
42
42
  - 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
43
43
  - 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
44
44
 
45
- # Offense count: 56
45
+ # Offense count: 58
46
46
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
47
47
  Metrics/AbcSize:
48
48
  Exclude:
49
49
  - 'lib/lutaml/model/attribute.rb'
50
50
  - 'lib/lutaml/model/comparable_model.rb'
51
- - 'lib/lutaml/model/key_value_mapping.rb'
52
- - 'lib/lutaml/model/mapping_rule.rb'
51
+ - 'lib/lutaml/model/mapping/key_value_mapping_rule.rb'
52
+ - 'lib/lutaml/model/mapping/mapping_rule.rb'
53
+ - 'lib/lutaml/model/mapping/xml_mapping.rb'
54
+ - 'lib/lutaml/model/mapping/xml_mapping_rule.rb'
53
55
  - 'lib/lutaml/model/schema/relaxng_schema.rb'
54
56
  - 'lib/lutaml/model/schema/xml_compiler.rb'
55
57
  - 'lib/lutaml/model/schema/xsd_schema.rb'
@@ -59,14 +61,12 @@ Metrics/AbcSize:
59
61
  - 'lib/lutaml/model/xml_adapter/oga_adapter.rb'
60
62
  - 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
61
63
  - 'lib/lutaml/model/xml_adapter/xml_document.rb'
62
- - 'lib/lutaml/model/xml_mapping.rb'
63
- - 'lib/lutaml/model/xml_mapping_rule.rb'
64
64
 
65
65
  # Offense count: 12
66
66
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
67
67
  # AllowedMethods: refine
68
68
  Metrics/BlockLength:
69
- Max: 46
69
+ Max: 47
70
70
 
71
71
  # Offense count: 47
72
72
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
@@ -74,8 +74,6 @@ Metrics/CyclomaticComplexity:
74
74
  Exclude:
75
75
  - 'lib/lutaml/model/attribute.rb'
76
76
  - 'lib/lutaml/model/comparable_model.rb'
77
- - 'lib/lutaml/model/key_value_mapping.rb'
78
- - 'lib/lutaml/model/mapping_rule.rb'
79
77
  - 'lib/lutaml/model/schema/xml_compiler.rb'
80
78
  - 'lib/lutaml/model/serialize.rb'
81
79
  - 'lib/lutaml/model/type/integer.rb'
@@ -85,24 +83,22 @@ Metrics/CyclomaticComplexity:
85
83
  - 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
86
84
  - 'lib/lutaml/model/xml_adapter/xml_document.rb'
87
85
 
88
- # Offense count: 86
86
+ # Offense count: 91
89
87
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
90
88
  Metrics/MethodLength:
91
- Max: 45
89
+ Max: 44
92
90
 
93
- # Offense count: 8
91
+ # Offense count: 9
94
92
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
95
93
  Metrics/ParameterLists:
96
- Max: 15
94
+ Max: 22
97
95
 
98
- # Offense count: 36
96
+ # Offense count: 38
99
97
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
100
98
  Metrics/PerceivedComplexity:
101
99
  Exclude:
102
100
  - 'lib/lutaml/model/attribute.rb'
103
101
  - 'lib/lutaml/model/comparable_model.rb'
104
- - 'lib/lutaml/model/key_value_mapping.rb'
105
- - 'lib/lutaml/model/mapping_rule.rb'
106
102
  - 'lib/lutaml/model/schema/xml_compiler.rb'
107
103
  - 'lib/lutaml/model/serialize.rb'
108
104
  - 'lib/lutaml/model/type/integer.rb'
@@ -130,7 +126,7 @@ RSpec/DescribeClass:
130
126
  - 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
131
127
  - 'spec/lutaml/model/transformation_spec.rb'
132
128
 
133
- # Offense count: 1
129
+ # Offense count: 2
134
130
  # This cop supports unsafe autocorrection (--autocorrect-all).
135
131
  # Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
136
132
  # SupportedStyles: described_class, explicit
@@ -138,7 +134,7 @@ RSpec/DescribedClass:
138
134
  Exclude:
139
135
  - 'spec/lutaml/model/xml_mapping_spec.rb'
140
136
 
141
- # Offense count: 157
137
+ # Offense count: 163
142
138
  # Configuration parameters: CountAsOne.
143
139
  RSpec/ExampleLength:
144
140
  Max: 54
@@ -149,16 +145,16 @@ RSpec/LeakyConstantDeclaration:
149
145
  - 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
150
146
  - 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
151
147
 
152
- # Offense count: 208
148
+ # Offense count: 210
153
149
  RSpec/MultipleExpectations:
154
150
  Max: 14
155
151
 
156
- # Offense count: 29
152
+ # Offense count: 30
157
153
  # Configuration parameters: AllowSubject.
158
154
  RSpec/MultipleMemoizedHelpers:
159
155
  Max: 9
160
156
 
161
- # Offense count: 109
157
+ # Offense count: 118
162
158
  # Configuration parameters: AllowedGroups.
163
159
  RSpec/NestedGroups:
164
160
  Max: 4
@@ -180,11 +176,6 @@ RSpec/SpecFilePathFormat:
180
176
  - 'spec/lutaml/model/defaults_spec.rb'
181
177
  - 'spec/lutaml/model/type/decimal_spec.rb'
182
178
 
183
- # Offense count: 1
184
- Security/CompoundHash:
185
- Exclude:
186
- - 'lib/lutaml/model/comparable_model.rb'
187
-
188
179
  # Offense count: 1
189
180
  # This cop supports unsafe autocorrection (--autocorrect-all).
190
181
  # Configuration parameters: AllowedReceivers.
@@ -211,9 +202,3 @@ Style/RedundantStringEscape:
211
202
  Exclude:
212
203
  - 'lib/lutaml/model/schema/templates/simple_type.rb'
213
204
  - 'lib/lutaml/model/schema/xml_compiler.rb'
214
-
215
- # Offense count: 1
216
- # Configuration parameters: Max.
217
- Style/SafeNavigationChainLength:
218
- Exclude:
219
- - 'lib/lutaml/model/serialize.rb'