vindetta 0.20.0 → 0.21.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/decoder.rb +18 -1
- data/lib/vindetta/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbb7bd146e8cb1be2d6c25683cf39e369e84c31e
|
4
|
+
data.tar.gz: 8b91097452ab832381d172339eeab56e977fdd35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d296b92b75413b251f278262d37ac7a55dcfe45b182e9e3e5572e84dbe9bb1ccd9d716d037f0fb865aa247d61d35ce837e0b297a0c9fcc0d9b17b41b2b3bfcee
|
7
|
+
data.tar.gz: c3b350e3dc000531d3f1bca6c8f0162fa438376a01e477292d94392ed430d02e3545ba2d516622fbf241707434de42776d5f35955eec23790702e963d1e828e5
|
data/lib/vindetta/decoder.rb
CHANGED
@@ -5,8 +5,25 @@ module Vindetta
|
|
5
5
|
:plant_code => vin[PLANT_CODE_INDEX],
|
6
6
|
:wmi => vin[WMI_RANGE],
|
7
7
|
:check_digit => vin[CHECK_DIGIT_INDEX],
|
8
|
-
:production_number => vin[PRODUCTION_NUMBER_RANGE]
|
8
|
+
:production_number => vin[PRODUCTION_NUMBER_RANGE],
|
9
|
+
:model_year => model_year(vin),
|
9
10
|
}
|
10
11
|
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def self.model_year(vin)
|
16
|
+
@years ||= YAML.load_file(File.expand_path("../data/vis.yaml", __FILE__))["year"]
|
17
|
+
@alpha ||= "ABCDEFGHJKLMNPRSTUVWXYZ".chars
|
18
|
+
|
19
|
+
tenth = vin[9]
|
20
|
+
seventh = vin[6]
|
21
|
+
|
22
|
+
if @alpha.include?(seventh)
|
23
|
+
@years[tenth].last
|
24
|
+
else
|
25
|
+
@years[tenth].first
|
26
|
+
end
|
27
|
+
end
|
11
28
|
end
|
12
29
|
end
|
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.21.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-01-
|
11
|
+
date: 2018-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|