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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 369384d86e1a0027cef90b9d5bea67045c893f536993f56be5da2f0175e3fb44
4
- data.tar.gz: 6026a3632e9a147bd1dab24357764967f582681635b5e25ddd48c0d909b1bfe2
3
+ metadata.gz: 26c09e0ec8b7a3952e2e6a687771cabeb0184d47df1322c9ec33056d23a9c1b5
4
+ data.tar.gz: def14f8b736b5869ab0366422e6fd3822f1697eff1d4f5c631aac480ba666335
5
5
  SHA512:
6
- metadata.gz: 299b99f6deff5b2db76c6f43d3e1ba8ffe36b97cb778d6ff665cfe2dd1102a0c452f2183a80607510da51d3b31caae68430d177eb5aefee7cd112c95001fd210
7
- data.tar.gz: '03359e08c25cf40976e93331b7b3519c1a5146ca44818bae79cd884ed7c7ca1e93dfe1eb01c0ce3a8350c3f835a8bb469473a4a35f2bc3d3cae935babd31a03a'
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
- ).body
37
+ )
37
38
 
38
- results << partial_results_request
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
- results
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 = {})
@@ -1,5 +1,5 @@
1
1
  module Whiplash
2
2
  module App
3
- VERSION = "0.3.3"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whiplash-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Don Sullivan, Mark Dickson