wolf_core 1.0.45 → 1.0.47
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 +4 -4
- data/lib/wolf_core/infrastructure/http_operations.rb +12 -7
- data/lib/wolf_core/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: 11514fa6f426a60b869744a7219e38ccd4e66e78a460a1be1ecd865dbffc0843
|
4
|
+
data.tar.gz: 3b8efd6137839a2fee6f21c1bbc43c8eb01f5df2c8a86d22493548d371a5a190
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cdbf67d8a870c60beafa12a8e70debd066e09300e824053811391deaf670b117e79463256395d290fbb8e28f1a1e57826844604185f316c311a4660cafd9079
|
7
|
+
data.tar.gz: 7aafdc9ed87a8d32a59d430e214d6c721a60f51b71f754c7da60d32162d701b18f9e4a3f05cc7eb7843f766a95678b084049ad1bb6189918d072afb6f72f3d2e
|
@@ -110,24 +110,25 @@ module WolfCore
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
def safe_http_patch(url:, headers: {}, query: nil, error_message: nil, title: nil)
|
114
|
-
response = http_patch(url: url, headers: headers, query: query)
|
113
|
+
def safe_http_patch(url:, headers: {}, body: nil, query: nil, error_message: nil, title: nil, error_data: nil)
|
114
|
+
response = http_patch(url: url, headers: headers, body: body, query: query)
|
115
115
|
response = parse_http_response(response)
|
116
116
|
|
117
|
-
|
117
|
+
title ||= "safe_http_patch response is"
|
118
|
+
log_object response, title: title
|
118
119
|
|
119
120
|
error_message ||= "Error on safe_http_patch"
|
120
|
-
validate_http_response(response: response, message: error_message)
|
121
|
+
validate_http_response(response: response, message: error_message, error_data: error_data)
|
121
122
|
|
122
123
|
response
|
123
124
|
end
|
124
125
|
|
125
|
-
def http_patch(url:, headers: {}, query: nil)
|
126
|
-
WolfCore::HttpDataSource.http_patch(url: url, headers: headers, query: query)
|
126
|
+
def http_patch(url:, headers: {}, body: nil, query: nil)
|
127
|
+
WolfCore::HttpDataSource.http_patch(url: url, headers: headers, query: query, body: body)
|
127
128
|
end
|
128
129
|
|
129
130
|
def validate_http_response(response:, message:, error_data: nil)
|
130
|
-
return if response
|
131
|
+
return if response_success?(response)
|
131
132
|
|
132
133
|
error_data = {
|
133
134
|
message: message,
|
@@ -148,5 +149,9 @@ module WolfCore
|
|
148
149
|
message: response.message
|
149
150
|
})
|
150
151
|
end
|
152
|
+
|
153
|
+
def response_success?(response)
|
154
|
+
response.code >= 200 && response.code < 300
|
155
|
+
end
|
151
156
|
end
|
152
157
|
end
|
data/lib/wolf_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wolf_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Roncallo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|