httpigeon 2.0.1 → 2.1.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: 87470c7708faaa0e584d5a68faed57dd88582c578b795605d55d0424c6498a84
4
- data.tar.gz: d317ade7c12011eeb80bfdfaf30a75991e2bd0964753f9e0e1578d0783c819ef
3
+ metadata.gz: 500fac14ff3591858c0547ea049891de72ffa58747e76ddb1f5faf3cd2a12ba8
4
+ data.tar.gz: 2f6bce6c474bed8bd6cf9168b8f4271a7d4483145d89a5674a72ce6f83c88ac6
5
5
  SHA512:
6
- metadata.gz: '08d019747742bd94ea76bc687d9a90f0c1db56294f2bfd1d6c64465060ca16ffd146cb895df92a7f597626f416aa56a47e55fdbf37f3bb6e4882205088380239'
7
- data.tar.gz: 2efc7593bb4062b015a83bb0b0f006ef65321f8ddc125d6bd1ecbe52272258d6a48f3f554a07c9579fe0e300da68fa9265bd29ff62f6352e45b9620a2bbb518c
6
+ metadata.gz: 114d33029253f8ebd4a9dac5e8815f59b1d8a369ab9be4e971d1711da8df4f24618885876902138bd4d7c4888dd89a7d108da8c82296a8d1c996071c5444141f
7
+ data.tar.gz: fe8312258406cd6f78a162ce3f5f704afcb4091526083802a1bb724b759d5481ff859f885099ecbaacae888df72378e24c7cebb7c1c79704c4ba141b2a92aba8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.0](https://github.com/dailypay/httpigeon/compare/v2.0.1...v2.1.0) (2024-01-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * **response:** [NO-TICKET] parsed_response tests and json support ([#31](https://github.com/dailypay/httpigeon/issues/31)) ([e169215](https://github.com/dailypay/httpigeon/commit/e169215e1394927cb9137e1691196aa535ffd25d))
9
+
3
10
  ## [2.0.1](https://github.com/dailypay/httpigeon/compare/v2.0.0...v2.0.1) (2023-12-21)
4
11
 
5
12
 
@@ -73,17 +73,22 @@ module HTTPigeon
73
73
 
74
74
  def parse_response
75
75
  parsed_body = response_body.is_a?(String) ? JSON.parse(response_body) : response_body
76
+ deep_with_indifferent_access(parsed_body)
77
+ rescue JSON::ParserError
78
+ response_body.presence
79
+ end
76
80
 
77
- case parsed_body
81
+ def deep_with_indifferent_access(obj)
82
+ case obj
78
83
  when Hash
79
- parsed_body.with_indifferent_access
84
+ obj.transform_values do |value|
85
+ deep_with_indifferent_access(value)
86
+ end.with_indifferent_access
80
87
  when Array
81
- parsed_body.map(&:with_indifferent_access)
88
+ obj.map { |item| deep_with_indifferent_access(item) }
82
89
  else
83
- parsed_body
90
+ obj
84
91
  end
85
- rescue JSON::ParserError, NoMethodError
86
- response_body.presence
87
92
  end
88
93
 
89
94
  def default_logger(event_type, log_filters)
@@ -1,3 +1,3 @@
1
1
  module HTTPigeon
2
- VERSION = "2.0.1".freeze
2
+ VERSION = "2.1.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpigeon
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 2k-joker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-21 00:00:00.000000000 Z
11
+ date: 2024-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday