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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '038cdd13a653cb3f83cb2cc22151657597b232951687e3028aaf507421eb80cb'
4
- data.tar.gz: 74af3030dc45b306b63fd9e4ee8e993d9597268fbf4e344dfb06dd6ca9baf031
3
+ metadata.gz: 9e0b5fcf037dc7e01207fafb01cdc9ac268c36be010510b7fd6018cd17060e47
4
+ data.tar.gz: 79a0f7f98a831f37b788261c683fe419d6d748dae9433880868134d60bc1b128
5
5
  SHA512:
6
- metadata.gz: e14c0cf0082ca530fe4c475796bc8af0abc29205c2d5f325bdd48fdd03ebb1b32d1298f7cc7f88393f0643a6e69f87d5f44a6ffb16f5e12af6ca6eeabd3ce90d
7
- data.tar.gz: 1b2464974735201c9aee1b1aa3d195cc55c47c0c3e8dda1447760d461e8108fc8270f88ce78ff1acdf8007269b2fe4befdcdc207d6ce201c2a3d4a3c38a75e01
6
+ metadata.gz: 3d67a932a075f5e3e5d71baef9df2b29aa4ee47ce0077bef2fe46e5fd923353ba8d2a70d9a8a787543eb81fee522417b83dea7c5e85fff80a2d2ae2174629f13
7
+ data.tar.gz: b3d719aa2e7e5aee044ca239d06f3647bfc198a0079ef4d3f458bdfd52dae00fbe5f37f655b7bc662852ff88dd332bf7104fe2e7f67dc3fe6b191f3aba65afba
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Cropio
2
- VERSION = '0.36'.freeze
2
+ VERSION = '0.37'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cropio-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.36'
4
+ version: '0.37'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Vernidub