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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8dfed0d7c7a0c406c59017a6468cfa8e313a114
4
- data.tar.gz: 3976fb86a2f0f0d1da131afc050b8a194569c808
3
+ metadata.gz: bbb7bd146e8cb1be2d6c25683cf39e369e84c31e
4
+ data.tar.gz: 8b91097452ab832381d172339eeab56e977fdd35
5
5
  SHA512:
6
- metadata.gz: 861597ee5333726eb83c2486b4b8586d186f5c4b2529945cbd4cdeae49fd1e6b2f24cc0ea5a2a58ad1bf770a7e725ad29c7024e92fd4e8ef5e2670c43f684f0b
7
- data.tar.gz: '082362eb73ac1ebe451d5c2dc12f2edd22b2903523f9cb49f92b0c00aa47cc1cbb2e6a99f9b6734db2fee48221f26f6486cd8714689319c1d5b5ac5594cd0856'
6
+ metadata.gz: d296b92b75413b251f278262d37ac7a55dcfe45b182e9e3e5572e84dbe9bb1ccd9d716d037f0fb865aa247d61d35ce837e0b297a0c9fcc0d9b17b41b2b3bfcee
7
+ data.tar.gz: c3b350e3dc000531d3f1bca6c8f0162fa438376a01e477292d94392ed430d02e3545ba2d516622fbf241707434de42776d5f35955eec23790702e963d1e828e5
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Vindetta
2
- VERSION = "0.20.0".freeze
2
+ VERSION = "0.21.0".freeze
3
3
  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.20.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-16 00:00:00.000000000 Z
11
+ date: 2018-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli