vin_query 1.0.0
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/.gitignore +6 -0
- data/.rspec +1 -0
- data/.travis.yml +10 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +5 -0
- data/LICENSE +22 -0
- data/README.md +56 -0
- data/Rakefile +7 -0
- data/lib/vin_query.rb +14 -0
- data/lib/vin_query/exceptions.rb +12 -0
- data/lib/vin_query/query.rb +83 -0
- data/lib/vin_query/trim_level.rb +17 -0
- data/lib/vin_query/version.rb +5 -0
- data/spec/fixtures/error.xml +6 -0
- data/spec/fixtures/success_multi.xml +685 -0
- data/spec/fixtures/success_single.xml +175 -0
- data/spec/lib/vin_query/query_spec.rb +135 -0
- data/spec/lib/vin_query/trim_level_spec.rb +27 -0
- data/spec/spec_helper.rb +2 -0
- data/vin_query.gemspec +25 -0
- metadata +104 -0
@@ -0,0 +1,175 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
2
|
+
<VINquery Version="1.0.0" Report_Type="EXTENDED" Date="10/22/2012">
|
3
|
+
<VIN Number="2G1WT57K291223396" Status="SUCCESS">
|
4
|
+
<Vehicle VINquery_Vehicle_ID="37163" Model_Year="2009" Make="Chevrolet" Model="Impala" Trim_Level="LT">
|
5
|
+
<Item Key="VINquery_Vehicle_ID" Value="37163" Unit="" />
|
6
|
+
<Item Key="Model Year" Value="2009" Unit="" />
|
7
|
+
<Item Key="Make" Value="Chevrolet" Unit="" />
|
8
|
+
<Item Key="Model" Value="Impala" Unit="" />
|
9
|
+
<Item Key="Trim Level" Value="LT" Unit="" />
|
10
|
+
<Item Key="Manufactured in" Value="CANADA" Unit="" />
|
11
|
+
<Item Key="Production Seq. Number" Value="223396" Unit="" />
|
12
|
+
<Item Key="Body Style" Value="SEDAN 4-DR" Unit="" />
|
13
|
+
<Item Key="Engine Type" Value="3.5L V6 OHV 12V FFV" Unit="" />
|
14
|
+
<Item Key="Transmission-short" Value="4A" Unit="" />
|
15
|
+
<Item Key="Transmission-long" Value="4-Speed Automatic" Unit="" />
|
16
|
+
<Item Key="Driveline" Value="FWD" Unit="" />
|
17
|
+
<Item Key="Tank" Value="17.00" Unit="gallon" />
|
18
|
+
<Item Key="Fuel Economy-city" Value="18 - 19" Unit="miles/gallon" />
|
19
|
+
<Item Key="Fuel Economy-highway" Value="29" Unit="miles/gallon" />
|
20
|
+
<Item Key="Anti-Brake System" Value="4-Wheel ABS" Unit="" />
|
21
|
+
<Item Key="Steering Type" Value="R&P" Unit="" />
|
22
|
+
<Item Key="Front Brake Type" Value="Disc" Unit="" />
|
23
|
+
<Item Key="Rear Brake Type" Value="Disc" Unit="" />
|
24
|
+
<Item Key="Turning Diameter" Value="38.00" Unit="in." />
|
25
|
+
<Item Key="Front Suspension" Value="Ind" Unit="" />
|
26
|
+
<Item Key="Rear Suspension" Value="Ind" Unit="" />
|
27
|
+
<Item Key="Front Spring Type" Value="Coil" Unit="" />
|
28
|
+
<Item Key="Rear Spring Type" Value="Coil" Unit="" />
|
29
|
+
<Item Key="Tires" Value="225/60R16" Unit="" />
|
30
|
+
<Item Key="Front Headroom" Value="39.40" Unit="in." />
|
31
|
+
<Item Key="Rear Headroom" Value="37.80" Unit="in." />
|
32
|
+
<Item Key="Front Legroom" Value="42.30" Unit="in." />
|
33
|
+
<Item Key="Rear Legroom" Value="37.60" Unit="in." />
|
34
|
+
<Item Key="Front Shoulder Room" Value="58.70" Unit="in." />
|
35
|
+
<Item Key="Rear Shoulder Room" Value="58.60" Unit="in." />
|
36
|
+
<Item Key="Front Hip Room" Value="56.40" Unit="in." />
|
37
|
+
<Item Key="Rear Hip Room" Value="57.20" Unit="in." />
|
38
|
+
<Item Key="Interior Trim" Value="Ebony Cloth Interior | Gray Cloth Interior | Neutral Cloth Interior" Unit="" />
|
39
|
+
<Item Key="Exterior Color" Value="Aqua Blue Metallic | Black | Cyber Gray Metallic | Dark Silver Metallic | Gold Mist Metallic | Imperial Blue Metallic | Mocha Bronze Metallic | Red Jewel Tintcoat | Silver Ice Metallic | Slate Metallic | Victory Red | White" Unit="" />
|
40
|
+
<Item Key="Curb Weight-automatic" Value="3555" Unit="lbs" />
|
41
|
+
<Item Key="Curb Weight-manual" Value="No data" Unit="lbs" />
|
42
|
+
<Item Key="Overall Length" Value="200.40" Unit="in." />
|
43
|
+
<Item Key="Overall Width" Value="72.90" Unit="in." />
|
44
|
+
<Item Key="Overall Height" Value="58.70" Unit="in." />
|
45
|
+
<Item Key="Wheelbase" Value="110.50" Unit="in." />
|
46
|
+
<Item Key="Ground Clearance" Value="No data" Unit="in." />
|
47
|
+
<Item Key="Track Front" Value="62.40" Unit="in." />
|
48
|
+
<Item Key="Track Rear" Value="61.50" Unit="in." />
|
49
|
+
<Item Key="Cargo Length" Value="No data" Unit="in." />
|
50
|
+
<Item Key="Width at Wheelwell" Value="No data" Unit="in." />
|
51
|
+
<Item Key="Width at Wall" Value="No data" Unit="in." />
|
52
|
+
<Item Key="Depth" Value="No data" Unit="in." />
|
53
|
+
<Item Key="Standard Seating" Value="5" Unit="" />
|
54
|
+
<Item Key="Optional Seating" Value="6" Unit="" />
|
55
|
+
<Item Key="Passenger Volume" Value="No data" Unit="cu.ft." />
|
56
|
+
<Item Key="Cargo Volume" Value="18.60" Unit="cu.ft." />
|
57
|
+
<Item Key="Standard Towing" Value="No data" Unit="lbs" />
|
58
|
+
<Item Key="Maximum Towing" Value="No data" Unit="lbs" />
|
59
|
+
<Item Key="Standard Payload" Value="No data" Unit="lbs" />
|
60
|
+
<Item Key="Maximum Payload" Value="No data" Unit="lbs" />
|
61
|
+
<Item Key="Standard GVWR" Value="No data" Unit="lbs" />
|
62
|
+
<Item Key="Maximum GVWR" Value="No data" Unit="lbs" />
|
63
|
+
<Item Key="Basic-duration" Value="36" Unit="month" />
|
64
|
+
<Item Key="Basic-distance" Value="36,000" Unit="mile" />
|
65
|
+
<Item Key="Powertrain-duration" Value="60" Unit="month" />
|
66
|
+
<Item Key="Powertrain-distance" Value="100,000" Unit="mile" />
|
67
|
+
<Item Key="Rust-duration" Value="72" Unit="month" />
|
68
|
+
<Item Key="Rust-distance" Value="100,000" Unit="mile" />
|
69
|
+
<Item Key="MSRP" Value="$24,645" Unit="USD" />
|
70
|
+
<Item Key="Dealer Invoice" Value="$23,290" Unit="USD" />
|
71
|
+
<Item Key="Destination Charge" Value="$750" Unit="USD" />
|
72
|
+
<Item Key="Child Safety Door Locks" Value="Std." Unit="" />
|
73
|
+
<Item Key="Locking Pickup Truck Tailgate" Value="N/A" Unit="" />
|
74
|
+
<Item Key="Power Door Locks" Value="Std." Unit="" />
|
75
|
+
<Item Key="Vehicle Anti-Theft" Value="Std." Unit="" />
|
76
|
+
<Item Key="4WD/AWD" Value="N/A" Unit="" />
|
77
|
+
<Item Key="ABS Brakes" Value="Std." Unit="" />
|
78
|
+
<Item Key="Automatic Load-Leveling" Value="N/A" Unit="" />
|
79
|
+
<Item Key="Electronic Brake Assistance" Value="N/A" Unit="" />
|
80
|
+
<Item Key="Limited Slip Differential" Value="N/A" Unit="" />
|
81
|
+
<Item Key="Locking Differential" Value="N/A" Unit="" />
|
82
|
+
<Item Key="Traction Control" Value="Std." Unit="" />
|
83
|
+
<Item Key="Vehicle Stability Control System" Value="N/A" Unit="" />
|
84
|
+
<Item Key="Driver Airbag" Value="Std." Unit="" />
|
85
|
+
<Item Key="Front Side Airbag" Value="Std." Unit="" />
|
86
|
+
<Item Key="Front Side Airbag with Head Protection" Value="Std." Unit="" />
|
87
|
+
<Item Key="Passenger Airbag" Value="Std." Unit="" />
|
88
|
+
<Item Key="Side Head Curtain Airbag" Value="Std." Unit="" />
|
89
|
+
<Item Key="Second Row Side Airbag" Value="N/A" Unit="" />
|
90
|
+
<Item Key="Second Row Side Airbag with Head Protection" Value="N/A" Unit="" />
|
91
|
+
<Item Key="Electronic Parking Aid" Value="N/A" Unit="" />
|
92
|
+
<Item Key="First Aid Kit" Value="N/A" Unit="" />
|
93
|
+
<Item Key="Trunk Anti-Trap Device" Value="Std." Unit="" />
|
94
|
+
<Item Key="Keyless Entry" Value="Std." Unit="" />
|
95
|
+
<Item Key="Remote Ignition" Value="Std." Unit="" />
|
96
|
+
<Item Key="Air Conditioning" Value="Std." Unit="" />
|
97
|
+
<Item Key="Separate Driver/Front Passenger Climate Controls" Value="Std." Unit="" />
|
98
|
+
<Item Key="Cruise Control" Value="Std." Unit="" />
|
99
|
+
<Item Key="Tachometer" Value="Std." Unit="" />
|
100
|
+
<Item Key="Tilt Steering" Value="Std." Unit="" />
|
101
|
+
<Item Key="Tilt Steering Column" Value="Std." Unit="" />
|
102
|
+
<Item Key="Heated Steering Wheel" Value="N/A" Unit="" />
|
103
|
+
<Item Key="Leather Steering Wheel" Value="Opt." Unit="" />
|
104
|
+
<Item Key="Steering Wheel Mounted Controls" Value="Std." Unit="" />
|
105
|
+
<Item Key="Telescopic Steering Column" Value="N/A" Unit="" />
|
106
|
+
<Item Key="Adjustable Foot Pedals" Value="N/A" Unit="" />
|
107
|
+
<Item Key="Genuine Wood Trim" Value="N/A" Unit="" />
|
108
|
+
<Item Key="Tire Pressure Monitor" Value="Std." Unit="" />
|
109
|
+
<Item Key="Trip Computer" Value="Std." Unit="" />
|
110
|
+
<Item Key="AM/FM Radio" Value="Std." Unit="" />
|
111
|
+
<Item Key="Cassette Player" Value="N/A" Unit="" />
|
112
|
+
<Item Key="CD Player" Value="Std." Unit="" />
|
113
|
+
<Item Key="CD Changer" Value="N/A" Unit="" />
|
114
|
+
<Item Key="DVD Player" Value="Opt." Unit="" />
|
115
|
+
<Item Key="Voice Activated Telephone" Value="Std." Unit="" />
|
116
|
+
<Item Key="Navigation Aid" Value="N/A" Unit="" />
|
117
|
+
<Item Key="Second Row Sound Controls" Value="N/A" Unit="" />
|
118
|
+
<Item Key="Subwoofer" Value="N/A" Unit="" />
|
119
|
+
<Item Key="Telematics System" Value="Std." Unit="" />
|
120
|
+
<Item Key="Driver Multi-Adjustable Power Seat" Value="Std." Unit="" />
|
121
|
+
<Item Key="Front Cooled Seat" Value="N/A" Unit="" />
|
122
|
+
<Item Key="Front Heated Seat" Value="Opt." Unit="" />
|
123
|
+
<Item Key="Front Power Lumbar Support" Value="N/A" Unit="" />
|
124
|
+
<Item Key="Front Power Memory Seat" Value="N/A" Unit="" />
|
125
|
+
<Item Key="Front Split Bench Seat" Value="Opt." Unit="" />
|
126
|
+
<Item Key="Leather Seat" Value="Opt." Unit="" />
|
127
|
+
<Item Key="Passenger Multi-Adjustable Power Seat" Value="Opt." Unit="" />
|
128
|
+
<Item Key="Second Row Folding Seat" Value="Opt." Unit="" />
|
129
|
+
<Item Key="Second Row Heated Seat" Value="N/A" Unit="" />
|
130
|
+
<Item Key="Second Row Multi-Adjustable Power Seat" Value="N/A" Unit="" />
|
131
|
+
<Item Key="Second Row Removable Seat" Value="N/A" Unit="" />
|
132
|
+
<Item Key="Third Row Removable Seat" Value="N/A" Unit="" />
|
133
|
+
<Item Key="Cargo Area Cover" Value="N/A" Unit="" />
|
134
|
+
<Item Key="Cargo Area Tiedowns" Value="N/A" Unit="" />
|
135
|
+
<Item Key="Cargo Net" Value="Std." Unit="" />
|
136
|
+
<Item Key="Load Bearing Exterior Rack" Value="N/A" Unit="" />
|
137
|
+
<Item Key="Pickup Truck Bed Liner" Value="N/A" Unit="" />
|
138
|
+
<Item Key="Power Sunroof" Value="Opt." Unit="" />
|
139
|
+
<Item Key="Removable Top" Value="N/A" Unit="" />
|
140
|
+
<Item Key="Manual Sunroof" Value="Opt." Unit="" />
|
141
|
+
<Item Key="Automatic Headlights" Value="Std." Unit="" />
|
142
|
+
<Item Key="Daytime Running Lights" Value="Std." Unit="" />
|
143
|
+
<Item Key="Fog Lights" Value="N/A" Unit="" />
|
144
|
+
<Item Key="High Intensity Discharge Headlights" Value="N/A" Unit="" />
|
145
|
+
<Item Key="Pickup Truck Cargo Box Light" Value="N/A" Unit="" />
|
146
|
+
<Item Key="Running Boards" Value="N/A" Unit="" />
|
147
|
+
<Item Key="Front Air Dam" Value="Std." Unit="" />
|
148
|
+
<Item Key="Rear Spoiler" Value="Opt." Unit="" />
|
149
|
+
<Item Key="Skid Plate" Value="N/A" Unit="" />
|
150
|
+
<Item Key="Splash Guards" Value="Opt." Unit="" />
|
151
|
+
<Item Key="Wind Deflector for Convertibles" Value="N/A" Unit="" />
|
152
|
+
<Item Key="Power Sliding Side Van Door" Value="N/A" Unit="" />
|
153
|
+
<Item Key="Power Trunk Lid" Value="N/A" Unit="" />
|
154
|
+
<Item Key="Alloy Wheels" Value="Std." Unit="" />
|
155
|
+
<Item Key="Chrome Wheels" Value="N/A" Unit="" />
|
156
|
+
<Item Key="Full Size Spare Tire" Value="N/A" Unit="" />
|
157
|
+
<Item Key="Run Flat Tires" Value="N/A" Unit="" />
|
158
|
+
<Item Key="Steel Wheels" Value="N/A" Unit="" />
|
159
|
+
<Item Key="Power Windows" Value="Std." Unit="" />
|
160
|
+
<Item Key="Electrochromic Exterior Rearview Mirror" Value="N/A" Unit="" />
|
161
|
+
<Item Key="Glass Rear Window on Convertible" Value="N/A" Unit="" />
|
162
|
+
<Item Key="Heated Exterior Mirror" Value="Opt." Unit="" />
|
163
|
+
<Item Key="Electrochromic Interior Rearview Mirror" Value="Opt." Unit="" />
|
164
|
+
<Item Key="Power Adjustable Exterior Mirror" Value="Std." Unit="" />
|
165
|
+
<Item Key="Deep Tinted Glass" Value="N/A" Unit="" />
|
166
|
+
<Item Key="Interval Wipers" Value="Std." Unit="" />
|
167
|
+
<Item Key="Rain Sensing Wipers" Value="N/A" Unit="" />
|
168
|
+
<Item Key="Rear Window Defogger" Value="Std." Unit="" />
|
169
|
+
<Item Key="Rear Wiper" Value="N/A" Unit="" />
|
170
|
+
<Item Key="Sliding Rear Pickup Truck Window" Value="N/A" Unit="" />
|
171
|
+
<Item Key="Tow Hitch Receiver" Value="N/A" Unit="" />
|
172
|
+
<Item Key="Towing Preparation Package" Value="N/A" Unit="" />
|
173
|
+
</Vehicle>
|
174
|
+
</VIN>
|
175
|
+
</VINquery>
|
@@ -0,0 +1,135 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe VinQuery::Query do
|
5
|
+
|
6
|
+
let(:client) { VinQuery::Query.new('2G1WT57K291223396',
|
7
|
+
:url => 'http://www.vinquery.com/asdf/asdf.aspx',
|
8
|
+
:access_code => 'asdf1234-asdf1234-asdf1234') }
|
9
|
+
|
10
|
+
let(:xml_error) { File.read(File.join('spec', 'fixtures', 'error.xml')) }
|
11
|
+
let(:xml_multi) { File.read(File.join('spec', 'fixtures', 'success_multi.xml')) }
|
12
|
+
let(:xml_single) { File.read(File.join('spec', 'fixtures', 'success_single.xml')) }
|
13
|
+
|
14
|
+
describe '#initialize' do
|
15
|
+
it 'stores the complete URL of the VinQuery request (with default report type)' do
|
16
|
+
expect(client.url).to eq "http://www.vinquery.com/asdf/asdf.aspx?accessCode=asdf1234-asdf1234-asdf1234&vin=2G1WT57K291223396&reportType=2"
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'creates an empty array of trim levels' do
|
20
|
+
expect(client.trim_levels).to eq []
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#validate' do
|
25
|
+
context 'when response is successful' do
|
26
|
+
it 'is valid' do
|
27
|
+
client.validate xml_single
|
28
|
+
expect(client.valid?).to eq true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'when response is an error' do
|
33
|
+
it 'is not valid' do
|
34
|
+
client.validate xml_error
|
35
|
+
expect(client.valid?).to eq false
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '#parse' do
|
41
|
+
context 'when a single trim level is returned' do
|
42
|
+
before(:each) { client.parse xml_single }
|
43
|
+
|
44
|
+
it 'populates an array of trim levels with 1 trim level' do
|
45
|
+
expect(client.trim_levels.size).to be 1
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'has an array of VinQuery::TrimLevel objects' do
|
49
|
+
expect(client.trim_levels.first).to be_an_instance_of VinQuery::TrimLevel
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'has a trim level with vin and VinQuery attributes' do
|
53
|
+
expect(client.trim_levels.first.vin).to eq '2G1WT57K291223396'
|
54
|
+
|
55
|
+
expect(client.trim_levels.first.attributes[:model_year]).to eq '2009'
|
56
|
+
expect(client.trim_levels.first.attributes[:make]).to eq 'Chevrolet'
|
57
|
+
expect(client.trim_levels.first.attributes[:model]).to eq 'Impala'
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'has a trim level with units appended to attributes if units are given' do
|
61
|
+
expect(client.trim_levels.first.attributes[:tank]).to eq '17.00 gallon'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context 'when multiple trim levels are returned' do
|
66
|
+
before(:each) { client.parse xml_multi }
|
67
|
+
|
68
|
+
it 'populates an array of trim levels with the number of trim levels' do
|
69
|
+
expect(client.trim_levels.size).to be 4
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'has an array of VinQuery::TrimLevel objects' do
|
73
|
+
expect(client.trim_levels.first).to be_an_instance_of VinQuery::TrimLevel
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'has the correct first trim level from xml' do
|
77
|
+
expect(client.trim_levels.first.attributes[:make]).to eq 'Nissan'
|
78
|
+
expect(client.trim_levels.first.attributes[:model]).to eq 'Sentra'
|
79
|
+
expect(client.trim_levels.first.attributes[:trim_level]).to eq '2.0'
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'has the correct last trim level from xml' do
|
83
|
+
expect(client.trim_levels.last.attributes[:make]).to eq 'Nissan'
|
84
|
+
expect(client.trim_levels.last.attributes[:model]).to eq 'Sentra'
|
85
|
+
expect(client.trim_levels.last.attributes[:trim_level]).to eq '2.0 SR'
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context 'when error is returned' do
|
90
|
+
it 'raises a VinQuery::ParseError' do
|
91
|
+
expect{ client.parse(xml_error) }.to raise_error VinQuery::ParseError
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
describe '#get' do
|
97
|
+
context 'success response' do
|
98
|
+
before(:each) do
|
99
|
+
client.stub(:fetch).and_return xml_multi
|
100
|
+
client.get
|
101
|
+
end
|
102
|
+
|
103
|
+
it 'fetches xml and response is valid' do
|
104
|
+
expect(client.valid?).to be true
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'has 0 trim levels' do
|
108
|
+
expect(client.trim_levels.size).to eq 4
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
context 'error response' do
|
113
|
+
before(:each) do
|
114
|
+
client.stub(:fetch).and_return xml_error
|
115
|
+
client.get
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'fetches xml and response is not valid' do
|
119
|
+
expect(client.valid?).to be false
|
120
|
+
end
|
121
|
+
|
122
|
+
it 'has 0 trim levels' do
|
123
|
+
expect(client.trim_levels.size).to eq 0
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
context '404 response' do
|
128
|
+
before(:each) { client.stub(:fetch).and_return '<html>404</html>' }
|
129
|
+
|
130
|
+
it 'fetches xml and response cannot be validated' do
|
131
|
+
expect{ client.get }.to raise_error VinQuery::ValidationError
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe VinQuery::TrimLevel do
|
5
|
+
describe '#initialize' do
|
6
|
+
let(:trim) { trim = VinQuery::TrimLevel.new('2G1WT57K291223396', {
|
7
|
+
:model_year => '2009',
|
8
|
+
:make => 'Chevrolet',
|
9
|
+
:model => 'Impala',
|
10
|
+
:trim_level => 'LT' }) }
|
11
|
+
|
12
|
+
it 'have a vin class attribute' do
|
13
|
+
expect(trim.vin).to eq '2G1WT57K291223396'
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'creates a hash of VinQuery attributes' do
|
17
|
+
expect(trim.attributes[:model_year]).to eq '2009'
|
18
|
+
expect(trim.attributes[:make]).to eq 'Chevrolet'
|
19
|
+
expect(trim.attributes[:model]).to eq 'Impala'
|
20
|
+
expect(trim.attributes[:trim_level]).to eq 'LT'
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'has a description string of VIN and trim level' do
|
24
|
+
expect(trim.to_s).to eq '2G1WT57K291223396 - LT'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/spec/spec_helper.rb
ADDED
data/vin_query.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/vin_query/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = 'vin_query'
|
6
|
+
gem.version = VinQuery::VERSION
|
7
|
+
gem.platform = Gem::Platform::RUBY
|
8
|
+
|
9
|
+
gem.summary = 'A ruby library for accessing vinquery.com'
|
10
|
+
gem.description = 'A ruby library for fetching and parsing VIN information from vinquery.com, a vehicle identification number decoding service.'
|
11
|
+
gem.homepage = 'https://github.com/jyunderwood/vin_query'
|
12
|
+
|
13
|
+
gem.authors = ['Jonathan Underwood']
|
14
|
+
gem.email = ['jonathan@jyunderwood.com']
|
15
|
+
|
16
|
+
gem.date = Date.today.to_s
|
17
|
+
gem.files = `git ls-files`.split($\)
|
18
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
19
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
20
|
+
gem.require_paths = ['lib']
|
21
|
+
|
22
|
+
gem.add_dependency 'nokogiri', '~> 1.5.6'
|
23
|
+
|
24
|
+
gem.add_development_dependency 'rspec'
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vin_query
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jonathan Underwood
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-05 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nokogiri
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.5.6
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.5.6
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
description: A ruby library for fetching and parsing VIN information from vinquery.com,
|
47
|
+
a vehicle identification number decoding service.
|
48
|
+
email:
|
49
|
+
- jonathan@jyunderwood.com
|
50
|
+
executables: []
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- .gitignore
|
55
|
+
- .rspec
|
56
|
+
- .travis.yml
|
57
|
+
- CHANGELOG.md
|
58
|
+
- Gemfile
|
59
|
+
- LICENSE
|
60
|
+
- README.md
|
61
|
+
- Rakefile
|
62
|
+
- lib/vin_query.rb
|
63
|
+
- lib/vin_query/exceptions.rb
|
64
|
+
- lib/vin_query/query.rb
|
65
|
+
- lib/vin_query/trim_level.rb
|
66
|
+
- lib/vin_query/version.rb
|
67
|
+
- spec/fixtures/error.xml
|
68
|
+
- spec/fixtures/success_multi.xml
|
69
|
+
- spec/fixtures/success_single.xml
|
70
|
+
- spec/lib/vin_query/query_spec.rb
|
71
|
+
- spec/lib/vin_query/trim_level_spec.rb
|
72
|
+
- spec/spec_helper.rb
|
73
|
+
- vin_query.gemspec
|
74
|
+
homepage: https://github.com/jyunderwood/vin_query
|
75
|
+
licenses: []
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options: []
|
78
|
+
require_paths:
|
79
|
+
- lib
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
requirements: []
|
93
|
+
rubyforge_project:
|
94
|
+
rubygems_version: 1.8.23
|
95
|
+
signing_key:
|
96
|
+
specification_version: 3
|
97
|
+
summary: A ruby library for accessing vinquery.com
|
98
|
+
test_files:
|
99
|
+
- spec/fixtures/error.xml
|
100
|
+
- spec/fixtures/success_multi.xml
|
101
|
+
- spec/fixtures/success_single.xml
|
102
|
+
- spec/lib/vin_query/query_spec.rb
|
103
|
+
- spec/lib/vin_query/trim_level_spec.rb
|
104
|
+
- spec/spec_helper.rb
|