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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b7954810099c42c3f5afa0cbf1149e03cffa77fa461663ad1cc31e1a9c23fee
4
- data.tar.gz: 226f6e7d9cd8f080da039b04b13e56fe7ee5cb952aef350514c4c60a25597406
3
+ metadata.gz: 4a9f47efb2b6c80c10e5bb8281f5d5adf34338fa7d82d70c4288fb7d1aae082f
4
+ data.tar.gz: accd55c0fae281bf07325f8323c6565f0de64e823d5bca2fdba4621c543ac906
5
5
  SHA512:
6
- metadata.gz: ca1ea0705b9dd8f8ff46135096102035940ce75c8df5fc42a6f3c99481276042117909667a0b36b52b957190713997b950e8da83aeb9558e9f1343a9ab71916e
7
- data.tar.gz: a75e69ad91e8d1fc1a4c0a0d714ef200f482ffe66b80af000b20e1430ac8d0feed0ae114a9a958964567487582be6464f37d23302a4ecf599c150af85d53437a
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
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EpsRapid
4
- VERSION = '1.2.1'
4
+ VERSION = '1.4.0'
5
5
  end
data/lib/eps-rapid.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eps-rapid/version'
4
+ require 'eps-rapid/request_config'
4
5
  require 'eps-rapid/client'
5
6
  require 'eps-rapid/errors/exceptions'
6
7
  require 'eps-rapid/errors/http_status_codes'
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.2.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-07-12 00:00:00.000000000 Z
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