automotive-ecu 0.1.5 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9258d168cddd58d8fe69e82099c079bab80e8c7568f7e6d6e94c64f86f96388
4
- data.tar.gz: 984ff33b0ff2973a4d0e687241447eef1b263b2c4129d2f14d5daed44be56c79
3
+ metadata.gz: 3af329b7eff09bf2efb39371d409b8aaa71fdd0e5fb38df19f15d710079c4e80
4
+ data.tar.gz: de43b70d4de4e5043e71c5cf85c972f4387addcb8e4405bb1ec5b4ef464a9d67
5
5
  SHA512:
6
- metadata.gz: 6418a2fadf25cda97567eaa0fc38a16b81c6fd841b33c0e1f5e85681f0ca38044f8524967b044ea53d6f4e4387af082529c7dbdbbc8ea2cc90c2d4b1fffc83e7
7
- data.tar.gz: cf113d96b84b68c92acc3ae0d6485565da0db3491648a20448a7c286925d6d891e086d96bf97badd111d3115bc873bf0d07458ed37e70d1b9372f8f8c434803b
6
+ metadata.gz: 90bbfe1a56cbfb877bac05e1d39d1df3e532b7dedcd2956f25ce7f1bee4b320fa3c7df957c85b0ae721e7a13364082219291f87b9f6ab6f55df285511a8361c8
7
+ data.tar.gz: 73f12ebdeb701ee1f6618de19ca2a27a9361beadbd4857234f543a22cabb19a3563a2ada598dcb45ac3d8f961be5dacedb04ef1ffad4413ec4f6b186c4410804
@@ -5,7 +5,7 @@ class Ecu
5
5
  end
6
6
 
7
7
  def to_dcm(indented=false)
8
- fmtstr = indented ? "%-26s%s\n" : "%s %s\n"
8
+ fmtstr = indented ? "%-25s%s\n" : "%s %s\n"
9
9
 
10
10
  sprintf(fmtstr, type.upcase, name).tap do |str|
11
11
  str << " LANGNAME #{description.enquote}\n" if description
@@ -7,7 +7,7 @@ class Ecu
7
7
  end
8
8
 
9
9
  def to_dcm(indented=false)
10
- fmtstr = indented ? "%-26s%s %s" : "%s %s %d"
10
+ fmtstr = indented ? "%-25s%s %s" : "%s %s %d"
11
11
 
12
12
  sprintf(fmtstr, type.upcase, name, xdim).tap do |str|
13
13
  str << " @ #{ydim}" if ydim != 1
@@ -5,7 +5,7 @@ class Ecu
5
5
  end
6
6
 
7
7
  def to_dcm(indented=false)
8
- fmtstr = indented ? "%-26s%s %s %s\n" : "%s %s %d %d\n"
8
+ fmtstr = indented ? "%-25s%s %s %s\n" : "%s %s %d %d\n"
9
9
 
10
10
  sprintf(fmtstr, type.upcase, name, xdim, ydim).tap do |str|
11
11
  str << " LANGNAME #{description.enquote}\n" if description
@@ -5,7 +5,7 @@ class Ecu
5
5
  end
6
6
 
7
7
  def to_dcm(indented=false)
8
- fmtstr = indented ? "%-26s%s %s\n" : "%s %s %d\n"
8
+ fmtstr = indented ? "%-25s%s %s\n" : "%s %s %d\n"
9
9
 
10
10
  sprintf(fmtstr, type.upcase, name, xdim).tap do |str|
11
11
  str << " LANGNAME #{description.enquote}\n" if description
@@ -5,7 +5,7 @@ class Ecu
5
5
  end
6
6
 
7
7
  def to_dcm(indented=false)
8
- fmtstr = indented ? "%-26s%s %s\n" : "%s %s %d\n"
8
+ fmtstr = indented ? "%-25s%s %s\n" : "%s %s %d\n"
9
9
 
10
10
  sprintf(fmtstr, type.upcase, name, xdim).tap do |str|
11
11
  str << " LANGNAME #{description.enquote}\n" if description
@@ -26,15 +26,21 @@ class Ecu
26
26
  end
27
27
 
28
28
  def left_exclusive
29
- names(:left_exclusive).map { |name| left.fetch(name) }
29
+ names(:left_exclusive).map { left.fetch(_1) }
30
30
  end
31
31
 
32
32
  def right_exclusive
33
- names(:right_exclusive).map { |name| right.fetch(name) }
33
+ names(:right_exclusive).map { right.fetch(_1) }
34
34
  end
35
35
 
36
36
  def differences
37
- names(:nonequal).map { |name| [ left.fetch(name), right.fetch(name) ] }
37
+ names(:nonequal).map { [ left.fetch(_1), right.fetch(_1) ] }
38
+ end
39
+
40
+ def identical?
41
+ names(:left_exclusive).empty? &&
42
+ names(:right_exclusive).empty? &&
43
+ names(:nonequal).empty?
38
44
  end
39
45
 
40
46
  def merge(priority: :right)
@@ -7,14 +7,12 @@ class Ecu
7
7
  end
8
8
 
9
9
  def eql?
10
- return false unless @left.class == @right.class
11
- case @left
12
- when NilClass then @left == @right
13
- when String then @left == @right
14
- when Numeric then @left == @right
15
- when Array then arrays_eql?(@left, @right)
16
- else
17
- fail "Unkown value class: #{@left.class}"
10
+ case [@left, @right]
11
+ in [NilClass, NilClass] then @left == @right
12
+ in [String, String] then @left == @right
13
+ in [Numeric, Numeric] then @left == @right
14
+ in [Array, Array] then arrays_eql?(@left, @right)
15
+ in [_, _] then false
18
16
  end
19
17
  end
20
18
 
data/lib/ecu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Ecu
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: automotive-ecu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Mueller
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-24 00:00:00.000000000 Z
11
+ date: 2024-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: terminal-table