lutaml-model 0.2.1 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +7 -0
- data/.rubocop_todo.yml +207 -0
- data/Gemfile +6 -2
- data/README.adoc +1054 -126
- data/lib/lutaml/model/attribute.rb +4 -0
- data/lib/lutaml/model/error/invalid_value_error.rb +18 -0
- data/lib/lutaml/model/error.rb +8 -0
- data/lib/lutaml/model/key_value_mapping.rb +9 -1
- data/lib/lutaml/model/mapping_hash.rb +42 -0
- data/lib/lutaml/model/mapping_rule.rb +24 -2
- data/lib/lutaml/model/serialize.rb +270 -189
- data/lib/lutaml/model/toml_adapter/toml_rb_adapter.rb +2 -2
- data/lib/lutaml/model/type.rb +19 -13
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/model/xml_adapter/nokogiri_adapter.rb +104 -101
- data/lib/lutaml/model/xml_adapter/ox_adapter.rb +125 -85
- data/lib/lutaml/model/xml_adapter.rb +138 -7
- data/lib/lutaml/model/xml_mapping.rb +36 -6
- data/lib/lutaml/model/xml_mapping_rule.rb +6 -6
- data/lib/lutaml/model/yaml_adapter.rb +11 -3
- data/lib/lutaml/model.rb +7 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91bd7beffbcc68f12d2db941b64bb6c353598505f775e8b45b878070de028f89
|
4
|
+
data.tar.gz: 85462da21104e72066652ae84d7260d8675e6d3027cdb1d0c90e51476e88834f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ed73bf2c0ba1a646dbab5ea4f35171786e043f3bd593aec08ee1f07ec4dd3350b2839b93091df4fbf4bfd13ee6db31a22af31d7207b43691f4e530e72f0f303
|
7
|
+
data.tar.gz: c7b31f2cabd5aea847414bfaa0a7d53b48b2be43059c3501aeac41917844ef128e482072c87ab63a92930f1115e1f7cab22e23dd9e424a2c9d066a4221094f27
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,8 +1,15 @@
|
|
1
1
|
inherit_from:
|
2
2
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
3
|
+
- .rubocop_todo.yml
|
3
4
|
|
4
5
|
# local repo-specific modifications
|
5
6
|
# ...
|
7
|
+
#
|
8
|
+
require:
|
9
|
+
- rubocop-performance
|
10
|
+
- rubocop-rails
|
11
|
+
- rubocop-rake
|
12
|
+
- rubocop-rspec
|
6
13
|
|
7
14
|
AllCops:
|
8
15
|
TargetRubyVersion: 3.0
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2024-07-31 10:20:40 UTC using RuboCop version 1.64.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
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: 15
|
18
|
+
# This cop supports safe autocorrection (--autocorrect).
|
19
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
20
|
+
# URISchemes: http, https
|
21
|
+
Layout/LineLength:
|
22
|
+
Exclude:
|
23
|
+
- 'lib/lutaml/model/serialize.rb'
|
24
|
+
- 'lib/lutaml/model/type.rb'
|
25
|
+
- 'lib/lutaml/model/xml_adapter.rb'
|
26
|
+
- 'lib/lutaml/model/xml_adapter/nokogiri_adapter.rb'
|
27
|
+
- 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
|
28
|
+
- 'spec/lutaml/model/xml_namespace_spec.rb'
|
29
|
+
|
30
|
+
# Offense count: 20
|
31
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
32
|
+
Metrics/AbcSize:
|
33
|
+
Exclude:
|
34
|
+
- 'lib/lutaml/model/serialize.rb'
|
35
|
+
- 'lib/lutaml/model/type.rb'
|
36
|
+
- 'lib/lutaml/model/xml_adapter.rb'
|
37
|
+
- 'lib/lutaml/model/xml_adapter/nokogiri_adapter.rb'
|
38
|
+
- 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
|
39
|
+
|
40
|
+
# Offense count: 3
|
41
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
42
|
+
# AllowedMethods: refine
|
43
|
+
Metrics/BlockLength:
|
44
|
+
Max: 30
|
45
|
+
|
46
|
+
# Offense count: 17
|
47
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
48
|
+
Metrics/CyclomaticComplexity:
|
49
|
+
Exclude:
|
50
|
+
- 'lib/lutaml/model/serialize.rb'
|
51
|
+
- 'lib/lutaml/model/type.rb'
|
52
|
+
- 'lib/lutaml/model/xml_adapter.rb'
|
53
|
+
- 'lib/lutaml/model/xml_adapter/nokogiri_adapter.rb'
|
54
|
+
- 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
|
55
|
+
|
56
|
+
# Offense count: 24
|
57
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
58
|
+
Metrics/MethodLength:
|
59
|
+
Max: 42
|
60
|
+
|
61
|
+
# Offense count: 3
|
62
|
+
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
63
|
+
Metrics/ParameterLists:
|
64
|
+
Max: 9
|
65
|
+
|
66
|
+
# Offense count: 16
|
67
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
68
|
+
Metrics/PerceivedComplexity:
|
69
|
+
Exclude:
|
70
|
+
- 'lib/lutaml/model/serialize.rb'
|
71
|
+
- 'lib/lutaml/model/type.rb'
|
72
|
+
- 'lib/lutaml/model/xml_adapter.rb'
|
73
|
+
- 'lib/lutaml/model/xml_adapter/nokogiri_adapter.rb'
|
74
|
+
- 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
|
75
|
+
|
76
|
+
# Offense count: 2
|
77
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
78
|
+
RSpec/BeEq:
|
79
|
+
Exclude:
|
80
|
+
- 'spec/lutaml/model/collection_spec.rb'
|
81
|
+
- 'spec/lutaml/model/simple_model_spec.rb'
|
82
|
+
|
83
|
+
# Offense count: 1
|
84
|
+
# This cop supports safe autocorrection (--autocorrect).
|
85
|
+
# Configuration parameters: EnforcedStyle.
|
86
|
+
# SupportedStyles: be, be_nil
|
87
|
+
RSpec/BeNil:
|
88
|
+
Exclude:
|
89
|
+
- 'spec/lutaml/model_spec.rb'
|
90
|
+
|
91
|
+
# Offense count: 6
|
92
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
93
|
+
# Prefixes: when, with, without
|
94
|
+
RSpec/ContextWording:
|
95
|
+
Exclude:
|
96
|
+
- 'spec/lutaml/model/xml_adapter/nokogiri_adapter_spec.rb'
|
97
|
+
- 'spec/lutaml/model/xml_adapter/oga_adapter_spec.rb'
|
98
|
+
- 'spec/lutaml/model/xml_adapter/ox_adapter_spec.rb'
|
99
|
+
|
100
|
+
# Offense count: 18
|
101
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
102
|
+
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
|
103
|
+
# SupportedStyles: described_class, explicit
|
104
|
+
RSpec/DescribedClass:
|
105
|
+
Exclude:
|
106
|
+
- 'spec/address_spec.rb'
|
107
|
+
- 'spec/lutaml/model/custom_serialization_spec.rb'
|
108
|
+
- 'spec/lutaml/model/defaults_spec.rb'
|
109
|
+
- 'spec/lutaml/model/render_nil_spec.rb'
|
110
|
+
- 'spec/person_spec.rb'
|
111
|
+
|
112
|
+
# Offense count: 60
|
113
|
+
# Configuration parameters: CountAsOne.
|
114
|
+
RSpec/ExampleLength:
|
115
|
+
Max: 36
|
116
|
+
|
117
|
+
# Offense count: 2
|
118
|
+
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
|
119
|
+
RSpec/IndexedLet:
|
120
|
+
Exclude:
|
121
|
+
- 'spec/address_spec.rb'
|
122
|
+
|
123
|
+
# Offense count: 3
|
124
|
+
# This cop supports safe autocorrection (--autocorrect).
|
125
|
+
# Configuration parameters: AutoCorrect.
|
126
|
+
RSpec/LetBeforeExamples:
|
127
|
+
Exclude:
|
128
|
+
- 'spec/lutaml/model/defaults_spec.rb'
|
129
|
+
- 'spec/person_spec.rb'
|
130
|
+
|
131
|
+
# Offense count: 4
|
132
|
+
RSpec/MultipleDescribes:
|
133
|
+
Exclude:
|
134
|
+
- 'spec/lutaml/model/json_adapter_spec.rb'
|
135
|
+
- 'spec/lutaml/model/toml_adapter_spec.rb'
|
136
|
+
- 'spec/lutaml/model/xml_adapter_spec.rb'
|
137
|
+
- 'spec/lutaml/model/xml_namespace_spec.rb'
|
138
|
+
|
139
|
+
# Offense count: 54
|
140
|
+
RSpec/MultipleExpectations:
|
141
|
+
Max: 15
|
142
|
+
|
143
|
+
# Offense count: 1
|
144
|
+
# Configuration parameters: AllowSubject.
|
145
|
+
RSpec/MultipleMemoizedHelpers:
|
146
|
+
Max: 9
|
147
|
+
|
148
|
+
# Offense count: 3
|
149
|
+
RSpec/PendingWithoutReason:
|
150
|
+
Exclude:
|
151
|
+
- 'spec/lutaml/model/xml_adapter/oga_adapter_spec.rb'
|
152
|
+
- 'spec/lutaml/model/xml_adapter_spec.rb'
|
153
|
+
- 'spec/lutaml/model/xml_namespace_spec.rb'
|
154
|
+
|
155
|
+
# Offense count: 3
|
156
|
+
# This cop supports safe autocorrection (--autocorrect).
|
157
|
+
# Configuration parameters: AutoCorrect.
|
158
|
+
RSpec/ScatteredLet:
|
159
|
+
Exclude:
|
160
|
+
- 'spec/lutaml/model/defaults_spec.rb'
|
161
|
+
- 'spec/person_spec.rb'
|
162
|
+
|
163
|
+
# Offense count: 5
|
164
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
165
|
+
# Include: **/*_spec.rb
|
166
|
+
RSpec/SpecFilePathFormat:
|
167
|
+
Exclude:
|
168
|
+
- 'spec/lutaml/model/collection_spec.rb'
|
169
|
+
- 'spec/lutaml/model/xml_adapter/nokogiri_adapter_spec.rb'
|
170
|
+
- 'spec/lutaml/model/xml_adapter/oga_adapter_spec.rb'
|
171
|
+
- 'spec/lutaml/model/xml_adapter/ox_adapter_spec.rb'
|
172
|
+
- 'spec/lutaml/model/yaml_adapter_spec.rb'
|
173
|
+
|
174
|
+
# Offense count: 2
|
175
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
176
|
+
# Configuration parameters: Whitelist, AllowedMethods, AllowedReceivers.
|
177
|
+
# Whitelist: find_by_sql, find_by_token_for
|
178
|
+
# AllowedMethods: find_by_sql, find_by_token_for
|
179
|
+
# AllowedReceivers: Gem::Specification, page
|
180
|
+
Rails/DynamicFindBy:
|
181
|
+
Exclude:
|
182
|
+
- 'lib/lutaml/model/xml_adapter/nokogiri_adapter.rb'
|
183
|
+
- 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
|
184
|
+
|
185
|
+
# Offense count: 1
|
186
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
187
|
+
Rails/NegateInclude:
|
188
|
+
Exclude:
|
189
|
+
- 'lib/lutaml/model/serialize.rb'
|
190
|
+
|
191
|
+
# Offense count: 2
|
192
|
+
# This cop supports safe autocorrection (--autocorrect).
|
193
|
+
# Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank.
|
194
|
+
Rails/Present:
|
195
|
+
Exclude:
|
196
|
+
- 'lib/lutaml/model/serialize.rb'
|
197
|
+
- 'lib/lutaml/model/xml_namespace.rb'
|
198
|
+
|
199
|
+
# Offense count: 6
|
200
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
201
|
+
# Configuration parameters: EnforcedStyle.
|
202
|
+
# SupportedStyles: strict, flexible
|
203
|
+
Rails/TimeZone:
|
204
|
+
Exclude:
|
205
|
+
- 'lib/lutaml/model/type.rb'
|
206
|
+
- 'lib/lutaml/model/type/time_without_date.rb'
|
207
|
+
- 'spec/person_spec.rb'
|
data/Gemfile
CHANGED
@@ -23,9 +23,13 @@ gem "ox"
|
|
23
23
|
|
24
24
|
gem "pry"
|
25
25
|
|
26
|
-
gem "rubocop-performance"
|
26
|
+
gem "rubocop-performance", require: false
|
27
27
|
|
28
|
-
gem "rubocop-rails"
|
28
|
+
gem "rubocop-rails", require: false
|
29
|
+
|
30
|
+
gem "rubocop-rake", require: false
|
31
|
+
|
32
|
+
gem "rubocop-rspec", require: false
|
29
33
|
|
30
34
|
gem "tomlib"
|
31
35
|
|