whiplash-app 0.3.3 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/whiplash/app/connections.rb +21 -6
- data/lib/whiplash/app/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26c09e0ec8b7a3952e2e6a687771cabeb0184d47df1322c9ec33056d23a9c1b5
|
4
|
+
data.tar.gz: def14f8b736b5869ab0366422e6fd3822f1697eff1d4f5c631aac480ba666335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8e8bdb3a247c92a628a54bc6047c900685b6a620b4b7241e0b1f2c6fbfd5177c6ac501ecadc03179240fc16e51743aa61d5024f7630fe7478c304ebc07c20b2
|
7
|
+
data.tar.gz: d0a3b70f82d7671b5eee9da62a483b814401d53d020eeb848c2b03b7b0d1c114cadce55baf635d3f3b46303219c9f55506be4a6b54fc021286e9512a7a363c20
|
@@ -26,26 +26,41 @@ module Whiplash
|
|
26
26
|
results = []
|
27
27
|
page = 1
|
28
28
|
params[:per_page] = PER_PAGE_REQUEST_LIMIT
|
29
|
+
response = nil
|
29
30
|
|
30
31
|
loop do
|
31
|
-
partial_results_request = app_request
|
32
|
+
partial_results_request = app_request(
|
32
33
|
method: :get,
|
33
34
|
endpoint: endpoint,
|
34
35
|
params: params,
|
35
36
|
headers: headers
|
36
|
-
)
|
37
|
+
)
|
37
38
|
|
38
|
-
|
39
|
+
if !partial_results_request.success?
|
40
|
+
response = Faraday::Response.new(
|
41
|
+
body: partial_results_request.body,
|
42
|
+
status: partial_results_request.status,
|
43
|
+
method: :get
|
44
|
+
)
|
45
|
+
break
|
46
|
+
end
|
47
|
+
|
48
|
+
results << partial_results_request.body
|
39
49
|
results.flatten!
|
40
50
|
|
41
51
|
page += 1
|
42
52
|
params[:page] = page
|
43
53
|
|
44
|
-
break if partial_results_request.size == 0
|
45
|
-
break if partial_results_request.size < PER_PAGE_REQUEST_LIMIT
|
54
|
+
break if partial_results_request.body.size == 0
|
55
|
+
break if partial_results_request.body.size < PER_PAGE_REQUEST_LIMIT
|
46
56
|
end
|
47
57
|
|
48
|
-
|
58
|
+
response ||= Faraday::Response.new(
|
59
|
+
body: results,
|
60
|
+
status: 200,
|
61
|
+
method: :get
|
62
|
+
)
|
63
|
+
|
49
64
|
end
|
50
65
|
|
51
66
|
def delete(endpoint, params = {}, headers = nil, options = {})
|
data/lib/whiplash/app/version.rb
CHANGED