shopify_api_extensions 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: c941b2d40cd938d27a81562e21d5e1cc24254939
4
- data.tar.gz: ebb922c0292452b14f44f997b49df06b24a1ae36
3
+ metadata.gz: f850d583cba2a480de94630b9edab556ef654d59
4
+ data.tar.gz: 497fd0c0c80f323232f258fb9a95575a2b7b417c
5
5
  SHA512:
6
- metadata.gz: 44917662ae3ff68b7b25d3aa478099220a0125d784a13d239ddcebf9e36acead1915a1e507b4406a6e6b25a3d1378bb1d062f11c86e2b8b2201713ecfebec5f7
7
- data.tar.gz: 69f0effd50de8174f283dc08ee0d16f991fb4ac3fae03ebe0dfaee1e6a992ea1574f71c713cc0992084d0c5cde4ffaab5299cb640a50b4892557ed6588e325e7
6
+ metadata.gz: a8bf0397813e478554d58aca4b8d8c0166cdd5ad3ce0d908109f7d4104f2857e8e4c6a65c22511719aae82596e48b3aed01ce2f9cc152fc8ecd4d83d0c4aaec3
7
+ data.tar.gz: 8fac87d951b43fb1fe03e86bcbd8371aa49f3cd6e83c636a77d5d6589d2d19198c1364fb0d16b708d1271cab0235880ba4f006e457c3ed7f1b9df6c396c13a5e
@@ -20,6 +20,7 @@ ShopifyAPI::Connection.class_eval do
20
20
  Zlib::BufError,
21
21
  SocketError,
22
22
  ActiveResource::SSLError,
23
+ ActiveResource::TimeoutError,
23
24
  # NOTE represents only 500x errors
24
25
  ActiveResource::ServerError
25
26
  ]
@@ -5,26 +5,18 @@ ShopifyAPI::Base.class_eval do
5
5
 
6
6
  def self.auto_paging_each(opts = {})
7
7
  opts[:limit] ||= 50
8
- page_limit = opts[:limit]
9
-
10
- total_count = self.count(opts)
11
- pages = total_count/page_limit + 1
12
- current_page = opts[:page] || 0
8
+ current_page = opts[:page] || 1
13
9
  records = []
14
-
15
- while current_page != pages
10
+ record_found = true
11
+ while record_found
12
+ record_found = false
16
13
  self.list(opts.merge(page: current_page)).each do |record|
14
+ record_found = true
17
15
  records << record
18
-
19
16
  yield(record) if block_given?
20
17
  end
21
-
22
- # TODO should keep incrementing until no results are returned instead of
23
- # relying on the page count when the requests were initiated
24
-
25
18
  current_page += 1
26
19
  end
27
-
28
20
  records
29
21
  end
30
22
  end
@@ -1,3 +1,3 @@
1
1
  module ShopifyAPIExtensions
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_api_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bianco
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-11 00:00:00.000000000 Z
11
+ date: 2019-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shopify_api