veezo-location-api 0.1.4 → 0.1.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db320625e6d07556c80fcee2ee2dfaaf4cb33a3dc7643e18f7af0f2e8407bde7
4
- data.tar.gz: 0b6feed2042dc9d70c3ee4c1b9e9608068012df169d404eee5307c23dd61ea88
3
+ metadata.gz: 60104b4e3af266f333c5fa14841357f7b8caa5ae107c4def570b55bb8d5875ee
4
+ data.tar.gz: 8e040da128c498e4f91f85b848eb15a89519c608043e288bb0b918c90c3d8e08
5
5
  SHA512:
6
- metadata.gz: f2e9ccd1a27e1023e76ec00fa9ca569a036a447218f13dab81e28a968727ed14715666c81939650bcb94148ad4610ca2d94d2b62d03f06470dc80b56e0c31e68
7
- data.tar.gz: 97f4d9d937afab2612a45545f8a908888f828877ed9e2b368978a49e7174bb38b3b6586f0fae80266d2b6b9f940a1de5dae2aac01c091d2451395cbb4dab7476
6
+ metadata.gz: 0e415985315466d95cafe2776eb70d1bd77776ec81ba0074a6f3d80e682e1d9bcdbb10aadf7a23ac7f826a4bea52779bea69d4a8964566d4f02ce188516e6b88
7
+ data.tar.gz: 879c811c6b1654f24a7528423d5f5c7c0e05123359addb24ce2f904521f46a7d834ddc5f8938ece967b6879b72180d3ae2d8a8529e4c8ff01c84bcdca428c7c8
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- veezo-location-api (0.1.4)
4
+ veezo-location-api (0.1.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'openssl'
3
4
  require 'net/http'
4
5
  require 'json'
5
6
  require 'veezo_location_api/response'
@@ -36,10 +37,14 @@ module VeezoLocationApi
36
37
 
37
38
  def request(uri, request)
38
39
  http_client = Net::HTTP.new(uri.host, uri.port).tap do |client|
39
- client.use_ssl = (uri.scheme == 'https')
40
+ client.use_ssl = (uri.scheme == "https")
41
+ client.verify_mode = OpenSSL::SSL::VERIFY_NONE
40
42
  end
41
43
 
44
+ p http_client
45
+ p request
42
46
  response = http_client.request(request)
47
+ p response
43
48
  response(response)
44
49
  rescue => error
45
50
  raise(VeezoLocationApiClientError, error)
@@ -47,10 +52,11 @@ module VeezoLocationApi
47
52
 
48
53
  def response(response)
49
54
  code = response.code.to_i
50
- success = (code == 200)
55
+ success = (code >= 200 || code < 300)
51
56
 
52
- if success && response.body.data.any?
53
- data = JSON.parse(response.body.data)
57
+ if success
58
+ temp_data = JSON.parse(response.body)
59
+ data = temp_data['data'] if temp_data['data'].any?
54
60
  end
55
61
 
56
62
  Response.new(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VeezoLocationApi
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veezo-location-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Barbiero
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2020-06-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Gsed to expose the methods used for integration with the api.
14
14
  email: