lutaml-model 0.7.1 → 0.7.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.yml +1 -1
- data/.rubocop_todo.yml +49 -48
- data/Gemfile +4 -1
- data/README.adoc +791 -143
- data/RELEASE_NOTES.adoc +346 -0
- data/docs/custom_adapters.adoc +144 -0
- data/lib/lutaml/model/attribute.rb +17 -11
- data/lib/lutaml/model/config.rb +48 -42
- data/lib/lutaml/model/error/polymorphic_error.rb +7 -2
- data/lib/lutaml/model/format_registry.rb +41 -0
- data/lib/lutaml/model/hash/document.rb +11 -0
- data/lib/lutaml/model/hash/mapping.rb +19 -0
- data/lib/lutaml/model/hash/mapping_rule.rb +9 -0
- data/lib/lutaml/model/hash/standard_adapter.rb +17 -0
- data/lib/lutaml/model/hash/transform.rb +8 -0
- data/lib/lutaml/model/hash.rb +21 -0
- data/lib/lutaml/model/json/document.rb +11 -0
- data/lib/lutaml/model/json/mapping.rb +19 -0
- data/lib/lutaml/model/json/mapping_rule.rb +9 -0
- data/lib/lutaml/model/{json_adapter → json}/multi_json_adapter.rb +4 -5
- data/lib/lutaml/model/{json_adapter/standard_json_adapter.rb → json/standard_adapter.rb} +5 -3
- data/lib/lutaml/model/json/transform.rb +8 -0
- data/lib/lutaml/model/json.rb +21 -0
- data/lib/lutaml/model/key_value_document.rb +27 -0
- data/lib/lutaml/model/mapping/key_value_mapping.rb +8 -4
- data/lib/lutaml/model/mapping/mapping.rb +13 -0
- data/lib/lutaml/model/mapping/mapping_rule.rb +7 -6
- data/lib/lutaml/model/serialization_adapter.rb +22 -0
- data/lib/lutaml/model/serialize.rb +146 -521
- data/lib/lutaml/model/services/logger.rb +54 -0
- data/lib/lutaml/model/services/transformer.rb +48 -0
- data/lib/lutaml/model/services.rb +2 -0
- data/lib/lutaml/model/toml/document.rb +11 -0
- data/lib/lutaml/model/toml/mapping.rb +27 -0
- data/lib/lutaml/model/toml/mapping_rule.rb +9 -0
- data/lib/lutaml/model/{toml_adapter → toml}/toml_rb_adapter.rb +3 -3
- data/lib/lutaml/model/toml/tomlib_adapter.rb +19 -0
- data/lib/lutaml/model/toml/transform.rb +8 -0
- data/lib/lutaml/model/toml.rb +30 -0
- data/lib/lutaml/model/transform/key_value_transform.rb +291 -0
- data/lib/lutaml/model/transform/xml_transform.rb +239 -0
- data/lib/lutaml/model/transform.rb +78 -0
- data/lib/lutaml/model/type/value.rb +6 -9
- data/lib/lutaml/model/uninitialized_class.rb +1 -1
- data/lib/lutaml/model/utils.rb +30 -0
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/model/{xml_adapter → xml}/builder/nokogiri.rb +2 -2
- data/lib/lutaml/model/{xml_adapter → xml}/builder/oga.rb +10 -10
- data/lib/lutaml/model/{xml_adapter → xml}/builder/ox.rb +1 -1
- data/lib/lutaml/model/{xml_adapter/xml_document.rb → xml/document.rb} +6 -7
- data/lib/lutaml/model/xml/element.rb +32 -0
- data/lib/lutaml/model/xml/mapping.rb +410 -0
- data/lib/lutaml/model/xml/mapping_rule.rb +141 -0
- data/lib/lutaml/model/xml/nokogiri_adapter.rb +232 -0
- data/lib/lutaml/model/{xml_adapter → xml}/oga/document.rb +1 -1
- data/lib/lutaml/model/{xml_adapter → xml}/oga/element.rb +3 -1
- data/lib/lutaml/model/xml/oga_adapter.rb +171 -0
- data/lib/lutaml/model/xml/ox_adapter.rb +215 -0
- data/lib/lutaml/model/xml/transform.rb +8 -0
- data/lib/lutaml/model/{xml_adapter → xml}/xml_attribute.rb +1 -1
- data/lib/lutaml/model/{xml_adapter → xml}/xml_element.rb +6 -3
- data/lib/lutaml/model/{xml_adapter → xml}/xml_namespace.rb +1 -1
- data/lib/lutaml/model/xml.rb +31 -0
- data/lib/lutaml/model/xml_adapter/element.rb +11 -25
- data/lib/lutaml/model/xml_adapter/nokogiri_adapter.rb +6 -223
- data/lib/lutaml/model/xml_adapter/oga_adapter.rb +13 -163
- data/lib/lutaml/model/xml_adapter/ox_adapter.rb +10 -207
- data/lib/lutaml/model/yaml/document.rb +10 -0
- data/lib/lutaml/model/yaml/mapping.rb +19 -0
- data/lib/lutaml/model/yaml/mapping_rule.rb +9 -0
- data/lib/lutaml/model/{yaml_adapter/standard_yaml_adapter.rb → yaml/standard_adapter.rb} +4 -3
- data/lib/lutaml/model/yaml/transform.rb +8 -0
- data/lib/lutaml/model/yaml.rb +21 -0
- data/lib/lutaml/model.rb +39 -4
- data/lutaml-model.gemspec +0 -4
- data/spec/benchmarks/xml_parsing_benchmark_spec.rb +4 -4
- data/spec/lutaml/model/cdata_spec.rb +7 -7
- data/spec/lutaml/model/custom_bibtex_adapter_spec.rb +598 -0
- data/spec/lutaml/model/custom_vobject_adapter_spec.rb +1226 -0
- data/spec/lutaml/model/group_spec.rb +18 -7
- data/spec/lutaml/model/hash/adapter_spec.rb +255 -0
- data/spec/lutaml/model/json_adapter_spec.rb +6 -6
- data/spec/lutaml/model/key_value_mapping_spec.rb +25 -1
- data/spec/lutaml/model/mixed_content_spec.rb +24 -24
- data/spec/lutaml/model/multiple_mapping_spec.rb +5 -5
- data/spec/lutaml/model/ordered_content_spec.rb +6 -6
- data/spec/lutaml/model/polymorphic_spec.rb +178 -0
- data/spec/lutaml/model/root_mappings_spec.rb +3 -3
- data/spec/lutaml/model/schema/xml_compiler_spec.rb +6 -6
- data/spec/lutaml/model/serializable_spec.rb +179 -103
- data/spec/lutaml/model/toml_adapter_spec.rb +6 -6
- data/spec/lutaml/model/toml_spec.rb +51 -0
- data/spec/lutaml/model/transformation_spec.rb +72 -15
- data/spec/lutaml/model/uninitialized_class_spec.rb +96 -0
- data/spec/lutaml/model/xml/namespace_spec.rb +57 -0
- data/spec/lutaml/model/xml/xml_element_spec.rb +1 -1
- data/spec/lutaml/model/xml_adapter/nokogiri_adapter_spec.rb +2 -2
- data/spec/lutaml/model/xml_adapter/oga_adapter_spec.rb +2 -2
- data/spec/lutaml/model/xml_adapter/ox_adapter_spec.rb +2 -2
- data/spec/lutaml/model/xml_adapter/xml_namespace_spec.rb +6 -6
- data/spec/lutaml/model/xml_adapter_spec.rb +6 -6
- data/spec/lutaml/model/xml_mapping_rule_spec.rb +3 -3
- data/spec/lutaml/model/xml_mapping_spec.rb +26 -14
- data/spec/lutaml/model/xml_spec.rb +63 -0
- data/spec/lutaml/model/yaml_adapter_spec.rb +3 -5
- data/spec/spec_helper.rb +3 -3
- metadata +64 -59
- data/lib/lutaml/model/json_adapter/json_document.rb +0 -20
- data/lib/lutaml/model/json_adapter/json_object.rb +0 -28
- data/lib/lutaml/model/loggable.rb +0 -15
- data/lib/lutaml/model/mapping/json_mapping.rb +0 -17
- data/lib/lutaml/model/mapping/toml_mapping.rb +0 -25
- data/lib/lutaml/model/mapping/xml_mapping.rb +0 -389
- data/lib/lutaml/model/mapping/xml_mapping_rule.rb +0 -139
- data/lib/lutaml/model/mapping/yaml_mapping.rb +0 -17
- data/lib/lutaml/model/mapping.rb +0 -14
- data/lib/lutaml/model/toml_adapter/toml_document.rb +0 -20
- data/lib/lutaml/model/toml_adapter/toml_object.rb +0 -28
- data/lib/lutaml/model/toml_adapter/tomlib_adapter.rb +0 -20
- data/lib/lutaml/model/toml_adapter.rb +0 -6
- data/lib/lutaml/model/yaml_adapter/yaml_document.rb +0 -20
- data/lib/lutaml/model/yaml_adapter/yaml_object.rb +0 -28
- data/lib/lutaml/model/yaml_adapter.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 234ef6d280e81a6527940901d3d94331e167f31e76cb561c3f545cc8648ce59c
|
4
|
+
data.tar.gz: d024bcf90be223bf51c10023332258bc7bfbc1c12262faf93f77bb2feab7e8b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3a708abec96f64e50126d5b09472ab967c4a70e8ac6e3b6445bf256d5d91d66ee9735bda98c065b94ff09c46ece7e8bfd51f19c13232369880f551858cffc36
|
7
|
+
data.tar.gz: 1cdb62a88e31bb3156c6446529686bb68f27476b32aaf20559b6f97c4188b90000ad8109a3ee9d02b04b8cc0f47b1d18cb474f022e6f511bf7bdd484206f4d46
|
data/.rubocop.yml
CHANGED
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-
|
3
|
+
# on 2025-04-08 13:11:39 UTC using RuboCop version 1.75.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:
|
30
|
+
# Offense count: 525
|
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,33 +42,18 @@ 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:
|
45
|
+
# Offense count: 60
|
46
46
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
47
47
|
Metrics/AbcSize:
|
48
|
-
|
49
|
-
- 'lib/lutaml/model/attribute.rb'
|
50
|
-
- 'lib/lutaml/model/comparable_model.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'
|
55
|
-
- 'lib/lutaml/model/schema/relaxng_schema.rb'
|
56
|
-
- 'lib/lutaml/model/schema/xml_compiler.rb'
|
57
|
-
- 'lib/lutaml/model/schema/xsd_schema.rb'
|
58
|
-
- 'lib/lutaml/model/serialize.rb'
|
59
|
-
- 'lib/lutaml/model/xml_adapter/nokogiri_adapter.rb'
|
60
|
-
- 'lib/lutaml/model/xml_adapter/oga/element.rb'
|
61
|
-
- 'lib/lutaml/model/xml_adapter/oga_adapter.rb'
|
62
|
-
- 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
|
63
|
-
- 'lib/lutaml/model/xml_adapter/xml_document.rb'
|
48
|
+
Enabled: false
|
64
49
|
|
65
|
-
# Offense count:
|
50
|
+
# Offense count: 9
|
66
51
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
67
52
|
# AllowedMethods: refine
|
68
53
|
Metrics/BlockLength:
|
69
|
-
Max:
|
54
|
+
Max: 35
|
70
55
|
|
71
|
-
# Offense count:
|
56
|
+
# Offense count: 43
|
72
57
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
73
58
|
Metrics/CyclomaticComplexity:
|
74
59
|
Exclude:
|
@@ -76,24 +61,25 @@ Metrics/CyclomaticComplexity:
|
|
76
61
|
- 'lib/lutaml/model/comparable_model.rb'
|
77
62
|
- 'lib/lutaml/model/schema/xml_compiler.rb'
|
78
63
|
- 'lib/lutaml/model/serialize.rb'
|
64
|
+
- 'lib/lutaml/model/transform/xml_transform.rb'
|
79
65
|
- 'lib/lutaml/model/type/integer.rb'
|
80
|
-
- 'lib/lutaml/model/
|
81
|
-
- 'lib/lutaml/model/
|
82
|
-
- 'lib/lutaml/model/
|
83
|
-
- 'lib/lutaml/model/
|
84
|
-
- 'lib/lutaml/model/
|
66
|
+
- 'lib/lutaml/model/xml/builder/oga.rb'
|
67
|
+
- 'lib/lutaml/model/xml/document.rb'
|
68
|
+
- 'lib/lutaml/model/xml/nokogiri_adapter.rb'
|
69
|
+
- 'lib/lutaml/model/xml/oga_adapter.rb'
|
70
|
+
- 'lib/lutaml/model/xml/ox_adapter.rb'
|
85
71
|
|
86
|
-
# Offense count:
|
72
|
+
# Offense count: 93
|
87
73
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
88
74
|
Metrics/MethodLength:
|
89
75
|
Max: 44
|
90
76
|
|
91
|
-
# Offense count:
|
77
|
+
# Offense count: 11
|
92
78
|
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
93
79
|
Metrics/ParameterLists:
|
94
80
|
Max: 22
|
95
81
|
|
96
|
-
# Offense count:
|
82
|
+
# Offense count: 33
|
97
83
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
98
84
|
Metrics/PerceivedComplexity:
|
99
85
|
Exclude:
|
@@ -101,20 +87,28 @@ Metrics/PerceivedComplexity:
|
|
101
87
|
- 'lib/lutaml/model/comparable_model.rb'
|
102
88
|
- 'lib/lutaml/model/schema/xml_compiler.rb'
|
103
89
|
- 'lib/lutaml/model/serialize.rb'
|
90
|
+
- 'lib/lutaml/model/transform/xml_transform.rb'
|
104
91
|
- 'lib/lutaml/model/type/integer.rb'
|
105
|
-
- 'lib/lutaml/model/
|
106
|
-
- 'lib/lutaml/model/
|
107
|
-
- 'lib/lutaml/model/
|
108
|
-
- 'lib/lutaml/model/
|
109
|
-
- 'lib/lutaml/model/
|
92
|
+
- 'lib/lutaml/model/xml/builder/oga.rb'
|
93
|
+
- 'lib/lutaml/model/xml/document.rb'
|
94
|
+
- 'lib/lutaml/model/xml/nokogiri_adapter.rb'
|
95
|
+
- 'lib/lutaml/model/xml/oga_adapter.rb'
|
96
|
+
- 'lib/lutaml/model/xml/ox_adapter.rb'
|
110
97
|
|
111
98
|
# Offense count: 1
|
112
|
-
#
|
113
|
-
Performance/
|
99
|
+
# Configuration parameters: MinSize.
|
100
|
+
Performance/CollectionLiteralInLoop:
|
114
101
|
Exclude:
|
115
|
-
- '
|
102
|
+
- 'spec/lutaml/model/custom_bibtex_adapter_spec.rb'
|
116
103
|
|
117
104
|
# Offense count: 2
|
105
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
106
|
+
# Prefixes: when, with, without
|
107
|
+
RSpec/ContextWording:
|
108
|
+
Exclude:
|
109
|
+
- 'spec/lutaml/model/group_spec.rb'
|
110
|
+
|
111
|
+
# Offense count: 3
|
118
112
|
# Configuration parameters: IgnoredMetadata.
|
119
113
|
RSpec/DescribeClass:
|
120
114
|
Exclude:
|
@@ -124,6 +118,7 @@ RSpec/DescribeClass:
|
|
124
118
|
- '**/spec/system/**/*'
|
125
119
|
- '**/spec/views/**/*'
|
126
120
|
- 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
|
121
|
+
- 'spec/lutaml/model/custom_bibtex_adapter_spec.rb'
|
127
122
|
- 'spec/lutaml/model/transformation_spec.rb'
|
128
123
|
|
129
124
|
# Offense count: 2
|
@@ -134,7 +129,7 @@ RSpec/DescribedClass:
|
|
134
129
|
Exclude:
|
135
130
|
- 'spec/lutaml/model/xml_mapping_spec.rb'
|
136
131
|
|
137
|
-
# Offense count:
|
132
|
+
# Offense count: 174
|
138
133
|
# Configuration parameters: CountAsOne.
|
139
134
|
RSpec/ExampleLength:
|
140
135
|
Max: 54
|
@@ -145,16 +140,16 @@ RSpec/LeakyConstantDeclaration:
|
|
145
140
|
- 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
|
146
141
|
- 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
|
147
142
|
|
148
|
-
# Offense count:
|
143
|
+
# Offense count: 251
|
149
144
|
RSpec/MultipleExpectations:
|
150
|
-
Max:
|
145
|
+
Max: 21
|
151
146
|
|
152
147
|
# Offense count: 30
|
153
148
|
# Configuration parameters: AllowSubject.
|
154
149
|
RSpec/MultipleMemoizedHelpers:
|
155
150
|
Max: 9
|
156
151
|
|
157
|
-
# Offense count:
|
152
|
+
# Offense count: 121
|
158
153
|
# Configuration parameters: AllowedGroups.
|
159
154
|
RSpec/NestedGroups:
|
160
155
|
Max: 4
|
@@ -166,7 +161,7 @@ RSpec/PendingWithoutReason:
|
|
166
161
|
- 'spec/lutaml/model/type/time_spec.rb'
|
167
162
|
- 'spec/lutaml/model/type/time_without_date_spec.rb'
|
168
163
|
|
169
|
-
# Offense count:
|
164
|
+
# Offense count: 8
|
170
165
|
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
171
166
|
# Include: **/*_spec.rb
|
172
167
|
RSpec/SpecFilePathFormat:
|
@@ -175,6 +170,17 @@ RSpec/SpecFilePathFormat:
|
|
175
170
|
- 'spec/lutaml/model/collection_spec.rb'
|
176
171
|
- 'spec/lutaml/model/defaults_spec.rb'
|
177
172
|
- 'spec/lutaml/model/type/decimal_spec.rb'
|
173
|
+
- 'spec/lutaml/model/xml_adapter/nokogiri_adapter_spec.rb'
|
174
|
+
- 'spec/lutaml/model/xml_adapter/oga_adapter_spec.rb'
|
175
|
+
- 'spec/lutaml/model/xml_adapter/ox_adapter_spec.rb'
|
176
|
+
- 'spec/lutaml/model/xml_mapping_rule_spec.rb'
|
177
|
+
- 'spec/lutaml/model/xml_mapping_spec.rb'
|
178
|
+
|
179
|
+
# Offense count: 1
|
180
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
181
|
+
Style/CommentedKeyword:
|
182
|
+
Exclude:
|
183
|
+
- 'spec/lutaml/model/custom_bibtex_adapter_spec.rb'
|
178
184
|
|
179
185
|
# Offense count: 1
|
180
186
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
@@ -184,11 +190,6 @@ Style/HashEachMethods:
|
|
184
190
|
Exclude:
|
185
191
|
- 'lib/lutaml/model/schema/xml_compiler.rb'
|
186
192
|
|
187
|
-
# Offense count: 1
|
188
|
-
Style/MissingRespondToMissing:
|
189
|
-
Exclude:
|
190
|
-
- 'lib/lutaml/model/serialize.rb'
|
191
|
-
|
192
193
|
# Offense count: 1
|
193
194
|
# Configuration parameters: AllowedMethods.
|
194
195
|
# AllowedMethods: respond_to_missing?
|
data/Gemfile
CHANGED
@@ -8,7 +8,10 @@ gemspec
|
|
8
8
|
gem "benchmark-ips"
|
9
9
|
gem "bigdecimal"
|
10
10
|
gem "equivalent-xml"
|
11
|
-
|
11
|
+
# TODO: remove once https://github.com/Shopify/liquid/issues/1772 is fixed
|
12
|
+
# needed for liquid with ruby 3.4
|
13
|
+
gem "base64"
|
14
|
+
gem "liquid", "~> 5"
|
12
15
|
gem "lutaml-xsd"
|
13
16
|
gem "multi_json"
|
14
17
|
gem "nokogiri"
|