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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce740401dd91d79ca33c2bebbe85413a6e6837076dfe16af47fc57a4738d274a
4
- data.tar.gz: d64d1d496b9d07b8b0930786e4f73e3185db39f4c29eaad2188a6e6fcd72128e
3
+ metadata.gz: 2c6e93c5660db6b81213e8a5d6b11f6820ef3527db0da59235cc901aa3446443
4
+ data.tar.gz: fbf56ef817dd13be0081ebe0a968592a4d7f56e4a5dc060a825a07d33fc0f44d
5
5
  SHA512:
6
- metadata.gz: 4922613f24bef520545a0bf31cec9bafc6b66b7daba6b75ac8bd25c9eb4f3178688e1450286c5fd8fa91f84a60a82ea98b87a1132f7cfaaf7ad5e764b7d10a6c
7
- data.tar.gz: 58cf0b399ad28e219d8e85454b3dcc82428451b1481d41057fe301ff2f9f13428b168f989e2f53ba0e118097d732bf5172e2ade63d91d86d80204e125e6b4dd9
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?(/Kommentar/)
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 { it.match?("Typschlüssel") }] = :typekey }
196
- .tap { _1[row.index { it.match?("Entwicklungsbaureihe") }] = :devkey }
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
@@ -15,8 +15,8 @@ module Dcm
15
15
  end
16
16
 
17
17
  def match?(headers, row)
18
- return false unless row[3]
19
- return false unless row[3].match?(/CVAR/)
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
@@ -1,3 +1,3 @@
1
1
  module Dcm
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dcm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Mueller