wolf_core 1.0.58 → 1.0.60
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14d70c706c658014c77b0edfef7df110c0c5d99d719ab312f4b787c22f4f07da
|
4
|
+
data.tar.gz: f5c19c72c02f24f87f955c9dbeccc23e7413256ae94eb3039babaf1dbaaabc5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c46720213697ec635ee8483cdfcf3f597792b24b74d6dc4638ee24e272ee91dfe69063335484c9f060f6256a99c81725a7f71c3bb8640ad2d5e91af2f0fc65b5
|
7
|
+
data.tar.gz: 53fa0341be43a726de34f7d0f777c027d64e74c6ae17873e47411ad230ed2b8527f9d7ff609b9d6cbaf497345fc485bcec0e3aab50de87cc2a74ca000091228e
|
@@ -2,26 +2,32 @@ module WolfCore
|
|
2
2
|
module HttpDataSource
|
3
3
|
module_function
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
TIMEOUT = 900
|
6
|
+
|
7
|
+
def http_get(url:, headers: {}, query: nil, timeout: nil)
|
8
|
+
timeout ||= TIMEOUT
|
9
|
+
HTTParty.get(url, headers: headers, query: query, timeout: timeout, open_timeout: timeout, read_timeout: timeout)
|
7
10
|
end
|
8
11
|
|
9
|
-
def http_post(url:, headers: {}, query: nil, body: nil)
|
12
|
+
def http_post(url:, headers: {}, query: nil, body: nil, timeout: nil)
|
10
13
|
headers['Content-Type'] ||= 'application/json'
|
11
14
|
body = body&.to_json if headers['Content-Type'] == 'application/json'
|
12
|
-
|
15
|
+
timeout ||= TIMEOUT
|
16
|
+
HTTParty.post(url, headers: headers, query: query, body: body, timeout: timeout, open_timeout: timeout, read_timeout: timeout)
|
13
17
|
end
|
14
18
|
|
15
|
-
def http_put(url:, headers: {}, query: nil, body: nil)
|
19
|
+
def http_put(url:, headers: {}, query: nil, body: nil, timeout: nil)
|
16
20
|
headers['Content-Type'] ||= 'application/json'
|
17
21
|
body = body&.to_json if headers['Content-Type'] == 'application/json'
|
18
|
-
|
22
|
+
timeout ||= TIMEOUT
|
23
|
+
HTTParty.put(url, headers: headers, query: query, body: body, timeout: timeout, open_timeout: timeout, read_timeout: timeout)
|
19
24
|
end
|
20
25
|
|
21
|
-
def http_patch(url:, headers: {}, query: nil, body: nil)
|
26
|
+
def http_patch(url:, headers: {}, query: nil, body: nil, timeout: nil)
|
22
27
|
headers['Content-Type'] ||= 'application/json'
|
23
28
|
body = body&.to_json if headers['Content-Type'] == 'application/json'
|
24
|
-
|
29
|
+
timeout ||= TIMEOUT
|
30
|
+
HTTParty.patch(url, headers: headers, query: query, body: body, timeout: timeout, open_timeout: timeout, read_timeout: timeout)
|
25
31
|
end
|
26
32
|
end
|
27
33
|
end
|
@@ -4,8 +4,8 @@ module WolfCore
|
|
4
4
|
include WolfCore::AsyncUtils
|
5
5
|
include WolfCore::LoggingUtils
|
6
6
|
|
7
|
-
def parsed_http_get(url:, headers: {}, query: nil)
|
8
|
-
response = http_get(url: url, headers: headers, query: query)
|
7
|
+
def parsed_http_get(url:, headers: {}, query: nil, timeout: nil)
|
8
|
+
response = http_get(url: url, headers: headers, query: query, timeout: timeout)
|
9
9
|
parse_http_response(response)
|
10
10
|
end
|
11
11
|
|
@@ -18,8 +18,8 @@ module WolfCore
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def safe_http_get(url:, headers: {}, query: nil, error_message: nil, title: nil)
|
22
|
-
response = http_get(url: url, headers: headers, query: query)
|
21
|
+
def safe_http_get(url:, headers: {}, query: nil, error_message: nil, title: nil, timeout: nil)
|
22
|
+
response = http_get(url: url, headers: headers, query: query, timeout: timeout)
|
23
23
|
response = parse_http_response(response)
|
24
24
|
|
25
25
|
log_object response, title: title if title.present?
|
@@ -30,12 +30,12 @@ module WolfCore
|
|
30
30
|
response
|
31
31
|
end
|
32
32
|
|
33
|
-
def http_get(url:, headers: {}, query: nil)
|
34
|
-
WolfCore::HttpDataSource.http_get(url: url, headers: headers, query: query)
|
33
|
+
def http_get(url:, headers: {}, query: nil, timeout: nil)
|
34
|
+
WolfCore::HttpDataSource.http_get(url: url, headers: headers, query: query, timeout: timeout)
|
35
35
|
end
|
36
36
|
|
37
|
-
def parsed_http_post(url:, body: nil, headers: {}, query: nil)
|
38
|
-
response = http_post(url: url, headers: headers, query: query, body: body)
|
37
|
+
def parsed_http_post(url:, body: nil, headers: {}, query: nil, timeout: nil)
|
38
|
+
response = http_post(url: url, headers: headers, query: query, body: body, timeout: timeout)
|
39
39
|
parse_http_response(response)
|
40
40
|
end
|
41
41
|
|
@@ -48,8 +48,8 @@ module WolfCore
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
def safe_http_post(url:, headers: {}, body: nil, query: nil, error_message: nil, title: nil, error_data: nil)
|
52
|
-
response = http_post(url: url, headers: headers, body: body, query: query)
|
51
|
+
def safe_http_post(url:, headers: {}, body: nil, query: nil, error_message: nil, title: nil, error_data: nil, timeout: nil)
|
52
|
+
response = http_post(url: url, headers: headers, body: body, query: query, timeout: timeout)
|
53
53
|
response = parse_http_response(response)
|
54
54
|
|
55
55
|
title ||= "safe_http_post response is"
|
@@ -61,12 +61,12 @@ module WolfCore
|
|
61
61
|
response
|
62
62
|
end
|
63
63
|
|
64
|
-
def http_post(url:, headers: {}, body: nil, query: nil)
|
65
|
-
WolfCore::HttpDataSource.http_post(url: url, headers: headers, query: query, body: body)
|
64
|
+
def http_post(url:, headers: {}, body: nil, query: nil, timeout: nil)
|
65
|
+
WolfCore::HttpDataSource.http_post(url: url, headers: headers, query: query, body: body, timeout: timeout)
|
66
66
|
end
|
67
67
|
|
68
|
-
def parsed_http_put(url:, body: nil, headers: {}, query: nil)
|
69
|
-
response = http_put(url: url, headers: headers, query: query, body: body)
|
68
|
+
def parsed_http_put(url:, body: nil, headers: {}, query: nil, timeout: nil)
|
69
|
+
response = http_put(url: url, headers: headers, query: query, body: body, timeout: timeout)
|
70
70
|
parse_http_response(response)
|
71
71
|
end
|
72
72
|
|
@@ -79,8 +79,8 @@ module WolfCore
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
-
def safe_http_put(url:, headers: {}, body: nil, query: nil, error_message: nil, title: nil, error_data: nil)
|
83
|
-
response = http_put(url: url, headers: headers, body: body, query: query)
|
82
|
+
def safe_http_put(url:, headers: {}, body: nil, query: nil, error_message: nil, title: nil, error_data: nil, timeout: nil)
|
83
|
+
response = http_put(url: url, headers: headers, body: body, query: query, timeout: timeout)
|
84
84
|
response = parse_http_response(response)
|
85
85
|
|
86
86
|
title ||= "safe_http_put response is"
|
@@ -92,12 +92,12 @@ module WolfCore
|
|
92
92
|
response
|
93
93
|
end
|
94
94
|
|
95
|
-
def http_put(url:, headers: {}, body: nil, query: nil)
|
96
|
-
WolfCore::HttpDataSource.http_put(url: url, headers: headers, query: query, body: body)
|
95
|
+
def http_put(url:, headers: {}, body: nil, query: nil, timeout: nil)
|
96
|
+
WolfCore::HttpDataSource.http_put(url: url, headers: headers, query: query, body: body, timeout: timeout)
|
97
97
|
end
|
98
98
|
|
99
|
-
def parsed_http_patch(url:, headers: {}, query: nil)
|
100
|
-
response = http_patch(url: url, headers: headers, query: query)
|
99
|
+
def parsed_http_patch(url:, headers: {}, query: nil, body: nil, timeout: nil)
|
100
|
+
response = http_patch(url: url, headers: headers, query: query, body: body, timeout: timeout)
|
101
101
|
parse_http_response(response)
|
102
102
|
end
|
103
103
|
|
@@ -110,8 +110,8 @@ module WolfCore
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
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)
|
113
|
+
def safe_http_patch(url:, headers: {}, body: nil, query: nil, error_message: nil, title: nil, error_data: nil, timeout: nil)
|
114
|
+
response = http_patch(url: url, headers: headers, body: body, query: query, timeout: timeout)
|
115
115
|
response = parse_http_response(response)
|
116
116
|
|
117
117
|
title ||= "safe_http_patch response is"
|
@@ -123,8 +123,8 @@ module WolfCore
|
|
123
123
|
response
|
124
124
|
end
|
125
125
|
|
126
|
-
def http_patch(url:, headers: {}, body: nil, query: nil)
|
127
|
-
WolfCore::HttpDataSource.http_patch(url: url, headers: headers, query: query, body: body)
|
126
|
+
def http_patch(url:, headers: {}, body: nil, query: nil, timeout: nil)
|
127
|
+
WolfCore::HttpDataSource.http_patch(url: url, headers: headers, query: query, body: body, timeout: timeout)
|
128
128
|
end
|
129
129
|
|
130
130
|
def validate_http_response(response:, message:, error_data: nil)
|
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.60
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Roncallo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|