eps-rapid 1.2.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.MD +6 -0
- data/lib/eps-rapid/client.rb +1 -1
- data/lib/eps-rapid/content.rb +4 -4
- data/lib/eps-rapid/request_config.rb +18 -0
- data/lib/eps-rapid/version.rb +1 -1
- data/lib/eps-rapid.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a9f47efb2b6c80c10e5bb8281f5d5adf34338fa7d82d70c4288fb7d1aae082f
|
4
|
+
data.tar.gz: accd55c0fae281bf07325f8323c6565f0de64e823d5bca2fdba4621c543ac906
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a4bb15e78d13ad27af6d582c548c2d8485e30225a8a63024cf538f8422f94dcc057a82f411a88f09540bb81373160cded0939218ab73d8cddd896c08241e255
|
7
|
+
data.tar.gz: 77575adda5272e2d0ef25c4c2ccdd9f35b2e14dba544c1eac2129557bd1d760c439eac93b0366e130b763eadbf42455377a8c5cc3d51271b66bbe063f51ad72a
|
data/CHANGELOG.MD
CHANGED
@@ -34,3 +34,9 @@
|
|
34
34
|
### Version 1.2.0
|
35
35
|
# Changed
|
36
36
|
- configuration: language -> language_resolver
|
37
|
+
### Version 1.3.0
|
38
|
+
# Changed
|
39
|
+
- Content.content_file and Content.catalog_file supports params
|
40
|
+
### Version 1.4.0
|
41
|
+
# Changed
|
42
|
+
- All API calls can have HTTP options (like timeout) configured
|
data/lib/eps-rapid/client.rb
CHANGED
@@ -86,7 +86,7 @@ module EpsRapid
|
|
86
86
|
req['Test'] = test_header if test_header != ''
|
87
87
|
|
88
88
|
logger.debug("Request: #{uri} headers=(#{req.to_hash}): body=(#{req.body})")
|
89
|
-
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
|
89
|
+
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, **RequestConfig.current) { |http| http.request(req) }
|
90
90
|
logger.debug("Response: #{response.code.to_i} headers=(#{response.to_hash}): body=(#{response.body})")
|
91
91
|
|
92
92
|
case response.code.to_i
|
data/lib/eps-rapid/content.rb
CHANGED
@@ -10,12 +10,12 @@ module EpsRapid
|
|
10
10
|
EpsRapid::Client.get("properties/#{property_id}/guest-reviews", {})
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.catalog_file
|
14
|
-
EpsRapid::Client.get('files/properties/catalog',
|
13
|
+
def self.catalog_file(**params)
|
14
|
+
EpsRapid::Client.get('files/properties/catalog', params)
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.content_file
|
18
|
-
EpsRapid::Client.get('files/properties/content',
|
17
|
+
def self.content_file(**params)
|
18
|
+
EpsRapid::Client.get('files/properties/content', params)
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.chains
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EpsRapid
|
4
|
+
module RequestConfig
|
5
|
+
def self.configure(**options)
|
6
|
+
previous_config = Thread.current[:http_options]
|
7
|
+
Thread.current[:http_options] = options
|
8
|
+
|
9
|
+
yield.tap do
|
10
|
+
Thread.current[:http_options] = previous_config
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.current
|
15
|
+
Thread.current[:http_options] || {}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/eps-rapid/version.rb
CHANGED
data/lib/eps-rapid.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eps-rapid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Leonenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/eps-rapid/manage_booking.rb
|
68
68
|
- lib/eps-rapid/notifications.rb
|
69
69
|
- lib/eps-rapid/recommendations.rb
|
70
|
+
- lib/eps-rapid/request_config.rb
|
70
71
|
- lib/eps-rapid/shopping.rb
|
71
72
|
- lib/eps-rapid/version.rb
|
72
73
|
homepage: https://github.com/advalley/eps-rapid
|