whispr 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ 0.2.0
2
+ - [3](https://github.com/simulacre/whispr/pull/3): fixes update_all setting all values to 0 [ovesh](https://github.com/ovesh)
3
+
1
4
  0.1.0
2
5
  - [2](https://github.com/simulacre/whispr/pull/2): allows closing the filehandle [ovesh](https://github.com/ovesh)
3
6
  - IOError caught when reading header will be tagged as Whispr::Error rather than raising Whispr::CorruptWhisprFile
@@ -254,7 +254,7 @@ class Whispr
254
254
  now = Time.now.to_i
255
255
  oldest = now - header[:maxRetention]
256
256
  fromTime = oldest if fromTime < oldest
257
- raise InvalidTimeInterval.new("Invalid time interval") unless fromTime < untilTime
257
+ raise InvalidTimeInterval.new("Invalid time interval (untilTime=#{untilTime}, fromTime=#{fromTime})") unless fromTime < untilTime
258
258
  untilTime = now if untilTime > now || untilTime < fromTime
259
259
 
260
260
  diff = now - fromTime
@@ -367,7 +367,7 @@ private
367
367
 
368
368
  def update_many(points)
369
369
  # order points by timestamp, newest first
370
- points = points.map{|ts, v| [ts.to_i, v.to_f ] }.sort {|b,a| a[0] <=> b[0] }
370
+ points = points.each_slice(2).map{|ts, v| [ts.to_i, v.to_f ] }.sort {|b,a| a[0] <=> b[0] }
371
371
  now = Time.new.to_i
372
372
  archives = self.archives.to_enum
373
373
  currentArchive = archives.next
@@ -1,3 +1,3 @@
1
1
  class Whispr
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whispr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-31 00:00:00.000000000 Z
12
+ date: 2014-02-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ''
15
15
  email: whispr@simulacre.org