vindetta 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vindetta/cli.rb +3 -2
- data/lib/vindetta/data/wmi.yaml +468 -459
- data/lib/vindetta/decoder/dsl.rb +34 -0
- data/lib/vindetta/decoder/result.rb +35 -0
- data/lib/vindetta/decoder.rb +8 -4
- data/lib/vindetta/version.rb +1 -1
- data/lib/vindetta/vin/wmi.rb +11 -1
- data/lib/vindetta/vin.rb +4 -0
- data/vindetta.gemspec +2 -0
- metadata +32 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac355fb1deb041cb526cf5e946750822d0c73d70
|
4
|
+
data.tar.gz: 872eb3dcca1b9528ed096f0a06545195f64a2580
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db37c206562c7ead2f9d3550d802ed3553410b10fccbb54ca61ec450a9dcdd71d591d61add66de07740e54a95084047f0a736cec8c51a0a373a9fdff72c0d09c
|
7
|
+
data.tar.gz: 9c7c1f56acf2d1dbcbeae6c4590096cb887859a9d20b3c169e73d9b76c9501d1c83ca3f0c9b91ff7690d1de4966c858c011d89333f6fe64833afbe60c7b3e421
|
data/lib/vindetta/cli.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
require "gli"
|
2
|
+
require "vindetta/version"
|
2
3
|
|
3
4
|
module Vindetta
|
4
5
|
class CLI
|
5
6
|
extend GLI::App
|
6
7
|
|
7
8
|
program_desc "Vehicle Identification Number (VIN) CLI"
|
9
|
+
version Vindetta::VERSION
|
8
10
|
|
9
11
|
desc "Transliterates a VIN character"
|
10
12
|
arg_name "character"
|
@@ -24,8 +26,7 @@ module Vindetta
|
|
24
26
|
desc "Decodes a VIN"
|
25
27
|
command %i[decode d] do |c|
|
26
28
|
c.action do |_global, _options, _args|
|
27
|
-
|
28
|
-
puts Vindetta::Decoder.decode(vin)
|
29
|
+
puts Vindetta::Decoder.decode_vin(_args.first).to_json
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
data/lib/vindetta/data/wmi.yaml
CHANGED
@@ -1,461 +1,470 @@
|
|
1
1
|
---
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
YT9/
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
3
|
+
wmi:
|
4
|
+
AAV: Volkswagen South Africa
|
5
|
+
AC5: Hyundai South Africa
|
6
|
+
ADD: Hyundai South Africa
|
7
|
+
AFA: Ford South Africa
|
8
|
+
AHT: Toyota South Africa
|
9
|
+
JA3: Mitsubishi
|
10
|
+
JA4: Mitsubishi
|
11
|
+
JA: Isuzu
|
12
|
+
JD: Daihatsu
|
13
|
+
JF: Fuji Heavy Industries (Subaru)
|
14
|
+
JH: Honda
|
15
|
+
JK: Kawasaki (motorcycles)
|
16
|
+
JL5: Mitsubishi Fuso
|
17
|
+
JMB: Mitsubishi Motors
|
18
|
+
JMY: Mitsubishi Motors
|
19
|
+
JMZ: Mazda
|
20
|
+
JN: Nissan
|
21
|
+
JS: Suzuki
|
22
|
+
JT: Toyota
|
23
|
+
JY: Yamaha (motorcycles)
|
24
|
+
KL: Daewoo General Motors South Korea
|
25
|
+
KM: Hyundai
|
26
|
+
KMY: Daelim (motorcycles)
|
27
|
+
KM1: Hyosung (motorcycles)
|
28
|
+
KN: Kia
|
29
|
+
KNM: Renault Samsung
|
30
|
+
KPA: SsangYong
|
31
|
+
KPT: SsangYong
|
32
|
+
LAN: Changzhou Yamasaki Motorcycle
|
33
|
+
LBB: Zhejiang Qianjiang Motorcycle (Keeway/Generic)
|
34
|
+
LBE: Beijing Hyundai
|
35
|
+
LBM: Zongshen Piaggio
|
36
|
+
LBP: Chongqing Jainshe Yamaha (motorcycles)
|
37
|
+
LB2: Geely Motorcycles
|
38
|
+
LCE: Hangzhou Chunfeng Motorcycles (CFMOTO)
|
39
|
+
LDC: Dong Feng Peugeot Citroen (DPCA), China
|
40
|
+
LDD: Dandong Huanghai Automobile
|
41
|
+
LDN: SouEast Motor
|
42
|
+
LDY: Zhongtong Coach, China
|
43
|
+
LET: Jiangling-Isuzu Motors, China
|
44
|
+
LE4: Beijing Benz, China
|
45
|
+
LFB: FAW, China (busses)
|
46
|
+
LFG: Taizhou Chuanl Motorcycle Manufacturing
|
47
|
+
LFP: FAW, China (passenger vehicles)
|
48
|
+
LFT: FAW, China (trailers)
|
49
|
+
LFV: FAW-Volkswagen, China
|
50
|
+
LFW: FAW JieFang, China
|
51
|
+
LFY: Changshu Light Motorcycle Factory
|
52
|
+
LGB: Dong Feng (DFM), China
|
53
|
+
LGH: Qoros (formerly Dong Feng (DFM)), China
|
54
|
+
LGX: BYD Auto, China
|
55
|
+
LHB: Beijing Automotive Industry Holding
|
56
|
+
LH1: FAW-Haima, China
|
57
|
+
LJC: JAC, China
|
58
|
+
LJ1: JAC, China
|
59
|
+
LKL: Suzhou King Long, China
|
60
|
+
LL6: Hunan Changfeng Manufacture Joint-Stock
|
61
|
+
LL8: Linhai (ATV)
|
62
|
+
LMC: Suzuki Hong Kong (motorcycles)
|
63
|
+
LPR: Yamaha Hong Kong (motorcycles)
|
64
|
+
LSG: Shanghai General Motors, China
|
65
|
+
LSJ: MG Motor UK Limited - SAIC Motor, Shanghai, China
|
66
|
+
LSV: Shanghai Volkswagen, China
|
67
|
+
LSY: Brilliance Zhonghua
|
68
|
+
LTV: Toyota Tian Jin
|
69
|
+
LUC: Guangqi Honda, China
|
70
|
+
LVS: Ford Chang An
|
71
|
+
LVV: Chery, China
|
72
|
+
LVZ: Dong Feng Sokon Motor Company (DFSK)
|
73
|
+
LZM: MAN China
|
74
|
+
LZE: Isuzu Guangzhou, China
|
75
|
+
LZG: Shaanxi Automobile Group, China
|
76
|
+
LZP: Zhongshan Guochi Motorcycle (Baotian)
|
77
|
+
LZY: Yutong Zhengzhou, China
|
78
|
+
LZZ: Chongqing Shuangzing Mech & Elec (Howo)
|
79
|
+
L4B: Xingyue Group (motorcycles)
|
80
|
+
L5C: KangDi (ATV)
|
81
|
+
L5K: Zhejiang Yongkang Easy Vehicle
|
82
|
+
L5N: Zhejiang Taotao, China (ATV & motorcycles)
|
83
|
+
L5Y: Merato Motorcycle Taizhou Zhongneng
|
84
|
+
L85: Zhejiang Yongkang Huabao Electric Appliance
|
85
|
+
L8X: Zhejiang Summit Huawin Motorcycle
|
86
|
+
MAB: Mahindra & Mahindra
|
87
|
+
MAC: Mahindra & Mahindra
|
88
|
+
MAJ: Ford India
|
89
|
+
MAK: Honda Siel Cars India
|
90
|
+
MAL: Hyundai
|
91
|
+
MAT: Tata Motors
|
92
|
+
MA1: Mahindra & Mahindra
|
93
|
+
MA3: Suzuki India (Maruti)
|
94
|
+
MA6: GM India
|
95
|
+
MA7: Mitsubishi India (formerly Honda)
|
96
|
+
MBH: Suzuki India (Maruti)
|
97
|
+
MBJ: Toyota India
|
98
|
+
MBR: Mercedes-Benz India
|
99
|
+
MB1: Ashok Leyland
|
100
|
+
MCA: Fiat India
|
101
|
+
MCB: GM India
|
102
|
+
MC2: Volvo Eicher commercial vehicles limited.
|
103
|
+
MDH: Nissan India
|
104
|
+
MD2: Bajaj Auto
|
105
|
+
MEE: Renault India
|
106
|
+
MEX: Volkswagen India
|
107
|
+
MHF: Toyota Indonesia
|
108
|
+
MHR: Honda Indonesia
|
109
|
+
MLC: Suzuki Thailand
|
110
|
+
MLH: Honda Thailand
|
111
|
+
MMB: Mitsubishi Thailand
|
112
|
+
MMC: Mitsubishi Thailand
|
113
|
+
MMM: Chevrolet Thailand
|
114
|
+
MMT: Mitsubishi Thailand
|
115
|
+
MM8: Mazda Thailand
|
116
|
+
MNB: Ford Thailand
|
117
|
+
MNT: Nissan Thailand
|
118
|
+
MPA: Isuzu Thailand
|
119
|
+
MP1: Isuzu Thailand
|
120
|
+
MRH: Honda Thailand
|
121
|
+
MR0: Toyota Thailand
|
122
|
+
NLA: Honda Türkiye
|
123
|
+
NLE: Mercedes-Benz Türk Truck
|
124
|
+
NLH: Hyundai Assan
|
125
|
+
NLT: TEMSA
|
126
|
+
NMB: Mercedes-Benz Türk Buses
|
127
|
+
NMC: BMC
|
128
|
+
NM0: Ford Turkey
|
129
|
+
NM4: Tofaş Türk
|
130
|
+
NMT: Toyota Türkiye
|
131
|
+
NNA: Isuzu Turkey
|
132
|
+
PE1: Ford Phillipines
|
133
|
+
PE3: Mazda Phillipines
|
134
|
+
PL1: Proton, Malaysia
|
135
|
+
PNA: NAZA, Malaysia (Peugeot)
|
136
|
+
RA1: Steyr Trucks International FZE, UAE
|
137
|
+
RFB: Kymco, Taiwan
|
138
|
+
RFG: Sanyang SYM, Taiwan
|
139
|
+
RFL: Adly, Taiwan
|
140
|
+
RFT: CPI, Taiwan
|
141
|
+
RF3: Aeon Motor, Taiwan
|
142
|
+
SAL: Land Rover
|
143
|
+
SAJ: Jaguar
|
144
|
+
SAR: Rover
|
145
|
+
SB1: Toyota UK
|
146
|
+
SBM: McLaren
|
147
|
+
SCA: Rolls Royce
|
148
|
+
SCB: Bentley
|
149
|
+
SCC: Lotus Cars
|
150
|
+
SCE: DeLorean Motor Cars N. Ireland (UK)
|
151
|
+
SCF: Aston
|
152
|
+
SDB: Peugeot UK (formerly Talbot)
|
153
|
+
SED: General Motors Luton Plant
|
154
|
+
SEY: LDV
|
155
|
+
SFA: Ford UK
|
156
|
+
SFD: Alexander Dennis UK
|
157
|
+
SHH: Honda UK
|
158
|
+
SHS: Honda UK
|
159
|
+
SJN: Nissan UK
|
160
|
+
SKF: Vauxhall
|
161
|
+
SLP: JCB Research UK
|
162
|
+
SMT: Triumph Motorcycles
|
163
|
+
SUF: Fiat Auto Poland
|
164
|
+
SUL: FSC (Poland)
|
165
|
+
SUP: FSO-Daewoo (Poland)
|
166
|
+
SUU: Solaris Bus & Coach (Poland)
|
167
|
+
TCC: Micro Compact Car AG (smart 1998-1999)
|
168
|
+
TDM: QUANTYA Swiss Electric Movement (Switzerland)
|
169
|
+
TK9: SOR buses (Czech Republic)
|
170
|
+
TMA: Hyundai Motor Manufacturing Czech
|
171
|
+
TMB: Škoda (Czech Republic)
|
172
|
+
TMK: Karosa (Czech Republic)
|
173
|
+
TMP: Škoda trolleybuses (Czech Republic)
|
174
|
+
TMT: Tatra (Czech Republic)
|
175
|
+
TM9: Škoda trolleybuses (Czech Republic)
|
176
|
+
TNE: TAZ
|
177
|
+
TN9: Karosa (Czech Republic)
|
178
|
+
TRA: Ikarus Bus
|
179
|
+
TRU: Audi Hungary
|
180
|
+
TSE: Ikarus Egyedi Autobuszgyar, (Hungary)
|
181
|
+
TSM: Suzuki Hungary
|
182
|
+
TW1: Toyota Caetano Portugal
|
183
|
+
TYA: Mitsubishi Trucks Portugal
|
184
|
+
TYB: Mitsubishi Trucks Portugal
|
185
|
+
UU1: Renault Dacia, (Romania)
|
186
|
+
UU3: ARO
|
187
|
+
UU6: Daewoo Romania
|
188
|
+
U5Y: Kia Motors Slovakia
|
189
|
+
U6Y: Kia Motors Slovakia
|
190
|
+
VAG: Magna Steyr Puch
|
191
|
+
VAN: MAN Austria
|
192
|
+
VBK: KTM (Motorcycles)
|
193
|
+
VF1: Renault
|
194
|
+
VF2: Renault
|
195
|
+
VF3: Peugeot
|
196
|
+
VF4: Talbot
|
197
|
+
VF6: Renault (Trucks & Buses)
|
198
|
+
VF7: Citroën
|
199
|
+
VF8: Matra
|
200
|
+
VF9/795: Bugatti
|
201
|
+
VG5: MBK (motorcycles)
|
202
|
+
VLU: Scania France
|
203
|
+
VN1: SOVAB (France)
|
204
|
+
VNE: Irisbus (France)
|
205
|
+
VNK: Toyota France
|
206
|
+
VNV: Renault-Nissan
|
207
|
+
VSA: Mercedes-Benz Spain
|
208
|
+
VSE: Suzuki Spain (Santana Motors)
|
209
|
+
VSK: Nissan Spain
|
210
|
+
VSS: SEAT
|
211
|
+
VSX: Opel Spain
|
212
|
+
VS6: Ford Spain
|
213
|
+
VS7: Citroën Spain
|
214
|
+
VS9: Carrocerias Ayats (Spain)
|
215
|
+
VTH: Derbi (motorcycles)
|
216
|
+
VTL: Yamaha Spain (motorcycles)
|
217
|
+
VTT: Suzuki Spain (motorcycles)
|
218
|
+
VV9: TAURO Spain
|
219
|
+
VWA: Nissan Spain
|
220
|
+
VWV: Volkswagen Spain
|
221
|
+
VX1: Zastava / Yugo Serbia
|
222
|
+
WAG: Neoplan
|
223
|
+
WAU: Audi
|
224
|
+
WA1: Audi SUV
|
225
|
+
WBA: BMW
|
226
|
+
WBS: BMW M
|
227
|
+
WBY: BMW
|
228
|
+
WDA: Daimler
|
229
|
+
WDB: Mercedes-Benz
|
230
|
+
WDC: DaimlerChrysler
|
231
|
+
WDD: Mercedes-Benz
|
232
|
+
WDF: Mercedes-Benz (commercial vehicles)
|
233
|
+
WEB: Evobus GmbH (Mercedes-Bus)
|
234
|
+
WJM: Iveco Magirus
|
235
|
+
WF0: Ford Germany
|
236
|
+
WKK: Kässbohrer/Setra
|
237
|
+
WMA: MAN Germany
|
238
|
+
WME: smart
|
239
|
+
WMW: MINI
|
240
|
+
WMX: Mercedes-AMG
|
241
|
+
WP0: Porsche
|
242
|
+
WP1: Porsche SUV
|
243
|
+
W0L: Opel
|
244
|
+
W0V: Opel
|
245
|
+
WUA: quattro GmbH
|
246
|
+
WVG: Volkswagen MPV/SUV
|
247
|
+
WVW: Volkswagen
|
248
|
+
WV1: Volkswagen Commercial Vehicles
|
249
|
+
WV2: Volkswagen Bus/Van
|
250
|
+
WV3: Volkswagen Trucks
|
251
|
+
XLB: Volvo (NedCar)
|
252
|
+
XLE: Scania Netherlands
|
253
|
+
XLR: DAF (trucks)
|
254
|
+
XL9/363: Spyker
|
255
|
+
XMC: Mitsubishi (NedCar)
|
256
|
+
XTA: Lada/AvtoVAZ (Russia)
|
257
|
+
XTC: KAMAZ (Russia)
|
258
|
+
XTH: GAZ (Russia)
|
259
|
+
XTT: UAZ/Sollers (Russia)
|
260
|
+
XTY: LiAZ (Russia)
|
261
|
+
XUF: General Motors Russia
|
262
|
+
XUU: AvtoTor (Russia, General Motors SKD)
|
263
|
+
XW8: Volkswagen Group Russia
|
264
|
+
XWB: UZ-Daewoo (Uzbekistan)
|
265
|
+
XWE: AvtoTor (Russia, Hyundai-Kia SKD)
|
266
|
+
X1M: PAZ (Russia)
|
267
|
+
X4X: AvtoTor (Russia, BMW SKD)
|
268
|
+
X7L: Renault AvtoFramos (Russia)
|
269
|
+
X7M: Hyundai TagAZ (Russia)
|
270
|
+
YBW: Volkswagen Belgium
|
271
|
+
YB1: Volvo Trucks Belgium
|
272
|
+
YCM: Mazda Belgium
|
273
|
+
YE2: Van Hool (buses)
|
274
|
+
YH2: BRP Finland (Lynx snowmobiles)
|
275
|
+
YK1: Saab-Valmet Finland
|
276
|
+
YS2: Scania AB
|
277
|
+
YS3: Saab
|
278
|
+
YS4: Scania Bus
|
279
|
+
YTN: Saab NEVS
|
280
|
+
YT9/007: Koenigsegg
|
281
|
+
YT9/034: Carvia
|
282
|
+
YU7: Husaberg (motorcycles)
|
283
|
+
YV1: Volvo Cars
|
284
|
+
YV4: Volvo Cars
|
285
|
+
YV2: Volvo Trucks
|
286
|
+
YV3: Volvo Buses
|
287
|
+
Y3M: MAZ (Belarus)
|
288
|
+
Y6D: Zaporozhets/AvtoZAZ (Ukraine)
|
289
|
+
ZAA: Autobianchi
|
290
|
+
ZAM: Maserati
|
291
|
+
ZAP: Piaggio/Vespa/Gilera
|
292
|
+
ZAR: Alfa Romeo
|
293
|
+
ZBN: Benelli
|
294
|
+
ZCG: Cagiva SpA / MV Agusta
|
295
|
+
ZCF: Iveco
|
296
|
+
ZDM: Ducati Motor Holdings SpA
|
297
|
+
ZDF: Ferrari Dino
|
298
|
+
ZD0: Yamaha Italy
|
299
|
+
ZD3: Beta Motor
|
300
|
+
ZD4: Aprilia
|
301
|
+
ZFA: Fiat
|
302
|
+
ZFC: Fiat V.I.
|
303
|
+
ZFF: Ferrari
|
304
|
+
ZGU: Moto Guzzi
|
305
|
+
ZHW: Lamborghini
|
306
|
+
ZJM: Malaguti
|
307
|
+
ZJN: Innocenti
|
308
|
+
ZKH: Husqvarna Motorcycles Italy
|
309
|
+
ZLA: Lancia
|
310
|
+
ZOM: OM
|
311
|
+
Z8M: Marussia (Russia)
|
312
|
+
1B3: Dodge
|
313
|
+
1C3: Chrysler
|
314
|
+
1C6: Chrysler
|
315
|
+
1D3: Dodge
|
316
|
+
1FA: Ford Motor Company
|
317
|
+
1FB: Ford Motor Company
|
318
|
+
1FC: Ford Motor Company
|
319
|
+
1FD: Ford Motor Company
|
320
|
+
1FM: Ford Motor Company
|
321
|
+
1FT: Ford Motor Company
|
322
|
+
1FU: Freightliner
|
323
|
+
1FV: Freightliner
|
324
|
+
1F9: FWD Corp.
|
325
|
+
1G: General Motors USA
|
326
|
+
1GC: Chevrolet Truck USA
|
327
|
+
1GT: GMC Truck USA
|
328
|
+
1G1: Chevrolet USA
|
329
|
+
1G2: Pontiac USA
|
330
|
+
1G3: Oldsmobile USA
|
331
|
+
1G4: Buick USA
|
332
|
+
1G6: Cadillac USA
|
333
|
+
1G8: Saturn USA
|
334
|
+
1GM: Pontiac USA
|
335
|
+
1GY: Cadillac USA
|
336
|
+
1H: Honda USA
|
337
|
+
1HD: Harley-Davidson
|
338
|
+
1J4: Jeep
|
339
|
+
1L: Lincoln USA
|
340
|
+
1ME: Mercury USA
|
341
|
+
1M1: Mack Truck USA
|
342
|
+
1M2: Mack Truck USA
|
343
|
+
1M3: Mack Truck USA
|
344
|
+
1M4: Mack Truck USA
|
345
|
+
1M9: Mynatt Truck & Equipment
|
346
|
+
1N: Nissan USA
|
347
|
+
1NX: NUMMI USA
|
348
|
+
1P3: Plymouth USA
|
349
|
+
1R9: Roadrunner Hay Squeeze USA
|
350
|
+
1VW: Volkswagen USA
|
351
|
+
1XK: Kenworth USA
|
352
|
+
1XP: Peterbilt USA
|
353
|
+
1YV: Mazda USA (AutoAlliance International)
|
354
|
+
1ZV: Ford (AutoAlliance International)
|
355
|
+
2A4: Chrysler Canada
|
356
|
+
2BP: Bombardier Recreational Products
|
357
|
+
2B3: Dodge Canada
|
358
|
+
2B7: Dodge Canada
|
359
|
+
2C3: Chrysler Canada
|
360
|
+
2CN: CAMI
|
361
|
+
2D3: Dodge Canada
|
362
|
+
2FA: Ford Motor Company Canada
|
363
|
+
2FB: Ford Motor Company Canada
|
364
|
+
2FC: Ford Motor Company Canada
|
365
|
+
2FM: Ford Motor Company Canada
|
366
|
+
2FT: Ford Motor Company Canada
|
367
|
+
2FU: Freightliner
|
368
|
+
2FV: Freightliner
|
369
|
+
2FZ: Sterling
|
370
|
+
2G: General Motors Canada
|
371
|
+
2G1: Chevrolet Canada
|
372
|
+
2G2: Pontiac Canada
|
373
|
+
2G3: Oldsmobile Canada
|
374
|
+
2G4: Buick Canada
|
375
|
+
2HG: Honda Canada
|
376
|
+
2HK: Honda Canada
|
377
|
+
2HJ: Honda Canada
|
378
|
+
2HM: Hyundai Canada
|
379
|
+
2M: Mercury
|
380
|
+
2NV: Nova Bus Canada
|
381
|
+
2P3: Plymouth Canada
|
382
|
+
2T: Toyota Canada
|
383
|
+
2V4: Volkswagen Canada
|
384
|
+
2V8: Volkswagen Canada
|
385
|
+
2WK: Western Star
|
386
|
+
2WL: Western Star
|
387
|
+
2WM: Western Star
|
388
|
+
3C4: Chrysler Mexico
|
389
|
+
3D3: Dodge Mexico
|
390
|
+
3FA: Ford Motor Company Mexico
|
391
|
+
3FE: Ford Motor Company Mexico
|
392
|
+
3G: General Motors Mexico
|
393
|
+
3H: Honda Mexico
|
394
|
+
3JB: BRP Mexico (all-terrain vehicles)
|
395
|
+
3MD: Mazda Mexico
|
396
|
+
3MZ: Mazda Mexico
|
397
|
+
3N: Nissan Mexico
|
398
|
+
3P3: Plymouth Mexico
|
399
|
+
3VW: Volkswagen Mexico
|
400
|
+
4F: Mazda USA
|
401
|
+
4JG: Mercedes-Benz USA
|
402
|
+
4M: Mercury
|
403
|
+
4RK: Nova Bus USA
|
404
|
+
4S: Subaru-Isuzu Automotive
|
405
|
+
4T: Toyota
|
406
|
+
4T9: Lumen Motors
|
407
|
+
4UF: Arctic Cat Inc.
|
408
|
+
4US: BMW USA
|
409
|
+
4UZ: Frt-Thomas Bus
|
410
|
+
4V1: Volvo
|
411
|
+
4V2: Volvo
|
412
|
+
4V3: Volvo
|
413
|
+
4V4: Volvo
|
414
|
+
4V5: Volvo
|
415
|
+
4V6: Volvo
|
416
|
+
4VL: Volvo
|
417
|
+
4VM: Volvo
|
418
|
+
4VZ: Volvo
|
419
|
+
538: Zero Motorcycles (USA)
|
420
|
+
5F: Honda USA-Alabama
|
421
|
+
5L: Lincoln
|
422
|
+
5N1: Nissan USA
|
423
|
+
5NP: Hyundai USA
|
424
|
+
5T: Toyota USA - trucks
|
425
|
+
5YJ: Tesla Motors
|
426
|
+
6AB: MAN Australia
|
427
|
+
6F4: Nissan Motor Company Australia
|
428
|
+
6F5: Kenworth Australia
|
429
|
+
6FP: Ford Motor Company Australia
|
430
|
+
6G1: General Motors-Holden (post Nov 2002)
|
431
|
+
6G2: Pontiac Australia (GTO & G8)
|
432
|
+
6H8: General Motors-Holden (pre Nov 2002)
|
433
|
+
6MM: Mitsubishi Motors Australia
|
434
|
+
6T1: Toyota Motor Corporation Australia
|
435
|
+
6U9: Privately Imported car in Australia
|
436
|
+
8AD: Peugeot Argentina
|
437
|
+
8AF: Ford Motor Company Argentina
|
438
|
+
8AG: Chevrolet Argentina
|
439
|
+
8AJ: Toyota Argentina
|
440
|
+
8AK: Suzuki Argentina
|
441
|
+
8AP: Fiat Argentina
|
442
|
+
8AW: Volkswagen Argentina
|
443
|
+
8A1: Renault Argentina
|
444
|
+
8GD: Peugeot Chile
|
445
|
+
8GG: Chevrolet Chile
|
446
|
+
935: Citroën Brazil
|
447
|
+
936: Peugeot Brazil
|
448
|
+
93H: Honda Brazil
|
449
|
+
93R: Toyota Brazil
|
450
|
+
93U: Audi Brazil
|
451
|
+
93V: Audi Brazil
|
452
|
+
93X: Mitsubishi Motors Brazil
|
453
|
+
93Y: Renault Brazil
|
454
|
+
94D: Nissan Brazil
|
455
|
+
9BD: Fiat Brazil
|
456
|
+
9BF: Ford Motor Company Brazil
|
457
|
+
9BG: Chevrolet Brazil
|
458
|
+
9BM: Mercedes-Benz Brazil
|
459
|
+
9BR: Toyota Brazil
|
460
|
+
9BS: Scania Brazil
|
461
|
+
9BW: Volkswagen Brazil
|
462
|
+
9FB: Renault Colombia
|
463
|
+
|
464
|
+
region:
|
465
|
+
'Africa': [A, B, C, D, E, F, G, H]
|
466
|
+
'Asia': [J, K, L, M, N, O, P, Q, R]
|
467
|
+
'Europe': [S, T, U, V, W, X, Y, Z]
|
468
|
+
'North America': ['1', '2', '3', '4', '5']
|
469
|
+
'Oceania': ['6', '7']
|
470
|
+
'South America': ['8', '9', '0']
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Vindetta
|
2
|
+
class Decoder
|
3
|
+
module DSL
|
4
|
+
def decoded_attributes
|
5
|
+
@decoded_attributes ||= []
|
6
|
+
end
|
7
|
+
|
8
|
+
def has_value(name, variable_id, options = {})
|
9
|
+
decoded_attributes << name
|
10
|
+
|
11
|
+
define_method name do
|
12
|
+
value = value_for(variable_id)
|
13
|
+
|
14
|
+
case options[:type]
|
15
|
+
when :int then value&.to_i
|
16
|
+
else
|
17
|
+
value
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.extended(mod)
|
23
|
+
mod.instance_eval do
|
24
|
+
define_method :value_for do |variable_id|
|
25
|
+
result = @variables.find { |r| r["VariableId"] == variable_id }
|
26
|
+
return unless result
|
27
|
+
|
28
|
+
result["Value"]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "vindetta/decoder/dsl"
|
2
|
+
|
3
|
+
module Vindetta
|
4
|
+
class Decoder
|
5
|
+
class Result
|
6
|
+
extend Vindetta::Decoder::DSL
|
7
|
+
|
8
|
+
has_value :make, 26
|
9
|
+
has_value :model, 28
|
10
|
+
has_value :year, 29, type: :int
|
11
|
+
has_value :number_of_doors, 14, type: :int
|
12
|
+
has_value :number_of_windows, 40, type: :int
|
13
|
+
has_value :seat_belts_type, 79
|
14
|
+
has_value :manufacturer_name, 27
|
15
|
+
has_value :vehicle_type, 39
|
16
|
+
has_value :plant_city, 31
|
17
|
+
has_value :body_class, 5
|
18
|
+
has_value :primary_fuel_type, 24
|
19
|
+
|
20
|
+
def initialize(variables)
|
21
|
+
@variables = variables
|
22
|
+
end
|
23
|
+
|
24
|
+
def inspect
|
25
|
+
"#<Vindetta::Decoder::Response:#{"0x00%x" % (object_id << 1)}>"
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_json
|
29
|
+
self.class.decoded_attributes.map do |a|
|
30
|
+
[a, send(a)]
|
31
|
+
end.to_h
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/vindetta/decoder.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
+
require "httparty"
|
2
|
+
require "vindetta/decoder/result"
|
3
|
+
|
1
4
|
module Vindetta
|
2
5
|
class Decoder
|
3
|
-
def self.
|
4
|
-
{
|
5
|
-
|
6
|
-
|
6
|
+
def self.decode_vin(vin)
|
7
|
+
result = HTTParty.get("https://vpic.nhtsa.dot.gov/api/vehicles/decodevin/#{vin}?format=json")
|
8
|
+
json = JSON.parse(result.body)
|
9
|
+
|
10
|
+
Result.new(json["Results"])
|
7
11
|
end
|
8
12
|
end
|
9
13
|
end
|
data/lib/vindetta/version.rb
CHANGED
data/lib/vindetta/vin/wmi.rb
CHANGED
@@ -8,7 +8,7 @@ module Vindetta
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def name
|
11
|
-
@name ||= self.class.data[value]
|
11
|
+
@name ||= self.class.data["wmi"][value]
|
12
12
|
end
|
13
13
|
|
14
14
|
alias eql? ==
|
@@ -17,6 +17,16 @@ module Vindetta
|
|
17
17
|
@vin[0..2].join("")
|
18
18
|
end
|
19
19
|
|
20
|
+
def region
|
21
|
+
@name ||= begin
|
22
|
+
regions = self.class.data["region"] # TODO: Pull this out into private method
|
23
|
+
|
24
|
+
regions.detect do |key, characters_for_region|
|
25
|
+
break key if characters_for_region.include?(value[0])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
20
30
|
def ==(other)
|
21
31
|
self.class == other.class && value == other.value
|
22
32
|
end
|
data/lib/vindetta/vin.rb
CHANGED
data/vindetta.gemspec
CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_dependency "activesupport", "~> 5.1"
|
27
27
|
spec.add_dependency "gli", "~> 2.16"
|
28
28
|
spec.add_dependency "i18n", "~> 0.8.6"
|
29
|
+
spec.add_dependency "httparty"
|
29
30
|
|
30
31
|
spec.add_development_dependency "bundler", "~> 1.14"
|
31
32
|
spec.add_development_dependency "factory_girl", "~> 4.8.0"
|
@@ -35,4 +36,5 @@ Gem::Specification.new do |spec|
|
|
35
36
|
spec.add_development_dependency "rspec", "~> 3.0"
|
36
37
|
spec.add_development_dependency "rubocop", "~> 0.49"
|
37
38
|
spec.add_development_dependency "webmock", "~> 3.0.1"
|
39
|
+
spec.add_development_dependency "vcr"
|
38
40
|
end
|
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.9.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: 2017-
|
11
|
+
date: 2017-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.8.6
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: httparty
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: bundler
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,6 +192,20 @@ dependencies:
|
|
178
192
|
- - "~>"
|
179
193
|
- !ruby/object:Gem::Version
|
180
194
|
version: 3.0.1
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: vcr
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
181
209
|
description: Ruby gem for generating VINs
|
182
210
|
email:
|
183
211
|
- kyle@joinroot.com
|
@@ -203,6 +231,8 @@ files:
|
|
203
231
|
- lib/vindetta/data/vis.yaml
|
204
232
|
- lib/vindetta/data/wmi.yaml
|
205
233
|
- lib/vindetta/decoder.rb
|
234
|
+
- lib/vindetta/decoder/dsl.rb
|
235
|
+
- lib/vindetta/decoder/result.rb
|
206
236
|
- lib/vindetta/errors.rb
|
207
237
|
- lib/vindetta/generator.rb
|
208
238
|
- lib/vindetta/locale/en.yml
|