carsxe_api 0.1.0 → 0.1.3

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
  SHA256:
3
- metadata.gz: 772b4172d3b5d62ed495d7df5425a9b406c768c3eac13d11f9962321d3fc27e7
4
- data.tar.gz: 44d628c35bc5fa4243167c18945393b9cb47f1848fc04312fee373b0ce9bbea4
3
+ metadata.gz: c147dee79135e543eb382845344d55dac6282cedcc24385a1c02f8e22ad8526b
4
+ data.tar.gz: 708d47e4cdcb0edfe0fecb52766424e94c882c4c6102878b32cb2bc1dc83181a
5
5
  SHA512:
6
- metadata.gz: a770608822e3c69b813e280cbb72b54ef59419c489bac41a9edc284c837323305f259df48205731ee9b25edada1025a1c98de8f4f5266331dfbb31c57220bf8a
7
- data.tar.gz: 4ed981fbaf85ff326d7fe2d7d7f2d9e3ccd11439d8da91965468bac0d1f8225d5b67afecd80081c1076dcab7fbb4b25dbed4d13e3eb5c9f8c2aff3b1c9885b7b
6
+ metadata.gz: 942f3c4ab50e858e8e5ee7b1f8391b9332c17256c44824f98f4a8ec5d2d21db66fbe85e544d29be351dbc595019b83c3988b7fb5fb7ab4988148699f6c5fd8d9
7
+ data.tar.gz: 342acce5db6e6440d977d7f06ed41a753de48baed49a71979b93c739b14f3b26fa3096ffb23c54517d197cb1429dd9eb9748c8b52a0107c0e6020d736afe359a
data/CHANGELOG.md CHANGED
@@ -1,4 +1,21 @@
1
1
  ## [Unreleased]
2
+ - History
3
+ - Images
4
+ - What Car is That
5
+ - Plate Recognition
6
+ - OBD Codes Decoder
7
+
8
+ ## [0.1.3] - 2022-06-09
9
+ - Fixed bug where I put the market value function outside the class
10
+ - Added specifications API
11
+
12
+ ## [0.1.2] - 2022-06-09
13
+ - Actually fixed dotenv issue
14
+
15
+ ## [0.1.1] - 2022-06-09
16
+
17
+ - Fixing issue with dotenv
18
+ - Updated module name to match styling of company
2
19
 
3
20
  ## [0.1.0] - 2022-06-09
4
21
 
data/README.md CHANGED
@@ -17,7 +17,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
17
17
  #### Declare client
18
18
 
19
19
  ```ruby
20
- client = CarsxeApi::Client.new(ENV['CARS_XE_API_KEY'])
20
+ client = CarsXEApi::Client.new(ENV['CARS_XE_API_KEY'])
21
21
  ```
22
22
 
23
23
  #### Plate Decoder
@@ -30,15 +30,9 @@ data = client.plate_decoder('HOWDY12', 'TX')
30
30
  ```ruby
31
31
  data = client.market_value('ENTER_VIN_HERE')
32
32
  ```
33
- ## Development
34
-
35
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
36
-
37
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
38
-
39
33
  ## Contributing
40
34
 
41
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/carsxe_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/carsxe_api/blob/master/CODE_OF_CONDUCT.md).
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jippylong12/carsxe_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/jippylong12/carsxe_api/blob/master/CODE_OF_CONDUCT.md).
42
36
 
43
37
  ## License
44
38
 
@@ -46,4 +40,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
46
40
 
47
41
  ## Code of Conduct
48
42
 
49
- Everyone interacting in the CarsxeApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/carsxe_api/blob/master/CODE_OF_CONDUCT.md).
43
+ Everyone interacting in the CarsXEApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/jippylong12/carsxe_api/blob/master/CODE_OF_CONDUCT.md).
data/carsxe_api.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'net/http'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "carsxe_api"
8
- spec.version = CarsxeApi::VERSION
8
+ spec.version = CarsXEApi::VERSION
9
9
  spec.authors = ["marcus.salinas"]
10
10
  spec.email = ["12.marcus.salinas@gmail.com"]
11
11
 
@@ -1,4 +1,4 @@
1
- module CarsxeApi
1
+ module CarsXEApi
2
2
  class Client
3
3
  @@base_url = 'https://api.carsxe.com'
4
4
  @@api_key = ''
@@ -26,25 +26,44 @@ module CarsxeApi
26
26
  }
27
27
  end
28
28
  end
29
- end
30
29
 
31
- def market_value(vin, options={format: 'json'})
32
- uri = URI("#{@@base_url}/marketvalue")
33
- params = {key: @@api_key, vin: vin}
34
- params.merge!(options)
35
- uri.query = URI.encode_www_form(params)
36
- response = @http.get_response(uri)
37
- if response.code == "200"
38
- {
39
- success: true,
40
- data: JSON.parse(response.body)
41
- }
42
- else
43
- {
44
- success: false,
45
- data: {}
46
- }
30
+ def market_value(vin, options={format: 'json'})
31
+ uri = URI("#{@@base_url}/marketvalue")
32
+ params = {key: @@api_key, vin: vin}
33
+ params.merge!(options)
34
+ uri.query = URI.encode_www_form(params)
35
+ response = @http.get_response(uri)
36
+ if response.code == "200"
37
+ {
38
+ success: true,
39
+ data: JSON.parse(response.body)
40
+ }
41
+ else
42
+ {
43
+ success: false,
44
+ data: {}
45
+ }
46
+ end
47
47
  end
48
- end
49
48
 
49
+ def specifications(vin, options={format: 'json'})
50
+ uri = URI("#{@@base_url}/specs")
51
+ params = {key: @@api_key, vin: vin}
52
+ params.merge!(options)
53
+ uri.query = URI.encode_www_form(params)
54
+ response = @http.get_response(uri)
55
+ if response.code == "200"
56
+ {
57
+ success: true,
58
+ data: JSON.parse(response.body)
59
+ }
60
+ else
61
+ {
62
+ success: false,
63
+ data: {}
64
+ }
65
+ end
66
+ end
67
+
68
+ end
50
69
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module CarsxeApi
4
- VERSION = "0.1.0"
3
+ module CarsXEApi
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/carsxe_api.rb CHANGED
@@ -1,12 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
  require 'json'
3
- require 'dotenv/load'
3
+
4
+ begin
5
+ require 'dotenv/load'
6
+ rescue LoadError
7
+
8
+ end
4
9
 
5
10
  require_relative "carsxe_api/version"
6
11
 
7
12
  require_relative "carsxe_api/client"
8
13
 
9
- module CarsxeApi
14
+ module CarsXEApi
10
15
  class Error < StandardError; end
11
16
 
12
17
  end
data/sig/carsxe_api.rbs CHANGED
@@ -1,4 +1,4 @@
1
- module CarsxeApi
1
+ module CarsXEApi
2
2
  VERSION: String
3
3
  # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carsxe_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - marcus.salinas