httpigeon 2.3.0 → 2.3.1

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: 687076ba8fc193d290ae5bc527269a48e8f7a407e6c8f47007c1408a42a9c604
4
- data.tar.gz: 1440197153f6fab85582117e97436694ff086df7b22c3c636ddec88f1cfa168b
3
+ metadata.gz: 16ce49310907bd1fa04c88e931ece4ef802242cd02de04902f8e46c5fe1abf70
4
+ data.tar.gz: d556922db92044afa1b0f27ab8711319e5475c9e9ea2248139b4b58d5d120f42
5
5
  SHA512:
6
- metadata.gz: ee09ec237262bbca31f0c834fb64856cffd5624cff5ac6153e96e31bef75ac307376cb1dc7be4ca90bf9136cb6d200025e3c965d48e3b005ab54965c5644a344
7
- data.tar.gz: 8c584ec73859acfb7b8673e685a0721fd71fd305dbd3076a93dc9c633f0a716d3652c49ee828e6b7a81ea4ea83538b44f19b169b38ef56c0f510ab74a4e91096
6
+ metadata.gz: f3f59f055d2c4d7f9f27008bbf61b80eb2479fb4c2d9e7f723954bdbe334d01a926a06800b613fabac69de0057d08e4c7144f17b1c10098130f8befa7826fb35
7
+ data.tar.gz: 8ae56db04ef5262ac0f606ee349f0e8c1807d2ff8209f526e6e5677a0d18d96f479aaf55c49e97f0368251dfa01f84c64809bc834fc89a96128c7f920fda350b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.3.1](https://github.com/dailypay/httpigeon/compare/v2.3.0...v2.3.1) (2024-07-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Execute block within scope ([#42](https://github.com/dailypay/httpigeon/issues/42)) ([a9a43c3](https://github.com/dailypay/httpigeon/commit/a9a43c391b449b3316812e1c99fb88e25c923b31))
9
+
3
10
  ## [2.3.0](https://github.com/dailypay/httpigeon/compare/v2.2.0...v2.3.0) (2024-07-11)
4
11
 
5
12
 
@@ -38,9 +38,9 @@ module HTTPigeon
38
38
  end
39
39
  end
40
40
 
41
- attr_reader :connection, :response, :parsed_response, :base_url, :fuse
41
+ attr_reader :connection, :response, :base_url, :fuse
42
42
 
43
- delegate :status, :body, to: :response, prefix: true
43
+ delegate :status, :body, :parsed_response, to: :response, prefix: true
44
44
 
45
45
  def initialize(base_url:, options: nil, headers: nil, adapter: nil, logger: nil, event_type: nil, log_filters: nil, fuse_config: nil)
46
46
  @base_url = URI.parse(base_url)
@@ -77,7 +77,17 @@ module HTTPigeon
77
77
 
78
78
  connection.headers[REQUEST_ID_HEADER] = SecureRandom.uuid if HTTPigeon.auto_generate_request_id
79
79
 
80
- raw_response = HTTPigeon.mount_circuit_breaker ? run_with_fuse(method, path, payload) : simple_run(method, path, payload)
80
+ raw_response = if HTTPigeon.mount_circuit_breaker
81
+ fuse.execute(request_id: connection.headers[REQUEST_ID_HEADER]) do
82
+ connection.send(method, path, payload) do |request|
83
+ yield(request) if block_given?
84
+ end
85
+ end
86
+ else
87
+ connection.send(method, path, payload) do |request|
88
+ yield(request) if block_given?
89
+ end
90
+ end
81
91
 
82
92
  @response = HTTPigeon::Response.new(self, raw_response)
83
93
  end
@@ -93,19 +103,5 @@ module HTTPigeon
93
103
  def default_headers
94
104
  { 'Accept' => 'application/json' }
95
105
  end
96
-
97
- def simple_run(method, path, payload)
98
- connection.send(method, path, payload) do |request|
99
- yield(request) if block_given?
100
- end
101
- end
102
-
103
- def run_with_fuse(method, path, payload)
104
- fuse.execute(request_id: connection.headers[REQUEST_ID_HEADER]) do
105
- simple_run(method, path, payload) do |request|
106
- yield(request) if block_given?
107
- end
108
- end
109
- end
110
106
  end
111
107
  end
@@ -1,3 +1,3 @@
1
1
  module HTTPigeon
2
- VERSION = "2.3.0".freeze
2
+ VERSION = "2.3.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpigeon
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 2k-joker