angie-core-api 0.5.0 → 0.5.4

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: 165d3139d17e5cbbe90d75bd204e4107919a8ec837ff5ffeaa945885f3a2ecc7
4
- data.tar.gz: 1a2eb2d0eac4be055898717168d5e60f0e5131a96395dc56f02e7b987463ec6c
3
+ metadata.gz: 35be3160201584bd679bd6c7645a5894a08ee1d9412fa52b335914650a954472
4
+ data.tar.gz: fc677333b035ba12bb5708c0db4a9f64a24fc7935fddbba6b2af4e956ed82a58
5
5
  SHA512:
6
- metadata.gz: 83be6528c7c5a7d8367fa5dc3182ecb9348c830c7f59c69564ead71e6d005eca8852e8ab4fb2a405e500a4c326ea0b9e84dd5196f9c39324322fed843c848dc1
7
- data.tar.gz: 6aa2b795b7aff71eade956bb5e4bf5555f2692bb12a32acc1d282178a2b5b7a49fe30898b76259a2905d3dd5992827761574c38c5029ebc5b3e026d376a60cc8
6
+ metadata.gz: 64b951d6feb2526ed65210e64aa6a2ad513c543d85c9984a7eaaf84dc46409fa0acb19b86c41418e36de98f4889100dfa9633b5e0dbb173345126138585e0212
7
+ data.tar.gz: fb2404dcc5200ea6772b0b12fc752d1fcf3dd1d716734cc048d3e3e12b2f88cb0bcb571f0f1029c5d52dede6348801e2fb4de2c7637530b3f55360b3318a6bfd
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/configurable"
4
+
3
5
  module AngieCoreApi
4
6
  class Configuration
5
7
  include ActiveSupport::Configurable
@@ -3,12 +3,12 @@
3
3
  module AngieCoreApi
4
4
  class Map
5
5
  def self.travel_time(origin, location, radius, unit, size, zoom, locale)
6
- url = "/maps/distancematrix/#{origin}/#{URI.encode(location)}/#{radius}/#{unit}/#{size}/#{zoom}/#{locale}"
6
+ url = "/maps/distancematrix/#{origin}/#{URI.encode_www_form_component(location)}/#{radius}/#{unit}/#{size}/#{zoom}/#{locale}"
7
7
  Client.data(:get, url)
8
8
  end
9
9
 
10
10
  def self.local_places(origin, query, radius, unit, locale)
11
- url = "/maps/places/#{origin}/#{URI.encode(query)}/#{radius}/#{unit}/#{locale}"
11
+ url = "/maps/places/#{origin}/#{URI.encode_www_form_component(query)}/#{radius}/#{unit}/#{locale}"
12
12
  Client.data(:get, url)
13
13
  end
14
14
 
@@ -51,6 +51,11 @@ module AngieCoreApi
51
51
  puts "Disconnected from #{amqp_url}"
52
52
  end
53
53
 
54
+ def self.reconnect!
55
+ disconnect!
56
+ connect
57
+ end
58
+
54
59
  def amqp_url
55
60
  @config[:url].sub(/\/\/.*@/, "//")
56
61
  end
@@ -19,6 +19,8 @@ module AngieCoreApi
19
19
  yield delivery_info, properties, payload
20
20
  AMQPClient.instance.channel.acknowledge(delivery_info.delivery_tag) if options[:manual_ack]
21
21
  end
22
+ rescue Interrupt => _
23
+ AMQPClient.reconnect!
22
24
  end
23
25
 
24
26
  def self.publish(routing_key, message_id, payload)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module AngieCoreApi
4
4
  autoload :Configuration, "angie-core-api/configuration"
5
- autoload :StompClient, "angie-core-api/client"
5
+ autoload :Client, "angie-core-api/client"
6
6
  autoload :Flight, "angie-core-api/flight"
7
7
  autoload :Map, "angie-core-api/map"
8
8
  autoload :Notification, "angie-core-api/notification"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angie-core-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angie Hospitality
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-03 00:00:00.000000000 Z
11
+ date: 2021-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actioncable
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.18.1
61
+ version: 0.20.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.18.1
68
+ version: 0.20.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: stomp
71
71
  requirement: !ruby/object:Gem::Requirement