whispr 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/whispr.rb +5 -5
  2. data/lib/whispr/version.rb +1 -1
  3. metadata +2 -2
@@ -223,7 +223,7 @@ class Whispr
223
223
  fromTime = fromTime.to_i
224
224
  untilTime = untilTime.to_i
225
225
  now = Time.now.to_i
226
- oldest = header[:maxRetention]
226
+ oldest = now - header[:maxRetention]
227
227
  fromTime = oldest if fromTime < oldest
228
228
  raise InvalidTimeInterval.new("Invalid time interval") unless fromTime < untilTime
229
229
  untilTime = now if untilTime > now || untilTime < fromTime
@@ -368,9 +368,9 @@ private
368
368
  if higherBaseInterval == 0
369
369
  higherFirstOffset = higher.offset
370
370
  else
371
- timeDistance = lowerIntervalStart - higherBaseInterval
372
- pointDistance = timeDistance / higher.spp
373
- byteDistance = pointDistance * POINT_SIZE
371
+ timeDistance = lowerIntervalStart - higherBaseInterval
372
+ pointDistance = timeDistance / higher.spp
373
+ byteDistance = pointDistance * POINT_SIZE
374
374
  higherFirstOffset = higher.offset + (byteDistance % higher.size)
375
375
  end
376
376
 
@@ -407,7 +407,7 @@ private
407
407
 
408
408
  knownValues = neighborValues.select { |v| !v.nil? }
409
409
  return false if knownValues.empty?
410
- if (knownValues.length / neighborValues.length).to_f < header[:xFilesFactor]
410
+ if (knownValues.length.to_f / neighborValues.length.to_f) < header[:xFilesFactor]
411
411
  return false
412
412
  end
413
413
 
@@ -1,3 +1,3 @@
1
1
  class Whispr
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
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.0.1
4
+ version: 0.0.2
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: 2012-08-14 00:00:00.000000000 Z
12
+ date: 2012-09-17 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ''
15
15
  email: whispr@simulacre.org