vimaly 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/vimaly/client.rb +17 -6
- data/lib/vimaly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e67a18552b8d4a3c3bf527a2bb4fb859a15b8c59e0fded3fc7f5138df00d375
|
4
|
+
data.tar.gz: 5a1c9269b2556e45fe0eb867f4ad31f4fa73b11bd581da743ea5dc15eca2717c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 610de2b9dac4235222006ab0361a3d62f0c42ff6c6a67e5c6173ddb700ba19608a17f51e6d06c7d07bdf10b3791f3a88fe9dd98bf52a3cd6f355fb227a474142
|
7
|
+
data.tar.gz: a58e11c17157e1192383164018457b11502f6b284582432c6d04224bdbd7365f2a322847cfd7eebb8176f713a5025098276683bcee79277a9b6294d487741c4d
|
data/CHANGELOG.md
CHANGED
data/lib/vimaly/client.rb
CHANGED
@@ -84,14 +84,25 @@ module Vimaly
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
-
def bins
|
87
|
+
def bins(options={})
|
88
88
|
@bins ||= begin
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
# 500 is the vimaly limit
|
90
|
+
bins_per_request = options[:bins_per_request] || 500
|
91
|
+
# 5000 is just a random value here; hopefully we never reach this limit
|
92
|
+
max_number_of_bins = options[:max_number_of_bins] || 5000
|
93
|
+
|
94
|
+
bins = []
|
95
|
+
current_page = 0
|
96
|
+
while bins.size < max_number_of_bins
|
97
|
+
# those request parameters are not documented, maybe this gets added at some
|
98
|
+
# point to https://vimaly.com/public/rest-help.html#Bins
|
99
|
+
chunk_of_bins = get("/bins?max-results=#{bins_per_request}&page-token=#{current_page * bins_per_request}")
|
100
|
+
current_page += 1
|
101
|
+
bins += chunk_of_bins
|
102
|
+
break if chunk_of_bins.size < bins_per_request
|
92
103
|
end
|
93
|
-
|
94
|
-
Bin.new(
|
104
|
+
bins.map do |bin|
|
105
|
+
Bin.new(bin['_id'], bin['name'])
|
95
106
|
end
|
96
107
|
end
|
97
108
|
end
|
data/lib/vimaly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vimaly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thorsten Boettger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|