vindata 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/vindata.rb +4 -4
- data/lib/vindata/services/edmunds.rb +8 -7
- data/lib/vindata/services/nada.rb +4 -4
- data/lib/vindata/version.rb +1 -1
- data/vindata.gemspec +2 -0
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4baf9d935e2302be92c84707413bdf67f48f57b
|
4
|
+
data.tar.gz: 4b0ac627aaab1781c7b2762014b7cc93a84cc6d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a56386f3f9a8d773f36e79212e566a0910b2a507adc58abf3f32c67b9df600cdac736f3f0d4e495af609cb547e659d5b52dedd2a976edd872b4d4d4c531c6bb
|
7
|
+
data.tar.gz: a287bb246656511f2acfcf1587fcf8a0a96f8bbeeb8c85785786ef557475702d4927d6710bfa1051898976f7a51fbd88f176a8d7d49ae2eeee07eb8ffee23abe
|
data/Gemfile
CHANGED
data/lib/vindata.rb
CHANGED
@@ -6,13 +6,13 @@ require 'vindata/configuration'
|
|
6
6
|
require 'vindata/services'
|
7
7
|
|
8
8
|
module VinData
|
9
|
-
def self.details_by_vin vin
|
10
|
-
service = Services.get
|
9
|
+
def self.details_by_vin vin, service = config[:service]
|
10
|
+
service = Services.get service
|
11
11
|
service.details_by_vin vin
|
12
12
|
end
|
13
13
|
|
14
|
-
def self.get_acv data
|
15
|
-
service = Services.get
|
14
|
+
def self.get_acv data, service = config[:service]
|
15
|
+
service = Services.get service
|
16
16
|
service.get_acv data
|
17
17
|
end
|
18
18
|
end
|
@@ -16,7 +16,7 @@ module VinData::Services
|
|
16
16
|
begin
|
17
17
|
response = JSON.parse(RestClient.get vinlookup, {:params => {
|
18
18
|
fmt: 'json',
|
19
|
-
api_key: configuration[:api_key]
|
19
|
+
api_key: configuration[:edmunds][:api_key]
|
20
20
|
}})
|
21
21
|
|
22
22
|
# TODO: Check data validity here
|
@@ -24,7 +24,8 @@ module VinData::Services
|
|
24
24
|
return {
|
25
25
|
make: response['make']['niceName'],
|
26
26
|
model: response['model']['niceName'],
|
27
|
-
year: response['years'][0]['year']
|
27
|
+
year: response['years'][0]['year'],
|
28
|
+
edmunds: response
|
28
29
|
}
|
29
30
|
# Indicates VIN request failed with Edmunds
|
30
31
|
rescue RestClient::BadRequest => err
|
@@ -50,7 +51,7 @@ module VinData::Services
|
|
50
51
|
stylelookup = base_url + data[:make] + '/' + data[:model] + '/' + data[:year].to_s + '/styles'
|
51
52
|
response = JSON.parse(RestClient.get stylelookup, {:params => {
|
52
53
|
fmt: 'json',
|
53
|
-
api_key: configuration[:api_key]
|
54
|
+
api_key: configuration[:edmunds][:api_key]
|
54
55
|
}})
|
55
56
|
|
56
57
|
# TODO: Check data validity here
|
@@ -62,7 +63,7 @@ module VinData::Services
|
|
62
63
|
mileage: data[:mileage],
|
63
64
|
zip: data[:zip],
|
64
65
|
fmt: 'json',
|
65
|
-
api_key: configuration[:api_key]
|
66
|
+
api_key: configuration[:edmunds][:api_key]
|
66
67
|
}})
|
67
68
|
|
68
69
|
# TODO: Check data validity here
|
@@ -71,9 +72,9 @@ module VinData::Services
|
|
71
72
|
else
|
72
73
|
return {
|
73
74
|
common: {
|
74
|
-
retail: response['tmv']['
|
75
|
-
private_party: response['tmv']['
|
76
|
-
trade_in: response['tmv']['
|
75
|
+
retail: response['tmv']['totalWithOptions']['usedTmvRetail'],
|
76
|
+
private_party: response['tmv']['totalWithOptions']['usedPrivateParty'],
|
77
|
+
trade_in: response['tmv']['totalWithOptions']['usedTradeIn']
|
77
78
|
},
|
78
79
|
edmunds: response
|
79
80
|
}
|
@@ -28,8 +28,8 @@ module VinData::Services
|
|
28
28
|
# we don't want to get the token every time
|
29
29
|
# return @token if @token.present?
|
30
30
|
|
31
|
-
fail 'NADA requires username and password' unless configuration[:username].present? &&
|
32
|
-
configuration[:password].present?
|
31
|
+
fail 'NADA requires username and password' unless configuration[:nada][:username].present? &&
|
32
|
+
configuration[:nada][:password].present?
|
33
33
|
|
34
34
|
wsdl_path = File.expand_path(File.join(File.dirname(__FILE__), '../wsdls/ProdSecureLogin.wsdl'))
|
35
35
|
# do auth login to get token
|
@@ -43,8 +43,8 @@ module VinData::Services
|
|
43
43
|
)
|
44
44
|
data = client.call(:get_token,
|
45
45
|
message: { 'tokenRequest' =>
|
46
|
-
{ 'Username' => configuration[:username],
|
47
|
-
'Password' => configuration[:password]
|
46
|
+
{ 'Username' => configuration[:nada][:username],
|
47
|
+
'Password' => configuration[:nada][:password]
|
48
48
|
}
|
49
49
|
}
|
50
50
|
)
|
data/lib/vindata/version.rb
CHANGED
data/vindata.gemspec
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vindata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roupen Mouradian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
12
|
-
dependencies:
|
11
|
+
date: 2015-07-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.7.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.7.2
|
13
27
|
description: Library which queries vehicle databases such as Edmunds for publicly
|
14
28
|
available vehicle information using VIN number
|
15
29
|
email: roupen@acdcorp.com
|
@@ -52,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
66
|
version: '0'
|
53
67
|
requirements: []
|
54
68
|
rubyforge_project:
|
55
|
-
rubygems_version: 2.
|
69
|
+
rubygems_version: 2.2.2
|
56
70
|
signing_key:
|
57
71
|
specification_version: 4
|
58
72
|
summary: Query popular VIN databases to get vehicle information.
|