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: 2d6aa87196de034e063a6e71ab133e07c0c4beddce023d22e928f6258d46175a
4
- data.tar.gz: d9170463e261a59d8d6b3f738795d45e39bb6e9df17e2fa084bc17ae4bea96cb
3
+ metadata.gz: 72f385d95554b49bbcd5c0807f43d32ab7923c93ebbac30f53a61ea21ce076d1
4
+ data.tar.gz: 69a246974641da28de1c38d0657514c468c91fb05de4a0d7e0c68f5efab4b1f6
5
5
  SHA512:
6
- metadata.gz: b8a81b5f79b5523277dde12b3d82e503fed8128edaf873edd7cb8549e5df67c034319e3ddd6353501e3cd6b4834d4775c2d863a4c537de355051c5a7d02f9708
7
- data.tar.gz: c66b13fef54ae991629058c5b4b1b72fa1aadd8716a4dbf2943738cedea5302196efc87ac9a75e0f67764b4fcd045d48ced33c0fe3ee0c268b974f7c3ba3b50c
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.39"
4
+ VERSION = "1.0.40"
5
5
  end
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.39
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-21 00:00:00.000000000 Z
11
+ date: 2024-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty