vinquery 0.3.6 → 0.3.7

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vinquery (0.3.5)
4
+ vinquery (0.3.6)
5
5
  nokogiri (>= 1.4.4)
6
6
 
7
7
  GEM
@@ -10,7 +10,7 @@ GEM
10
10
  addressable (2.2.6)
11
11
  crack (0.1.8)
12
12
  diff-lcs (1.1.2)
13
- nokogiri (1.4.6)
13
+ nokogiri (1.5.0)
14
14
  rspec (2.6.0)
15
15
  rspec-core (~> 2.6.0)
16
16
  rspec-expectations (~> 2.6.0)
@@ -19,7 +19,7 @@ GEM
19
19
  rspec-expectations (2.6.0)
20
20
  diff-lcs (~> 1.1.2)
21
21
  rspec-mocks (2.6.0)
22
- vin_exploder (0.3.0)
22
+ vin_exploder (0.4.3)
23
23
  webmock (1.6.4)
24
24
  addressable (> 2.2.5, ~> 2.2)
25
25
  crack (>= 0.1.7)
@@ -29,6 +29,6 @@ PLATFORMS
29
29
 
30
30
  DEPENDENCIES
31
31
  rspec (>= 2.6.0)
32
- vin_exploder (>= 0.2.0)
32
+ vin_exploder (>= 0.4.0)
33
33
  vinquery!
34
34
  webmock (>= 1.6.4)
data/lib/vinquery.rb CHANGED
@@ -48,6 +48,7 @@ class Vinquery
48
48
  end
49
49
  if attributes.size > 0
50
50
  attributes[:vin] = doc.css('vin').first.attributes['number'].value
51
+ attributes[:vin_key] = make_vin_key(attributes[:vin])
51
52
  attributes[:vendor_result] = doc.to_xml
52
53
  end
53
54
  @attributes = attributes
@@ -62,5 +63,10 @@ class Vinquery
62
63
  def valid?
63
64
  @valid
64
65
  end
66
+
67
+ def make_vin_key(vin)
68
+ key = vin.slice(0,8)
69
+ key << vin.slice(9,2)
70
+ end
65
71
 
66
72
  end
@@ -1,3 +1,3 @@
1
1
  class Vinquery
2
- VERSION = '0.3.6'
2
+ VERSION = '0.3.7'
3
3
  end
@@ -22,7 +22,7 @@ describe Vinquery do
22
22
  @query.set_attributes(doc)
23
23
  # @query.attributes.each_pair{|k,v| puts "#{k} - #{v}"}
24
24
  @query.attributes[:body_style].should == "CREW CAB PICKUP 4-DR"
25
- @query.attributes.count.should == 171
25
+ @query.attributes[:vin_key].should == "3D7LU38C3G"
26
26
  end
27
27
 
28
28
  it 'should recover from poorly formatted or unexpected xml document' do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: vinquery
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.6
5
+ version: 0.3.7
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-07-22 00:00:00 Z
14
+ date: 2011-08-02 00:00:00 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: nokogiri