reactor 0.9.5 → 0.9.6

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: 2f68e85e0e74847f96c21488a9c501839d9f6e63
4
- data.tar.gz: 9a604a01797f2ca97b72510ab25442e505853630
3
+ metadata.gz: 4e8f19c123e774ea333ae286291f488e39aba8d0
4
+ data.tar.gz: d4d2f9c5bebefb6437d2e8d5f7ad4ee5e328a8d2
5
5
  SHA512:
6
- metadata.gz: c7d15a00dd0bcac36828b89a4a5aee6b953dc955beba2243e057268902466acf56e3f8357a27857d70a2425c22aef54372903bedbb1e88ab78562fc0c9fde3e2
7
- data.tar.gz: bd054bf8cfd108603c718d9cb39ff10d2010fdc2744e8a898e2f950cda19f30ab5af1528fb3eeb9bc6156f3c7039f0dc7d6b9957b62a0e6f2dd07217906a8c0e
6
+ metadata.gz: 56f87abf1b60898fe5f7145758cf8545ba1d81aa61456986ab526ebcfa390e44bc2f7f0d4253440b813c074df273c48e505d21c3b160ba6240530d4c415e88e7
7
+ data.tar.gz: e3841ee4fd129af86a4c35652724c5cca93272ca1c4a6dca461db98ec5a2e1818282c50a77bc103188ef1f7afe765ff7a3a3e035851c6f46409a129a249d0dae
data/lib/reactor/event.rb CHANGED
@@ -66,7 +66,7 @@ class Reactor::Event
66
66
  def reschedule(name, data = {})
67
67
  scheduled_jobs = Sidekiq::ScheduledSet.new
68
68
  job = scheduled_jobs.detect do |job|
69
- return false if job['class'] != self.name.to_s
69
+ next if job['class'] != self.name.to_s
70
70
 
71
71
  same_event_name = job['args'].first == name.to_s
72
72
  same_at_time = job.score.to_i == data[:was].to_i
@@ -1,3 +1,3 @@
1
1
  module Reactor
2
- VERSION = "0.9.5"
2
+ VERSION = "0.9.6"
3
3
  end
data/spec/event_spec.rb CHANGED
@@ -11,6 +11,9 @@ end
11
11
  class ArbitraryModel < ActiveRecord::Base
12
12
  end
13
13
 
14
+ class OtherWorker
15
+ include Sidekiq::Worker
16
+ end
14
17
 
15
18
  describe Reactor::Event do
16
19
 
@@ -113,6 +116,14 @@ describe Reactor::Event do
113
116
  Reactor::Event.reschedule :turtle_time, at: time + 2.hours, was: time, actor: actor
114
117
  }.not_to change { scheduled.size}.from(1)
115
118
  end
119
+
120
+ it 'will skip jobs of other classes' do
121
+ OtherWorker.perform_in(1.minute, 'foo')
122
+
123
+ expect {
124
+ Reactor::Event.reschedule :turtle_time, at: time + 2.hours, was: time, actor: actor
125
+ }.to change { scheduled.size}.from(1).to(2)
126
+ end
116
127
  end
117
128
  end
118
129
 
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.5
4
+ version: 0.9.6
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-01-08 00:00:00.000000000 Z
14
+ date: 2015-01-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: sidekiq