whiplash-app 0.3.4 → 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: cd3b64628b99161af910828d6ebd9e5f07db20394b92d1b075ff69ffc913a323
4
- data.tar.gz: d5f7700773c10a71ae5a8f2e450cffb1f333dad0c5f38c2ad1a82d271cad52e7
3
+ metadata.gz: 26c09e0ec8b7a3952e2e6a687771cabeb0184d47df1322c9ec33056d23a9c1b5
4
+ data.tar.gz: def14f8b736b5869ab0366422e6fd3822f1697eff1d4f5c631aac480ba666335
5
5
  SHA512:
6
- metadata.gz: 554c41b60a38f3762cf11172842942efe564d9dd929d35298c39647083917f36f85a28b80941bf8c6e10abdad6629e69fc8907f89c74e7f48107e609913a5a3d
7
- data.tar.gz: a40d77b5a296b0d98291bb42158e098d34d9e9dd5945d4257774332ad7ad49d15d5305496413119ae1763dc972e12706a4fa80916e0d547ae029a6c2ab1e628d
6
+ metadata.gz: b8e8bdb3a247c92a628a54bc6047c900685b6a620b4b7241e0b1f2c6fbfd5177c6ac501ecadc03179240fc16e51743aa61d5024f7630fe7478c304ebc07c20b2
7
+ data.tar.gz: d0a3b70f82d7671b5eee9da62a483b814401d53d020eeb848c2b03b7b0d1c114cadce55baf635d3f3b46303219c9f55506be4a6b54fc021286e9512a7a363c20
@@ -26,6 +26,7 @@ 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
32
  partial_results_request = app_request(
@@ -33,19 +34,33 @@ module Whiplash
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.4"
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.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Don Sullivan, Mark Dickson