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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/httpigeon/request.rb +11 -6
- data/lib/httpigeon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 500fac14ff3591858c0547ea049891de72ffa58747e76ddb1f5faf3cd2a12ba8
|
4
|
+
data.tar.gz: 2f6bce6c474bed8bd6cf9168b8f4271a7d4483145d89a5674a72ce6f83c88ac6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/httpigeon/request.rb
CHANGED
@@ -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
|
-
|
81
|
+
def deep_with_indifferent_access(obj)
|
82
|
+
case obj
|
78
83
|
when Hash
|
79
|
-
|
84
|
+
obj.transform_values do |value|
|
85
|
+
deep_with_indifferent_access(value)
|
86
|
+
end.with_indifferent_access
|
80
87
|
when Array
|
81
|
-
|
88
|
+
obj.map { |item| deep_with_indifferent_access(item) }
|
82
89
|
else
|
83
|
-
|
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)
|
data/lib/httpigeon/version.rb
CHANGED
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
|
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:
|
11
|
+
date: 2024-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|