vindetta 0.23.0 → 0.24.0
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/exe/vindetta +1 -1
- data/lib/vindetta/cli.rb +1 -1
- data/lib/vindetta/decoder.rb +8 -8
- data/lib/vindetta/generator.rb +2 -2
- data/lib/vindetta/version.rb +1 -1
- metadata +2 -3
- data/lib/vindetta/data/vis.yaml +0 -93
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad6e970871eb591e0f430b78fe2940201dedd0e7
|
|
4
|
+
data.tar.gz: 38c7548b9a5a98507205f998176db995f659aa35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d29396ef25dfea7edde00fecfe8ea48f0497f0ddb9a041da5bab0f24df4213c1b1f68fe1133c8250b8002f3fea269afd30f604959584f79009337c477c7b792e
|
|
7
|
+
data.tar.gz: 96872e1404a6ec1d0863cb0ba5d2e5966db0dde38e4b837274829fc74a14f232a862ca4a35caf87b9f307abf2d93d1637b8f5d63f70ee986438b5fd35da7a647
|
data/exe/vindetta
CHANGED
data/lib/vindetta/cli.rb
CHANGED
data/lib/vindetta/decoder.rb
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
module Vindetta
|
|
2
2
|
class Decoder
|
|
3
|
+
BASE_MODEL_YEAR = 1980
|
|
4
|
+
ALPHA = ('A'..'Z').to_a
|
|
5
|
+
NUMERIC = ("0".."9").to_a
|
|
6
|
+
|
|
3
7
|
def self.vin(vin)
|
|
4
8
|
{
|
|
5
9
|
:plant_code => vin[PLANT_CODE_INDEX],
|
|
@@ -13,16 +17,12 @@ module Vindetta
|
|
|
13
17
|
private
|
|
14
18
|
|
|
15
19
|
def self.model_year(vin)
|
|
16
|
-
|
|
17
|
-
@alpha ||= "ABCDEFGHJKLMNPRSTUVWXYZ".chars
|
|
18
|
-
|
|
19
|
-
tenth = vin[9]
|
|
20
|
-
seventh = vin[6]
|
|
20
|
+
index = ((ALPHA - %w[I O Q U Z]) + (NUMERIC - %w[0])).find_index { |c| c == vin[9] }
|
|
21
21
|
|
|
22
|
-
if
|
|
23
|
-
|
|
22
|
+
if ALPHA.include?(vin[6])
|
|
23
|
+
BASE_MODEL_YEAR + index + 30
|
|
24
24
|
else
|
|
25
|
-
|
|
25
|
+
BASE_MODEL_YEAR + index
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
end
|
data/lib/vindetta/generator.rb
CHANGED
data/lib/vindetta/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vindetta
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.24.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kyle Decot
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-07-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: gli
|
|
@@ -161,7 +161,6 @@ files:
|
|
|
161
161
|
- lib/vindetta.rb
|
|
162
162
|
- lib/vindetta/calculator.rb
|
|
163
163
|
- lib/vindetta/cli.rb
|
|
164
|
-
- lib/vindetta/data/vis.yaml
|
|
165
164
|
- lib/vindetta/data/wmi.yaml
|
|
166
165
|
- lib/vindetta/decoder.rb
|
|
167
166
|
- lib/vindetta/generator.rb
|
data/lib/vindetta/data/vis.yaml
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
|
|
3
|
-
year:
|
|
4
|
-
A:
|
|
5
|
-
- 1980
|
|
6
|
-
- 2010
|
|
7
|
-
B:
|
|
8
|
-
- 1981
|
|
9
|
-
- 2011
|
|
10
|
-
C:
|
|
11
|
-
- 1982
|
|
12
|
-
- 2012
|
|
13
|
-
D:
|
|
14
|
-
- 1983
|
|
15
|
-
- 2013
|
|
16
|
-
E:
|
|
17
|
-
- 1984
|
|
18
|
-
- 2014
|
|
19
|
-
F:
|
|
20
|
-
- 1985
|
|
21
|
-
- 2015
|
|
22
|
-
G:
|
|
23
|
-
- 1986
|
|
24
|
-
- 2016
|
|
25
|
-
H:
|
|
26
|
-
- 1987
|
|
27
|
-
- 2017
|
|
28
|
-
J:
|
|
29
|
-
- 1988
|
|
30
|
-
- 2018
|
|
31
|
-
K:
|
|
32
|
-
- 1989
|
|
33
|
-
- 2019
|
|
34
|
-
L:
|
|
35
|
-
- 1990
|
|
36
|
-
- 2020
|
|
37
|
-
M:
|
|
38
|
-
- 1991
|
|
39
|
-
- 2021
|
|
40
|
-
N:
|
|
41
|
-
- 1992
|
|
42
|
-
- 2022
|
|
43
|
-
P:
|
|
44
|
-
- 1993
|
|
45
|
-
- 2023
|
|
46
|
-
R:
|
|
47
|
-
- 1994
|
|
48
|
-
- 2024
|
|
49
|
-
S:
|
|
50
|
-
- 1995
|
|
51
|
-
- 2025
|
|
52
|
-
T:
|
|
53
|
-
- 1996
|
|
54
|
-
- 2026
|
|
55
|
-
V:
|
|
56
|
-
- 1997
|
|
57
|
-
- 2027
|
|
58
|
-
W:
|
|
59
|
-
- 1998
|
|
60
|
-
- 2028
|
|
61
|
-
X:
|
|
62
|
-
- 1999
|
|
63
|
-
- 2029
|
|
64
|
-
Y:
|
|
65
|
-
- 2000
|
|
66
|
-
- 2030
|
|
67
|
-
"1":
|
|
68
|
-
- 2001
|
|
69
|
-
- 2031
|
|
70
|
-
"2":
|
|
71
|
-
- 2002
|
|
72
|
-
- 2032
|
|
73
|
-
"3":
|
|
74
|
-
- 2003
|
|
75
|
-
- 2033
|
|
76
|
-
"4":
|
|
77
|
-
- 2004
|
|
78
|
-
- 2034
|
|
79
|
-
"5":
|
|
80
|
-
- 2005
|
|
81
|
-
- 2035
|
|
82
|
-
"6":
|
|
83
|
-
- 2006
|
|
84
|
-
- 2036
|
|
85
|
-
"7":
|
|
86
|
-
- 2007
|
|
87
|
-
- 2037
|
|
88
|
-
"8":
|
|
89
|
-
- 2008
|
|
90
|
-
- 2038
|
|
91
|
-
"9":
|
|
92
|
-
- 2009
|
|
93
|
-
- 2039
|