voog-kit 0.3.7 → 0.3.8

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: 6a548a2e4eae5cb8d20b0c5ba3b2204fda5e0dda
4
- data.tar.gz: 9a44ca48c981e6973aafd25b24a4234021fcf1f7
3
+ metadata.gz: 372f38b6bb4e9f72994756dd781dab53b18ce227
4
+ data.tar.gz: d6eb5cb7ecffe85ce8f2e485a0772260733b012a
5
5
  SHA512:
6
- metadata.gz: 884e962e44fad82fbd7b0c9050ab9136ddaff2c9d02fc980d504b4d3d8db5a24e7de68ca4ddf67a4c2adc435741bd90cab7887bacdd16b01d1f03c70df03b87e
7
- data.tar.gz: ca7a696c892b21c47833306b221894a6396fd19c5c28377c83176ac27b2a4cb632c26fd9f9240d90a05db25015b69255f107ba3c261bd9dc801c5808dd4cee43
6
+ metadata.gz: 9cec7b56c7f6b5f864543de4bcbdb65c49d308c93d0a26427aca1f9e7536023be50f00c198e05277024f69ab8ee6a55cc09ac7aab14d29bd37ad9d5e372b9108
7
+ data.tar.gz: 7d0e523c0f88b198cbf7edce768864e5f747ef74f96a946aff1aad1dcecd9f174afef6ad5d2b954b324c63de3a0c55574ca448e155ee5ff013b98f7a320ce789
data/bin/kit CHANGED
@@ -256,7 +256,6 @@ pre do |global, command, options, args|
256
256
  Voog::Dtk.write_config({
257
257
  host: host,
258
258
  api_token: api_token,
259
- overwrite: overwrite,
260
259
  block: @config_block || host,
261
260
  overwrite: overwrite
262
261
  })
@@ -157,12 +157,24 @@ module Voog::Dtk
157
157
  write_manifest @manifest
158
158
  end
159
159
 
160
+ def auto_paginate(api_method, opt = {})
161
+ data = @client.send(api_method, opt)
162
+ last_response = @client.last_response
163
+
164
+ while last_response.rels[:next]
165
+ last_response = last_response.rels[:next].get
166
+ data.concat(last_response.data) if last_response.data.is_a?(Array)
167
+ end
168
+
169
+ data
170
+ end
171
+
160
172
  def get_layouts
161
- @client.layouts(per_page: 10_000)
173
+ auto_paginate(:layouts, per_page: 250)
162
174
  end
163
175
 
164
176
  def get_layout_assets
165
- @client.layout_assets(per_page: 10_000)
177
+ auto_paginate(:layout_assets, per_page: 250)
166
178
  end
167
179
 
168
180
  def get_layout(id)
@@ -1,5 +1,5 @@
1
1
  module Voog
2
2
  module Dtk
3
- VERSION = '0.3.7'
3
+ VERSION = '0.3.8'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voog-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikk Pristavka
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-27 00:00:00.000000000 Z
12
+ date: 2015-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler