reactor 0.9.8 → 0.9.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79a37d4373106a9ecf4726ae5c5cdc144731eb62
|
4
|
+
data.tar.gz: 9c517481d516795077a95cf778e5a227e39a0549
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49ff1b050b0eb88a050545a2b4a0796bf1ee26565e53ee6c503700226588b4d84e503adde531f46d9bb3ccc9072f72d1c083a335a7056e93ed33e48b8dcd2904
|
7
|
+
data.tar.gz: cc0ef56ff6fd82481a5dfce05fb4788b1255fcadc4f7a347ea57ff8b11fd10a36f1ece66484f45b2c1a72c12a17bac143619e2a784afa1fa6af7982c87e127e8
|
data/lib/reactor/version.rb
CHANGED
@@ -118,6 +118,32 @@ describe Reactor::Publishable do
|
|
118
118
|
|
119
119
|
expect{ Reactor::Event.perform(@job_args[0], @job_args[1]) }.to_not change{ Sidekiq::Extensions::DelayedClass.jobs.size }
|
120
120
|
end
|
121
|
+
|
122
|
+
it 'keeps the if intact when rescheduling' do
|
123
|
+
old_start_at = auction.start_at
|
124
|
+
auction.start_at = 3.day.from_now
|
125
|
+
allow(Reactor::Event).to receive(:publish)
|
126
|
+
expect(Reactor::Event).to receive(:publish).with(:conditional_event_on_save, {
|
127
|
+
at: auction.start_at,
|
128
|
+
actor: auction,
|
129
|
+
target: nil,
|
130
|
+
was: old_start_at,
|
131
|
+
if: anything
|
132
|
+
})
|
133
|
+
auction.save!
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'keeps the if intact when scheduling' do
|
137
|
+
start_at = 3.days.from_now
|
138
|
+
allow(Reactor::Event).to receive(:publish)
|
139
|
+
expect(Reactor::Event).to receive(:publish).with(:conditional_event_on_save, {
|
140
|
+
at: start_at,
|
141
|
+
actor: anything,
|
142
|
+
target: nil,
|
143
|
+
if: anything
|
144
|
+
})
|
145
|
+
Auction.create!(start_at: start_at)
|
146
|
+
end
|
121
147
|
end
|
122
148
|
|
123
149
|
it 'supports immediate events (on create) that get fired once' do
|
@@ -18,13 +18,13 @@ class Auction < ActiveRecord::Base
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.ring_bell(event)
|
21
|
-
|
21
|
+
"ring ring! #{event}"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
Reactor.in_test_mode do
|
26
26
|
class TestModeAuction < ActiveRecord::Base
|
27
|
-
on_event :test_puppy_delivered, -> (event) {
|
27
|
+
on_event :test_puppy_delivered, -> (event) { "success" }
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reactor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winfred
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-
|
14
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: sidekiq
|
@@ -216,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
216
|
version: '0'
|
217
217
|
requirements: []
|
218
218
|
rubyforge_project:
|
219
|
-
rubygems_version: 2.4.
|
219
|
+
rubygems_version: 2.4.5.1
|
220
220
|
signing_key:
|
221
221
|
specification_version: 4
|
222
222
|
summary: Sidekiq/ActiveRecord pubsub lib
|