cropio-ruby 0.36 → 0.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cropio/resource/base.rb +6 -5
- data/lib/cropio/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e0b5fcf037dc7e01207fafb01cdc9ac268c36be010510b7fd6018cd17060e47
|
4
|
+
data.tar.gz: 79a0f7f98a831f37b788261c683fe419d6d748dae9433880868134d60bc1b128
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d67a932a075f5e3e5d71baef9df2b29aa4ee47ce0077bef2fe46e5fd923353ba8d2a70d9a8a787543eb81fee522417b83dea7c5e85fff80a2d2ae2174629f13
|
7
|
+
data.tar.gz: b3d719aa2e7e5aee044ca239d06f3647bfc198a0079ef4d3f458bdfd52dae00fbe5f37f655b7bc662852ff88dd332bf7104fe2e7f67dc3fe6b191f3aba65afba
|
data/lib/cropio/resource/base.rb
CHANGED
@@ -117,16 +117,17 @@ module Cropio
|
|
117
117
|
limit -= limit < LIMIT ? limit : LIMIT
|
118
118
|
to_time = last_record_time(response) || from_time
|
119
119
|
|
120
|
-
# if there is one record in time range we need to step back
|
121
|
-
# for 1ms to exclude cycling
|
122
|
-
if response['data'].count == 1
|
123
|
-
to_time = (Time.parse(to_time) - 1/999999.0).iso8601(6)
|
124
|
-
end
|
125
120
|
buffer += response['data']
|
121
|
+
|
122
|
+
break if obtained_records_less_limit(response)
|
126
123
|
end
|
127
124
|
buffer
|
128
125
|
end
|
129
126
|
|
127
|
+
def self.obtained_records_less_limit(response)
|
128
|
+
response['meta']["response"]["obtained_records"] < response['meta']["response"]["limit"]
|
129
|
+
end
|
130
|
+
|
130
131
|
def self.last_record_time(response)
|
131
132
|
response['meta']['response']['last_record_time']
|
132
133
|
end
|
data/lib/cropio/version.rb
CHANGED