eventus 0.6.4 → 0.6.5

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
  SHA1:
3
- metadata.gz: 753722580d9feb8371a2ad47ad44415702b0263e
4
- data.tar.gz: e2e6f6c8ce0a22e50e96d51d9e10bea53c0b509a
3
+ metadata.gz: 0510de94abd807d6021a437c50991ee12c0905c2
4
+ data.tar.gz: 6f0a0ae284f6c1950c64293c746e08395aca4db9
5
5
  SHA512:
6
- metadata.gz: d47bb1c5680d886a0a6a9e00507da9673934b2c0c3f17c92fdfd7ec521cb57eb87c6a63e8039235e634a6fefaffadc19cee8f5b221d6c43db586f9613bf3a19b
7
- data.tar.gz: e3ae5076dd55f8d9dc0122ca244b9b3734ab232bb51525aa856ec0750c4d6531fc3228c4c821e55184ac99f7292b14f5948a4de4e950cd6613efaaf935902d77
6
+ metadata.gz: 7b4ab55c58fdfaf02e5f0a5d143ede5c0439ad76734d36c4ce8fd8e03d671f1348015d442bcdc605ffa67f0930d625e2aaada01bf146177d725a1bcc43a70aaf
7
+ data.tar.gz: 14e9d30c0dab348d35bdcd3693debb83c0d1f7e40317d6aaa4f50f9bbc38ff31b239abc6ccff80d0be3acd5dd886d496d531b97c98f3b56a36e630d0740b924c
@@ -24,10 +24,11 @@ module Eventus
24
24
  raise Eventus::ConcurrencyError
25
25
  end
26
26
 
27
- def load(sid, min=nil)
27
+ def load(sid, min = nil, max = nil)
28
28
  events = @dataset.where(:sid => sid)
29
29
  events = events.where{ sequence >= min } if min
30
- events.all
30
+ events = events.where{ sequence <= max } if max
31
+ events.order_by(:sequence).all
31
32
  end
32
33
 
33
34
  def load_undispatched(sid = nil)
@@ -1,3 +1,3 @@
1
1
  module Eventus
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
@@ -95,5 +95,16 @@ describe Eventus::Persistence::Sequel do
95
95
  result = persistence.load id, 10
96
96
  result.length.should == 11
97
97
  end
98
+
99
+ it "should load all events up to a maximum" do
100
+ result = persistence.load id, nil, 15
101
+ result.length.should == 15
102
+ end
103
+
104
+ it "should load events between minimum and maximum" do
105
+ result = persistence.load id, 10, 15
106
+ p result
107
+ result.length.should == 6
108
+ end
98
109
  end
99
110
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Staten