genericode 0.1.1 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a658f75042c1064fc1032f885e266baeb816d38fd1f48324bdc791739abbd71e
4
- data.tar.gz: 7ebc14d95ed7538b3c3991baba75b78bd0661102e00e85625a7ef17f6d47ed1f
3
+ metadata.gz: 45525e09245553fcda6cb3606ec8f7b17c0fde0daf6507c41e47008d5e8dce43
4
+ data.tar.gz: 66c0b7b056d47c096d736176d9c575df8fba8c830f539d14e076b43a6f07cda8
5
5
  SHA512:
6
- metadata.gz: 304c01513d153bb25eed9cfc146a1502e2212404aa138574ded480e503142a1f2b11891e1ebddd08373780fef19d95133a2b97f969ef2501bb6bdb15b7aba3f8
7
- data.tar.gz: 5f801ef2ea74a25c30c1a189c9cf5d55d768f45cac0d223436d3e6bb0d2e26610f7c7c4efaf09ca604396e61c7192135532f75bfa2e6997b7fac321015163e0d
6
+ metadata.gz: d6dd2ebe439fde9ab7584ef67e149b3d79b026ae980b8beec200c5fd99a45e95c35b70663bfd8d27566095778394ce6a65ad2f4e7ff72b4706b7028c94ba55a5
7
+ data.tar.gz: 59951937dd0cd26496fe64e13f9ba70c12ed7d2757609ebfa10633e4d21a233fae230fc234b7da559f4bc12e1c121b029bec786af445f74d6fd5a703dcff83b0
data/.rubocop_todo.yml CHANGED
@@ -1,17 +1,32 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2024-08-27 09:46:41 UTC using RuboCop version 1.65.1.
3
+ # on 2025-01-11 09:46:54 UTC using RuboCop version 1.70.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
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 4
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
+ # Include: **/*.gemfile, **/Gemfile, **/gems.rb
13
+ Bundler/OrderedGems:
14
+ Exclude:
15
+ - 'Gemfile'
16
+
9
17
  # Offense count: 1
10
- # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
18
+ # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
11
19
  Lint/DuplicateBranch:
12
20
  Exclude:
13
21
  - 'lib/genericode/code_list.rb'
14
22
 
23
+ # Offense count: 1
24
+ # This cop supports safe autocorrection (--autocorrect).
25
+ # Configuration parameters: AutoCorrect, CheckForMethodsWithNoSideEffects.
26
+ Lint/Void:
27
+ Exclude:
28
+ - 'lib/genericode/code_list.rb'
29
+
15
30
  # Offense count: 8
16
31
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
17
32
  Metrics/AbcSize:
@@ -26,7 +41,7 @@ Metrics/BlockLength:
26
41
  # Offense count: 1
27
42
  # Configuration parameters: CountComments, CountAsOne.
28
43
  Metrics/ClassLength:
29
- Max: 220
44
+ Max: 216
30
45
 
31
46
  # Offense count: 5
32
47
  # Configuration parameters: AllowedMethods, AllowedPatterns.
@@ -45,7 +60,7 @@ Metrics/PerceivedComplexity:
45
60
 
46
61
  # Offense count: 2
47
62
  # This cop supports safe autocorrection (--autocorrect).
48
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
63
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
49
64
  # URISchemes: http, https
50
65
  Layout/LineLength:
51
66
  Max: 121
@@ -108,7 +108,7 @@ module Genericode
108
108
  result.value.to_h do |v|
109
109
  [column_set.column.find do |c|
110
110
  c.id == v.column_ref
111
- end.short_name.content, v.simple_value.content]
111
+ end.short_name.content, v.simple_value.content,]
112
112
  end
113
113
  end
114
114
  end
@@ -123,13 +123,13 @@ module Genericode
123
123
  # Rule 1: ColumnSet presence
124
124
  if column_set.nil? || column_set.column.empty?
125
125
  errors << { code: "MISSING_COLUMN_SET",
126
- message: "ColumnSet is missing or empty" }
126
+ message: "ColumnSet is missing or empty", }
127
127
  end
128
128
 
129
129
  # Rule 2: SimpleCodeList presence
130
130
  if simple_code_list.nil? || simple_code_list.row.empty?
131
131
  errors << { code: "MISSING_SIMPLE_CODE_LIST",
132
- message: "SimpleCodeList is missing or empty" }
132
+ message: "SimpleCodeList is missing or empty", }
133
133
  end
134
134
 
135
135
  # Rule 3: Unique column IDs
@@ -143,7 +143,7 @@ module Genericode
143
143
  row.value.each do |value|
144
144
  unless column_ids.include?(value.column_ref)
145
145
  errors << { code: "INVALID_COLUMN_REF",
146
- message: "Invalid ColumnRef '#{value.column_ref}' in row #{index + 1}" }
146
+ message: "Invalid ColumnRef '#{value.column_ref}' in row #{index + 1}", }
147
147
  end
148
148
  end
149
149
  end
@@ -165,7 +165,7 @@ module Genericode
165
165
  required_columns.each do |col|
166
166
  unless row.value.any? { |v| v.column_ref == col.id && v.simple_value&.content }
167
167
  errors << { code: "MISSING_REQUIRED_VALUE",
168
- message: "Missing value for required column '#{col.short_name&.content}' in row #{index + 1}" }
168
+ message: "Missing value for required column '#{col.short_name&.content}' in row #{index + 1}", }
169
169
  end
170
170
  end
171
171
  end
@@ -177,7 +177,7 @@ module Genericode
177
177
  value = row.value.find { |v| v.column_ref == col.id }&.simple_value&.content
178
178
  unless value_matches_type?(value, data_type)
179
179
  errors << { code: "INVALID_DATA_TYPE",
180
- message: "Invalid data type for column '#{col.short_name&.content}' in row #{index + 1}" }
180
+ message: "Invalid data type for column '#{col.short_name&.content}' in row #{index + 1}", }
181
181
  end
182
182
  end
183
183
  end
@@ -191,19 +191,19 @@ module Genericode
191
191
  column_set&.column&.each do |col|
192
192
  if col.data&.type && !valid_datatype_id?(col.data.type)
193
193
  errors << { code: "INVALID_DATATYPE_ID",
194
- message: "Invalid datatype ID for column '#{col.short_name&.content}'" }
194
+ message: "Invalid datatype ID for column '#{col.short_name&.content}'", }
195
195
  end
196
196
 
197
197
  # Rule 20 and 22: Complex data validation
198
198
  if col.data&.type == "*" && col.data&.datatype_library != "*"
199
199
  errors << { code: "INVALID_COMPLEX_DATA",
200
- message: "Invalid complex data configuration for column '#{col.short_name&.content}'" }
200
+ message: "Invalid complex data configuration for column '#{col.short_name&.content}'", }
201
201
  end
202
202
 
203
203
  # Rule 23: Language attribute validation
204
204
  if col.data&.lang && col.data_restrictions&.lang
205
205
  errors << { code: "DUPLICATE_LANG_ATTRIBUTE",
206
- message: "Duplicate lang attribute for column '#{col.short_name&.content}'" }
206
+ message: "Duplicate lang attribute for column '#{col.short_name&.content}'", }
207
207
  end
208
208
  end
209
209
 
@@ -218,7 +218,7 @@ module Genericode
218
218
  column_set&.column&.each do |col|
219
219
  if col.short_name&.content&.match?(/\s/)
220
220
  errors << { code: "INVALID_SHORT_NAME",
221
- message: "ShortName '#{col.short_name&.content}' contains whitespace" }
221
+ message: "ShortName '#{col.short_name&.content}' contains whitespace", }
222
222
  end
223
223
  end
224
224
 
@@ -229,7 +229,7 @@ module Genericode
229
229
 
230
230
  unless valid_complex_value?(value.complex_value, column_set&.column&.find { |c| c.id == value.column_ref })
231
231
  errors << { code: "INVALID_COMPLEX_VALUE",
232
- message: "Invalid ComplexValue in row #{index + 1}, column '#{value.column_ref}'" }
232
+ message: "Invalid ComplexValue in row #{index + 1}, column '#{value.column_ref}'", }
233
233
  end
234
234
  end
235
235
  end
@@ -9,7 +9,7 @@ require_relative "column_ref"
9
9
 
10
10
  module Genericode
11
11
  class Value < Lutaml::Model::Serializable
12
- attribute :column_ref, ColumnRef
12
+ attribute :column_ref, :string
13
13
  attribute :annotation, Annotation
14
14
  attribute :simple_value, SimpleValue
15
15
  attribute :complex_value, AnyOtherContent
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Genericode
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genericode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-07 00:00:00.000000000 Z
11
+ date: 2025-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: csv
@@ -66,90 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: nokogiri
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: rspec
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop-performance
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: xml-c14n
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
69
  description: Parser and generator for OASIS Genericode
154
70
  email:
155
71
  - open.source@ribose.com'
@@ -213,7 +129,7 @@ metadata:
213
129
  homepage_uri: https://github.com/lutaml/genericode
214
130
  source_code_uri: https://github.com/lutaml/genericode
215
131
  changelog_uri: https://github.com/lutaml/genericode/releases
216
- post_install_message:
132
+ post_install_message:
217
133
  rdoc_options: []
218
134
  require_paths:
219
135
  - lib
@@ -229,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
145
  version: '0'
230
146
  requirements: []
231
147
  rubygems_version: 3.3.27
232
- signing_key:
148
+ signing_key:
233
149
  specification_version: 4
234
150
  summary: Parser and generator for OASIS Genericode
235
151
  test_files: []