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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0e5ac798de6c60873ca7e787a91d4b8421090c3
4
- data.tar.gz: c35914adec7b62dfe17dcd23374d208d8fb1fb85
3
+ metadata.gz: e4baf9d935e2302be92c84707413bdf67f48f57b
4
+ data.tar.gz: 4b0ac627aaab1781c7b2762014b7cc93a84cc6d9
5
5
  SHA512:
6
- metadata.gz: 5e067e17f02927de6f8349c9eae5a60bf8fa56a475f8362c0d13b479486337b8aa4c7f706a57e468bb18f43b0c668830cdfe62c15b366ab690badf6a662926ca
7
- data.tar.gz: c17141807d8af103e90dbabcd94c193625d1f8548b004283178d30c08dcfa4cd88069e8f05cd1955937e53d12257bbe36973e2a24615121fd06cd3ffe923dc90
6
+ metadata.gz: 8a56386f3f9a8d773f36e79212e566a0910b2a507adc58abf3f32c67b9df600cdac736f3f0d4e495af609cb547e659d5b52dedd2a976edd872b4d4d4c531c6bb
7
+ data.tar.gz: a287bb246656511f2acfcf1587fcf8a0a96f8bbeeb8c85785786ef557475702d4927d6710bfa1051898976f7a51fbd88f176a8d7d49ae2eeee07eb8ffee23abe
data/Gemfile CHANGED
@@ -1 +1,3 @@
1
+ gemspec
2
+
1
3
  gem 'rest-client', '>= 1.7.2'
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 config[:service]
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 config[:service]
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']['nationalBasePrice']['usedTmvRetail'],
75
- private_party: response['tmv']['nationalBasePrice']['usedPrivateParty'],
76
- trade_in: response['tmv']['nationalBasePrice']['usedTradeIn']
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
  )
@@ -1,3 +1,3 @@
1
1
  module VinData
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
data/vindata.gemspec CHANGED
@@ -13,4 +13,6 @@ Gem::Specification.new do |s|
13
13
  s.email = 'roupen@acdcorp.com'
14
14
  s.files = `git ls-files`.split("\n")
15
15
  s.homepage = 'https://github.com/orgs/acdcorp/'
16
+
17
+ s.add_runtime_dependency 'rest-client', '>= 1.7.2'
16
18
  end
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.5
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-03-18 00:00:00.000000000 Z
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.4.3
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.