vinquery 0.3.5 → 0.3.6

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.
@@ -1,3 +1,3 @@
1
1
  class Vinquery
2
- VERSION = '0.3.5'
2
+ VERSION = '0.3.6'
3
3
  end
@@ -31,8 +31,13 @@ module VinExploder
31
31
  def normalize(vq_hash)
32
32
  # fuel_type = vq_hash[:engine_type].match(/(GAS|DIESEL|HYBRID)/)[0]
33
33
  # driveline_type = vq_hash[:driveline].match(/(FWD|4WD|2WD)/)[0]
34
- door_number = vq_hash[:body_style].match(/(\d)-DR/)[1] unless vq_hash.empty?
35
- {:year => vq_hash.delete(:model_year), :number_of_doors => door_number}.merge(vq_hash)
34
+ unless vq_hash.empty?
35
+ doors_match = vq_hash[:body_style].match(/(\d)-DR/)
36
+ doors_match = (vq_hash[:body_style].match(/VAN/).nil? ? [0,0] : [5,5]) if doors_match.nil?
37
+ vq_hash[:number_of_doors] = doors_match[1]
38
+ vq_hash[:year] = vq_hash.delete(:model_year)
39
+ end
40
+ vq_hash
36
41
  end
37
42
 
38
43
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: vinquery
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.5
5
+ version: 0.3.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jake Mallory
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-06-28 00:00:00 Z
14
+ date: 2011-07-22 00:00:00 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: nokogiri
@@ -54,7 +54,7 @@ dependencies:
54
54
  requirements:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
- version: 0.2.0
57
+ version: 0.4.0
58
58
  type: :development
59
59
  version_requirements: *id004
60
60
  description: A client for the Vinquery.com vin decoding web service.