dcm 0.2.0 → 0.2.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/lib/codinginfo.rb +7 -3
- data/lib/variant_filter.rb +2 -2
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c6e93c5660db6b81213e8a5d6b11f6820ef3527db0da59235cc901aa3446443
|
|
4
|
+
data.tar.gz: fbf56ef817dd13be0081ebe0a968592a4d7f56e4a5dc060a825a07d33fc0f44d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b428bb016af9dd88fbf99f9757cf84885b6c707999364060119cf90dd660ba9755570cf11416a51bd1fe424b02769672d18e84b4404eff581658ee5622abbb7
|
|
7
|
+
data.tar.gz: b75622a24abea2c40e4adcad0be32c1cf440bdf929957d2dc58ca5b6b8dd2a30aec98c4ce8aa443ac39180a25159391fdaefeda06108642c98de884d0099e869
|
data/lib/codinginfo.rb
CHANGED
|
@@ -34,6 +34,7 @@ class Codinginfo
|
|
|
34
34
|
.reject { |key, _| key.start_with?("CSIG_") }
|
|
35
35
|
.reject { |key, _| key.start_with?("CVAR_") }
|
|
36
36
|
.select { |_, val| val == 0 || val == 1 || val == "-" }
|
|
37
|
+
.transform_values { _1.to_i }
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
# Is the label coded for one of this variant's CVAR values? The package
|
|
@@ -182,7 +183,7 @@ class Codinginfo
|
|
|
182
183
|
def parse_headers!(headers, row)
|
|
183
184
|
return false unless row[1]&.match?(/SWFK-ID/)
|
|
184
185
|
return false unless row[1]&.match?(/CVAR_BeguData/)
|
|
185
|
-
return false unless row[2]&.match?(/
|
|
186
|
+
return false unless row[2]&.match?(/Homologations-I-Stufe/)
|
|
186
187
|
|
|
187
188
|
headers.replace(
|
|
188
189
|
row
|
|
@@ -192,8 +193,11 @@ class Codinginfo
|
|
|
192
193
|
.map { _1.sub(/\n.*/, "") }
|
|
193
194
|
.tap { _1[0] = :typestr }
|
|
194
195
|
.tap { _1[1] = :swfk_id } # SWFK-ID \nCVAR_BeguData"
|
|
195
|
-
.tap { _1[row.index {
|
|
196
|
-
.tap { _1[row.index {
|
|
196
|
+
.tap { _1[row.index { |c| c.match?("Homologations-I-Stufe") }] = :hom_istep }
|
|
197
|
+
.tap { _1[row.index { |c| c.match?("Kommentar") }] = :comment }
|
|
198
|
+
.tap { _1[row.index { |c| c.match?("Gruppe") }] = :group }
|
|
199
|
+
.tap { _1[row.index { |c| c.match?("Typschlüssel") }] = :typekey }
|
|
200
|
+
.tap { _1[row.index { |c| c.match?("Entwicklungsbaureihe") }] = :devkey }
|
|
197
201
|
)
|
|
198
202
|
true
|
|
199
203
|
end
|
data/lib/variant_filter.rb
CHANGED
|
@@ -15,8 +15,8 @@ module Dcm
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def match?(headers, row)
|
|
18
|
-
return false unless row[
|
|
19
|
-
return false unless row[
|
|
18
|
+
return false unless row[headers.index(:group)]
|
|
19
|
+
return false unless row[headers.index(:group)].match?(/CVAR/)
|
|
20
20
|
return false unless headers.include?(@key)
|
|
21
21
|
|
|
22
22
|
matchers.any? { row[headers.index(@key)].match?(_1) }
|
data/lib/version.rb
CHANGED