automotive-ecu 0.5.0 → 0.5.1

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: 0aa35f657df5646f7a32c3bbec852854dd65839dbf370cab649fe78e95c4a162
4
- data.tar.gz: a4cb4d0720619beaa92bddadb93c9b15a83c9df5567c323e60a86b4a77c87c97
3
+ metadata.gz: cbc3b625690b9f5d8d6bf67e86b3ce6134cd35ae10240f1b02a2708c2a63fd8f
4
+ data.tar.gz: 337197db174176a05b20c762edc9ed31f7f9cdaa5ec9ccc7d4a4e28c2a70e491
5
5
  SHA512:
6
- metadata.gz: 89d17f6da4b8e91554515e6c7956ce6cd70deb411897cc993eed2c875247012b858d54cf0212a258cdd59ceb19404d388516b4df30378039656cc97a13729706
7
- data.tar.gz: 0fc0179be08391be84bd9bbecca1b7a9512941ebbe91e7bafdacfb26f1e79c7354c3832887f578b8faa4caa86c33acc1bc6e2cecb2582909c9174875a6e1dba6
6
+ metadata.gz: 790eaa6e0abc424b844153076789a6847a35806af182ee502fc7105d63de02b0778128f70ea6b774a235eff166b9480624aead5919122706389f0f0f5f620003
7
+ data.tar.gz: 2712b9924613bddac8486f4dfeb69b0a7ff52172067e8ab0c198cd6f6bdad4f65a025f4734f543e45020e8fe74871fb52355ee6ac8820df2395025f3eba20bd4
@@ -5,7 +5,9 @@ class Ecu
5
5
  class CombinedList
6
6
  def self.from_lab(str)
7
7
  signals, labels, headers, subheaders = LabParser.new(str).call
8
- new(signals, labels, headers, subheaders)
8
+ new(SignalList.new(signals, headers, subheaders),
9
+ LabelList.new(labels, headers, subheaders),
10
+ headers, subheaders)
9
11
  end
10
12
 
11
13
  def to_lab
@@ -26,7 +28,7 @@ class Ecu
26
28
  out.append("[Label]")
27
29
  out.append(*labels.map(&:to_lab))
28
30
 
29
- out.join("\n")
31
+ out.join("\n") + "\n"
30
32
  end
31
33
  end
32
34
  end
@@ -6,8 +6,8 @@ class Ecu
6
6
  fail "Can only merge SignalLists (left: #{left.class}, right: #{right.class})!"
7
7
  end
8
8
 
9
- @left = left.map(&:name)
10
- @right = right.map(&:name)
9
+ @left = left.map(&:name).zip(left).to_h
10
+ @right = right.map(&:name).zip(right).to_h
11
11
  @unified_headers = left.headers + right.headers
12
12
  @unified_subheaders = left.subheaders + right.subheaders
13
13
  @names = Hash.new
@@ -16,10 +16,10 @@ class Ecu
16
16
  def names(criterion)
17
17
  @names[criterion] ||= \
18
18
  case criterion
19
- when :left_exclusive then left - right
20
- when :right_exclusive then right - left
21
- when :common then left & right
22
- when :equal then left & right
19
+ when :left_exclusive then left.keys - right.keys
20
+ when :right_exclusive then right.keys - left.keys
21
+ when :common then left.keys & right.keys
22
+ when :equal then left.keys & right.keys
23
23
  when :nonequal then []
24
24
  else fail "Unknown criterion #{criterion}"
25
25
  end
@@ -38,7 +38,7 @@ class Ecu
38
38
  (
39
39
  names(:left_exclusive).map { |n| left.fetch(n) } +
40
40
  names(:right_exclusive).map { |n| right.fetch(n) } +
41
- names(:common).map { |n| left.fetch(n) }
41
+ names(:common).map { |n| (priority == :right ? right : left).fetch(n) }
42
42
  ),
43
43
  @unified_headers,
44
44
  @unified_subheaders
data/lib/ecu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Ecu
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: automotive-ecu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Mueller