lutaml-model 0.3.9 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +43 -25
- data/Gemfile +1 -0
- data/LICENSE.md +33 -0
- data/README.adoc +384 -18
- data/lib/lutaml/model/attribute.rb +130 -5
- data/lib/lutaml/model/error/collection_count_out_of_range_error.rb +29 -0
- data/lib/lutaml/model/error/incorrect_mapping_argument_error.rb +6 -0
- data/lib/lutaml/model/error/type_not_enabled_error.rb +9 -0
- data/lib/lutaml/model/error/validation_error.rb +21 -0
- data/lib/lutaml/model/error.rb +4 -0
- data/lib/lutaml/model/json_adapter/standard_json_adapter.rb +1 -2
- data/lib/lutaml/model/key_value_mapping.rb +15 -1
- data/lib/lutaml/model/mapping_hash.rb +14 -0
- data/lib/lutaml/model/mapping_rule.rb +30 -6
- data/lib/lutaml/model/schema_location.rb +59 -0
- data/lib/lutaml/model/serialize.rb +135 -86
- data/lib/lutaml/model/type.rb +8 -0
- data/lib/lutaml/model/utils.rb +16 -0
- data/lib/lutaml/model/validation.rb +24 -0
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/model/xml_adapter/builder/nokogiri.rb +12 -2
- data/lib/lutaml/model/xml_adapter/builder/ox.rb +4 -0
- data/lib/lutaml/model/xml_adapter/nokogiri_adapter.rb +2 -1
- data/lib/lutaml/model/xml_adapter/ox_adapter.rb +1 -0
- data/lib/lutaml/model/xml_adapter/xml_document.rb +60 -30
- data/lib/lutaml/model/xml_adapter/xml_namespace.rb +1 -1
- data/lib/lutaml/model/xml_mapping.rb +27 -5
- data/lib/lutaml/model/xml_mapping_rule.rb +3 -1
- data/lib/lutaml/model/yaml_adapter/standard_yaml_adapter.rb +10 -5
- data/lutaml-model.gemspec +1 -1
- metadata +11 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91ff48fd66cf1435e5e18508b24cc24f7cc92dc8b5d1619c7796932eb21dcea2
|
4
|
+
data.tar.gz: 51eabdb2aede716ce86cea46325cad0b7b9f0da98df3235fc3b8596fe9f96bd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ce25727c43d1c25f97e49c529c9ded5f51d8f2c13ae2766dba8c94d2c1d9a7c646bad564bfb9cd4c5555ee71395f6ff39023268e9e92044f10985c20dd826ca
|
7
|
+
data.tar.gz: edf1d699e944a2427b947e1a262258e93623c44bc765a5f5497c13bd4d806984722ececd6318254c15196d435b2b809f44389a1be1d9cd5f33e005169b232eaf
|
data/.rubocop_todo.yml
CHANGED
@@ -1,27 +1,19 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2024-09-
|
3
|
+
# on 2024-09-23 15:00:23 UTC using RuboCop version 1.65.1.
|
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
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
10
|
-
# This cop supports safe autocorrection (--autocorrect).
|
11
|
-
# Configuration parameters: Severity, Include.
|
12
|
-
# Include: **/*.gemspec
|
13
|
-
Gemspec/RequireMFA:
|
14
|
-
Exclude:
|
15
|
-
- 'lutaml-model.gemspec'
|
16
|
-
|
17
|
-
# Offense count: 62
|
9
|
+
# Offense count: 100
|
18
10
|
# This cop supports safe autocorrection (--autocorrect).
|
19
11
|
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
20
12
|
# URISchemes: http, https
|
21
13
|
Layout/LineLength:
|
22
14
|
Enabled: false
|
23
15
|
|
24
|
-
# Offense count:
|
16
|
+
# Offense count: 11
|
25
17
|
# Configuration parameters: AllowedMethods.
|
26
18
|
# AllowedMethods: enums
|
27
19
|
Lint/ConstantDefinitionInBlock:
|
@@ -30,13 +22,21 @@ Lint/ConstantDefinitionInBlock:
|
|
30
22
|
- 'spec/lutaml/model/schema/relaxng_schema_spec.rb'
|
31
23
|
- 'spec/lutaml/model/schema/xsd_schema_spec.rb'
|
32
24
|
- 'spec/lutaml/model/schema/yaml_schema_spec.rb'
|
25
|
+
- 'spec/lutaml/model/validation_spec.rb'
|
33
26
|
- 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
|
34
27
|
|
35
|
-
# Offense count:
|
28
|
+
# Offense count: 1
|
29
|
+
Lint/DuplicateMethods:
|
30
|
+
Exclude:
|
31
|
+
- 'lib/lutaml/model/attribute.rb'
|
32
|
+
|
33
|
+
# Offense count: 34
|
36
34
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
37
35
|
Metrics/AbcSize:
|
38
36
|
Exclude:
|
37
|
+
- 'lib/lutaml/model/attribute.rb'
|
39
38
|
- 'lib/lutaml/model/comparable_model.rb'
|
39
|
+
- 'lib/lutaml/model/mapping_rule.rb'
|
40
40
|
- 'lib/lutaml/model/schema/relaxng_schema.rb'
|
41
41
|
- 'lib/lutaml/model/schema/xsd_schema.rb'
|
42
42
|
- 'lib/lutaml/model/serialize.rb'
|
@@ -45,13 +45,13 @@ Metrics/AbcSize:
|
|
45
45
|
- 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
|
46
46
|
- 'lib/lutaml/model/xml_adapter/xml_document.rb'
|
47
47
|
|
48
|
-
# Offense count:
|
48
|
+
# Offense count: 4
|
49
49
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
50
50
|
# AllowedMethods: refine
|
51
51
|
Metrics/BlockLength:
|
52
52
|
Max: 42
|
53
53
|
|
54
|
-
# Offense count:
|
54
|
+
# Offense count: 26
|
55
55
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
56
56
|
Metrics/CyclomaticComplexity:
|
57
57
|
Exclude:
|
@@ -63,17 +63,17 @@ Metrics/CyclomaticComplexity:
|
|
63
63
|
- 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
|
64
64
|
- 'lib/lutaml/model/xml_adapter/xml_document.rb'
|
65
65
|
|
66
|
-
# Offense count:
|
66
|
+
# Offense count: 45
|
67
67
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
68
68
|
Metrics/MethodLength:
|
69
|
-
Max:
|
69
|
+
Max: 51
|
70
70
|
|
71
71
|
# Offense count: 4
|
72
72
|
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
73
73
|
Metrics/ParameterLists:
|
74
|
-
Max:
|
74
|
+
Max: 10
|
75
75
|
|
76
|
-
# Offense count:
|
76
|
+
# Offense count: 22
|
77
77
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
78
78
|
Metrics/PerceivedComplexity:
|
79
79
|
Exclude:
|
@@ -94,10 +94,10 @@ RSpec/ContextWording:
|
|
94
94
|
- 'spec/lutaml/model/xml_adapter/ox_adapter_spec.rb'
|
95
95
|
- 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
|
96
96
|
|
97
|
-
# Offense count:
|
97
|
+
# Offense count: 105
|
98
98
|
# Configuration parameters: CountAsOne.
|
99
99
|
RSpec/ExampleLength:
|
100
|
-
Max:
|
100
|
+
Max: 54
|
101
101
|
|
102
102
|
# Offense count: 2
|
103
103
|
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
|
@@ -105,13 +105,14 @@ RSpec/IndexedLet:
|
|
105
105
|
Exclude:
|
106
106
|
- 'spec/address_spec.rb'
|
107
107
|
|
108
|
-
# Offense count:
|
108
|
+
# Offense count: 19
|
109
109
|
RSpec/LeakyConstantDeclaration:
|
110
110
|
Exclude:
|
111
111
|
- 'spec/lutaml/model/schema/json_schema_spec.rb'
|
112
112
|
- 'spec/lutaml/model/schema/relaxng_schema_spec.rb'
|
113
113
|
- 'spec/lutaml/model/schema/xsd_schema_spec.rb'
|
114
114
|
- 'spec/lutaml/model/schema/yaml_schema_spec.rb'
|
115
|
+
- 'spec/lutaml/model/validation_spec.rb'
|
115
116
|
- 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
|
116
117
|
|
117
118
|
# Offense count: 4
|
@@ -122,36 +123,53 @@ RSpec/MultipleDescribes:
|
|
122
123
|
- 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
|
123
124
|
- 'spec/lutaml/model/xml_adapter_spec.rb'
|
124
125
|
|
125
|
-
# Offense count:
|
126
|
+
# Offense count: 98
|
126
127
|
RSpec/MultipleExpectations:
|
127
|
-
Max:
|
128
|
+
Max: 14
|
128
129
|
|
129
|
-
# Offense count:
|
130
|
+
# Offense count: 18
|
130
131
|
# Configuration parameters: AllowSubject.
|
131
132
|
RSpec/MultipleMemoizedHelpers:
|
132
133
|
Max: 9
|
133
134
|
|
134
|
-
# Offense count:
|
135
|
+
# Offense count: 7
|
135
136
|
RSpec/PendingWithoutReason:
|
136
137
|
Exclude:
|
137
138
|
- 'spec/lutaml/model/mixed_content_spec.rb'
|
139
|
+
- 'spec/lutaml/model/validation_spec.rb'
|
138
140
|
- 'spec/lutaml/model/xml_adapter/oga_adapter_spec.rb'
|
139
141
|
- 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
|
140
142
|
- 'spec/lutaml/model/xml_adapter_spec.rb'
|
141
143
|
|
142
144
|
# Offense count: 1
|
145
|
+
RSpec/RemoveConst:
|
146
|
+
Exclude:
|
147
|
+
- 'spec/lutaml/model/type/decimal_spec.rb'
|
148
|
+
|
149
|
+
# Offense count: 2
|
150
|
+
RSpec/RepeatedExampleGroupDescription:
|
151
|
+
Exclude:
|
152
|
+
- 'spec/lutaml/model/collection_spec.rb'
|
153
|
+
|
154
|
+
# Offense count: 2
|
143
155
|
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
144
156
|
# Include: **/*_spec.rb
|
145
157
|
RSpec/SpecFilePathFormat:
|
146
158
|
Exclude:
|
147
159
|
- '**/spec/routing/**/*'
|
148
160
|
- 'spec/lutaml/model/collection_spec.rb'
|
161
|
+
- 'spec/lutaml/model/type/decimal_spec.rb'
|
149
162
|
|
150
163
|
# Offense count: 1
|
151
164
|
Security/CompoundHash:
|
152
165
|
Exclude:
|
153
166
|
- 'lib/lutaml/model/comparable_model.rb'
|
154
167
|
|
168
|
+
# Offense count: 1
|
169
|
+
Style/MissingRespondToMissing:
|
170
|
+
Exclude:
|
171
|
+
- 'lib/lutaml/model/serialize.rb'
|
172
|
+
|
155
173
|
# Offense count: 1
|
156
174
|
# Configuration parameters: AllowedMethods.
|
157
175
|
# AllowedMethods: respond_to_missing?
|
data/Gemfile
CHANGED
data/LICENSE.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
Licenses & Copyright
|
2
|
+
====================
|
3
|
+
|
4
|
+
This license file adheres to the formatting guidelines of
|
5
|
+
[readable-licenses](https://github.com/nevir/readable-licenses).
|
6
|
+
|
7
|
+
|
8
|
+
Ribose's BSD 2-Clause License
|
9
|
+
-----------------------------
|
10
|
+
|
11
|
+
Copyright (c) 2024, [Ribose Inc](https://www.ribose.com).
|
12
|
+
All rights reserved.
|
13
|
+
|
14
|
+
Redistribution and use in source and binary forms, with or without modification,
|
15
|
+
are permitted provided that the following conditions are met:
|
16
|
+
|
17
|
+
1. Redistributions of source code must retain the above copyright notice,
|
18
|
+
this list of conditions and the following disclaimer.
|
19
|
+
|
20
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
21
|
+
this list of conditions and the following disclaimer in the documentation
|
22
|
+
and/or other materials provided with the distribution.
|
23
|
+
|
24
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
25
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
26
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
27
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
28
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
29
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
30
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
31
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
32
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
33
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|