wolf_core 1.0.39 → 1.0.40
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72f385d95554b49bbcd5c0807f43d32ab7923c93ebbac30f53a61ea21ce076d1
|
4
|
+
data.tar.gz: 69a246974641da28de1c38d0657514c468c91fb05de4a0d7e0c68f5efab4b1f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ae845f5508f3f6bb5d742e5937b62df0682fe9b55f6929f1a9b5d5edf5cb5c526ba102401200625ca72ae4230848105f0311bc803671adaee03815bf45afddb
|
7
|
+
data.tar.gz: 915e777cd79e5cc657a93a8649dff67ec457470e9e0f33833c8d69c6747f2261b144fea5654bddda23663b4b25141c1e51af65ca28ac7ae161487b069723cd8c
|
@@ -17,5 +17,11 @@ module WolfCore
|
|
17
17
|
body = body&.to_json if headers['Content-Type'] == 'application/json'
|
18
18
|
HTTParty.put(url, headers: headers, query: query, body: body)
|
19
19
|
end
|
20
|
+
|
21
|
+
def http_patch(url:, headers: {}, query: nil, body: nil)
|
22
|
+
headers['Content-Type'] ||= 'application/json'
|
23
|
+
body = body&.to_json if headers['Content-Type'] == 'application/json'
|
24
|
+
HTTParty.patch(url, headers: headers, query: query, body: body)
|
25
|
+
end
|
20
26
|
end
|
21
27
|
end
|
@@ -96,6 +96,36 @@ module WolfCore
|
|
96
96
|
WolfCore::HttpDataSource.http_put(url: url, headers: headers, query: query, body: body)
|
97
97
|
end
|
98
98
|
|
99
|
+
def parsed_http_patch(url:, headers: {}, query: nil)
|
100
|
+
response = http_patch(url: url, headers: headers, query: query)
|
101
|
+
parse_http_response(response)
|
102
|
+
end
|
103
|
+
|
104
|
+
def async_http_patch(**args)
|
105
|
+
log_object "starting async_http_patch"
|
106
|
+
log_object args, title: "async_http_patch args are"
|
107
|
+
run_async do
|
108
|
+
response = http_patch(**args)
|
109
|
+
log_object parse_http_response(response), title: "async_http_patch response is"
|
110
|
+
end
|
111
|
+
end
|
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)
|
115
|
+
response = parse_http_response(response)
|
116
|
+
|
117
|
+
log_object response, title: title if title.present?
|
118
|
+
|
119
|
+
error_message ||= "Error on safe_http_patch"
|
120
|
+
validate_http_response(response: response, message: error_message)
|
121
|
+
|
122
|
+
response
|
123
|
+
end
|
124
|
+
|
125
|
+
def http_patch(url:, headers: {}, query: nil)
|
126
|
+
WolfCore::HttpDataSource.http_patch(url: url, headers: headers, query: query)
|
127
|
+
end
|
128
|
+
|
99
129
|
def validate_http_response(response:, message:, error_data: nil)
|
100
130
|
return if response.code == 200
|
101
131
|
|
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.40
|
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-11-
|
11
|
+
date: 2024-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|