reactor 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/.travis.yml +4 -2
- data/Appraisals +7 -0
- data/Gemfile.lock +63 -58
- data/README.md +8 -2
- data/Rakefile +3 -2
- data/gemfiles/sidekiq_4.gemfile +7 -0
- data/gemfiles/sidekiq_5.gemfile +7 -0
- data/lib/reactor/subscription.rb +2 -3
- data/lib/reactor/version.rb +1 -1
- data/reactor.gemspec +3 -5
- data/spec/models/concerns/publishable_spec.rb +1 -1
- metadata +30 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7a94df79b5698ed5185c29373773cc7478d523a
|
4
|
+
data.tar.gz: 2a5fc2f01a02fbf53077e42c2893348847dc53e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8066ac65ac0f4ee4ddeb0dd3f6be6e65276fcc127a800595e78b601de6aad1d932bbb533a459918f3729075a178513eaa165743bdf4b68eff589355474d3bd7
|
7
|
+
data.tar.gz: 541f84a63ec312081e3f675269503901c4af5939871ab91f4b1dc35d9d1e1c3d33f3d2525da9d40128312ffbf4bb33abc009af51fcf4f1ee117dc085f5d4775e
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.4.1
|
data/.travis.yml
CHANGED
data/Appraisals
ADDED
data/Gemfile.lock
CHANGED
@@ -2,49 +2,53 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
reactor (0.14.0)
|
5
|
-
rails (~> 5.0.
|
6
|
-
sidekiq
|
5
|
+
rails (~> 5.0.4)
|
6
|
+
sidekiq (> 4.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (5.0.
|
12
|
-
actionpack (= 5.0.
|
11
|
+
actioncable (5.0.4)
|
12
|
+
actionpack (= 5.0.4)
|
13
13
|
nio4r (>= 1.2, < 3.0)
|
14
14
|
websocket-driver (~> 0.6.1)
|
15
|
-
actionmailer (5.0.
|
16
|
-
actionpack (= 5.0.
|
17
|
-
actionview (= 5.0.
|
18
|
-
activejob (= 5.0.
|
15
|
+
actionmailer (5.0.4)
|
16
|
+
actionpack (= 5.0.4)
|
17
|
+
actionview (= 5.0.4)
|
18
|
+
activejob (= 5.0.4)
|
19
19
|
mail (~> 2.5, >= 2.5.4)
|
20
20
|
rails-dom-testing (~> 2.0)
|
21
|
-
actionpack (5.0.
|
22
|
-
actionview (= 5.0.
|
23
|
-
activesupport (= 5.0.
|
21
|
+
actionpack (5.0.4)
|
22
|
+
actionview (= 5.0.4)
|
23
|
+
activesupport (= 5.0.4)
|
24
24
|
rack (~> 2.0)
|
25
25
|
rack-test (~> 0.6.3)
|
26
26
|
rails-dom-testing (~> 2.0)
|
27
27
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
28
|
-
actionview (5.0.
|
29
|
-
activesupport (= 5.0.
|
28
|
+
actionview (5.0.4)
|
29
|
+
activesupport (= 5.0.4)
|
30
30
|
builder (~> 3.1)
|
31
31
|
erubis (~> 2.7.0)
|
32
32
|
rails-dom-testing (~> 2.0)
|
33
33
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
34
|
-
activejob (5.0.
|
35
|
-
activesupport (= 5.0.
|
34
|
+
activejob (5.0.4)
|
35
|
+
activesupport (= 5.0.4)
|
36
36
|
globalid (>= 0.3.6)
|
37
|
-
activemodel (5.0.
|
38
|
-
activesupport (= 5.0.
|
39
|
-
activerecord (5.0.
|
40
|
-
activemodel (= 5.0.
|
41
|
-
activesupport (= 5.0.
|
37
|
+
activemodel (5.0.4)
|
38
|
+
activesupport (= 5.0.4)
|
39
|
+
activerecord (5.0.4)
|
40
|
+
activemodel (= 5.0.4)
|
41
|
+
activesupport (= 5.0.4)
|
42
42
|
arel (~> 7.0)
|
43
|
-
activesupport (5.0.
|
43
|
+
activesupport (5.0.4)
|
44
44
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
45
45
|
i18n (~> 0.7)
|
46
46
|
minitest (~> 5.1)
|
47
47
|
tzinfo (~> 1.1)
|
48
|
+
appraisal (2.2.0)
|
49
|
+
bundler
|
50
|
+
rake
|
51
|
+
thor (>= 0.14.0)
|
48
52
|
arel (7.1.4)
|
49
53
|
builder (3.2.3)
|
50
54
|
byebug (9.0.6)
|
@@ -56,21 +60,21 @@ GEM
|
|
56
60
|
erubis (2.7.0)
|
57
61
|
globalid (0.4.0)
|
58
62
|
activesupport (>= 4.2.0)
|
59
|
-
i18n (0.8.
|
60
|
-
json (2.0
|
63
|
+
i18n (0.8.4)
|
64
|
+
json (2.1.0)
|
61
65
|
loofah (2.0.3)
|
62
66
|
nokogiri (>= 1.5.9)
|
63
|
-
mail (2.6.
|
67
|
+
mail (2.6.6)
|
64
68
|
mime-types (>= 1.16, < 4)
|
65
69
|
method_source (0.8.2)
|
66
70
|
mime-types (3.1)
|
67
71
|
mime-types-data (~> 3.2015)
|
68
72
|
mime-types-data (3.2016.0521)
|
69
|
-
mini_portile2 (2.
|
70
|
-
minitest (5.10.
|
71
|
-
nio4r (2.
|
72
|
-
nokogiri (1.
|
73
|
-
mini_portile2 (~> 2.
|
73
|
+
mini_portile2 (2.2.0)
|
74
|
+
minitest (5.10.2)
|
75
|
+
nio4r (2.1.0)
|
76
|
+
nokogiri (1.8.0)
|
77
|
+
mini_portile2 (~> 2.2.0)
|
74
78
|
pry (0.10.4)
|
75
79
|
coderay (~> 1.1.0)
|
76
80
|
method_source (~> 0.8.1)
|
@@ -83,57 +87,57 @@ GEM
|
|
83
87
|
rack
|
84
88
|
rack-test (0.6.3)
|
85
89
|
rack (>= 1.0)
|
86
|
-
rails (5.0.
|
87
|
-
actioncable (= 5.0.
|
88
|
-
actionmailer (= 5.0.
|
89
|
-
actionpack (= 5.0.
|
90
|
-
actionview (= 5.0.
|
91
|
-
activejob (= 5.0.
|
92
|
-
activemodel (= 5.0.
|
93
|
-
activerecord (= 5.0.
|
94
|
-
activesupport (= 5.0.
|
90
|
+
rails (5.0.4)
|
91
|
+
actioncable (= 5.0.4)
|
92
|
+
actionmailer (= 5.0.4)
|
93
|
+
actionpack (= 5.0.4)
|
94
|
+
actionview (= 5.0.4)
|
95
|
+
activejob (= 5.0.4)
|
96
|
+
activemodel (= 5.0.4)
|
97
|
+
activerecord (= 5.0.4)
|
98
|
+
activesupport (= 5.0.4)
|
95
99
|
bundler (>= 1.3.0, < 2.0)
|
96
|
-
railties (= 5.0.
|
100
|
+
railties (= 5.0.4)
|
97
101
|
sprockets-rails (>= 2.0.0)
|
98
102
|
rails-dom-testing (2.0.3)
|
99
103
|
activesupport (>= 4.2.0)
|
100
104
|
nokogiri (>= 1.6)
|
101
105
|
rails-html-sanitizer (1.0.3)
|
102
106
|
loofah (~> 2.0)
|
103
|
-
railties (5.0.
|
104
|
-
actionpack (= 5.0.
|
105
|
-
activesupport (= 5.0.
|
107
|
+
railties (5.0.4)
|
108
|
+
actionpack (= 5.0.4)
|
109
|
+
activesupport (= 5.0.4)
|
106
110
|
method_source
|
107
111
|
rake (>= 0.8.7)
|
108
112
|
thor (>= 0.18.1, < 2.0)
|
109
113
|
rake (12.0.0)
|
110
114
|
redis (3.3.3)
|
111
|
-
rspec (3.
|
112
|
-
rspec-core (~> 3.
|
113
|
-
rspec-expectations (~> 3.
|
114
|
-
rspec-mocks (~> 3.
|
115
|
-
rspec-core (3.
|
116
|
-
rspec-support (~> 3.
|
117
|
-
rspec-expectations (3.
|
115
|
+
rspec (3.6.0)
|
116
|
+
rspec-core (~> 3.6.0)
|
117
|
+
rspec-expectations (~> 3.6.0)
|
118
|
+
rspec-mocks (~> 3.6.0)
|
119
|
+
rspec-core (3.6.0)
|
120
|
+
rspec-support (~> 3.6.0)
|
121
|
+
rspec-expectations (3.6.0)
|
118
122
|
diff-lcs (>= 1.2.0, < 2.0)
|
119
|
-
rspec-support (~> 3.
|
123
|
+
rspec-support (~> 3.6.0)
|
120
124
|
rspec-its (1.2.0)
|
121
125
|
rspec-core (>= 3.0.0)
|
122
126
|
rspec-expectations (>= 3.0.0)
|
123
|
-
rspec-mocks (3.
|
127
|
+
rspec-mocks (3.6.0)
|
124
128
|
diff-lcs (>= 1.2.0, < 2.0)
|
125
|
-
rspec-support (~> 3.
|
126
|
-
rspec-support (3.
|
127
|
-
sidekiq (
|
129
|
+
rspec-support (~> 3.6.0)
|
130
|
+
rspec-support (3.6.0)
|
131
|
+
sidekiq (5.0.4)
|
128
132
|
concurrent-ruby (~> 1.0)
|
129
133
|
connection_pool (~> 2.2, >= 2.2.0)
|
130
134
|
rack-protection (>= 1.5.0)
|
131
|
-
redis (~> 3.
|
132
|
-
simplecov (0.
|
135
|
+
redis (~> 3.3, >= 3.3.3)
|
136
|
+
simplecov (0.14.1)
|
133
137
|
docile (~> 1.1.0)
|
134
138
|
json (>= 1.8, < 3)
|
135
139
|
simplecov-html (~> 0.10.0)
|
136
|
-
simplecov-html (0.10.
|
140
|
+
simplecov-html (0.10.1)
|
137
141
|
slop (3.6.0)
|
138
142
|
sprockets (3.7.1)
|
139
143
|
concurrent-ruby (~> 1.0)
|
@@ -157,6 +161,7 @@ PLATFORMS
|
|
157
161
|
ruby
|
158
162
|
|
159
163
|
DEPENDENCIES
|
164
|
+
appraisal
|
160
165
|
bundler
|
161
166
|
pry
|
162
167
|
pry-byebug
|
@@ -169,4 +174,4 @@ DEPENDENCIES
|
|
169
174
|
test_after_commit
|
170
175
|
|
171
176
|
BUNDLED WITH
|
172
|
-
1.
|
177
|
+
1.15.1
|
data/README.md
CHANGED
@@ -142,7 +142,7 @@ Once you write your own action_event to describe your event data model's base at
|
|
142
142
|
<dt>index =></dt>
|
143
143
|
<dd>"pets_indexed"</dd>
|
144
144
|
</dl>
|
145
|
-
|
145
|
+
|
146
146
|
<dl>
|
147
147
|
<dt>show =></dt>
|
148
148
|
<dd>"pet_viewed", target: @pet</dd>
|
@@ -167,7 +167,7 @@ Once you write your own action_event to describe your event data model's base at
|
|
167
167
|
|
168
168
|
<dl>
|
169
169
|
<dt>update =></dt>
|
170
|
-
<dd>
|
170
|
+
<dd>
|
171
171
|
when valid => "pet_updated", target: @pet, changes: @pet.previous_changes.as_json
|
172
172
|
<br />
|
173
173
|
when invalid => "pet_update_failed", target: @pet,
|
@@ -242,6 +242,12 @@ for your testing convenience.
|
|
242
242
|
4. Push to the branch (`git push origin my-new-feature`)
|
243
243
|
5. Create new Pull Request
|
244
244
|
|
245
|
+
For testing Reactor itself we use Thoughtbot's [appraisal gem](https://github.com/thoughtbot/appraisal). This lets us test against multiple versions of Sidekiq, Rails, etc. To install appraisal and set up multiple dependencies, do the following:
|
246
|
+
|
247
|
+
1. `bundle install` - this will install up-to-date dependencies and appraisal
|
248
|
+
2. `appraisal install` - installs dependencies for appraisal groups
|
249
|
+
3. `appraisal rake` - runs specs for each appraisal group
|
250
|
+
|
245
251
|
## Open Source by [Hired](https://hired.com/?utm_source=opensource&utm_medium=reactor&utm_campaign=readme)
|
246
252
|
|
247
253
|
We are Ruby developers ourselves, and we use all of our open source projects in production. We always encourge forks, pull requests, and issues. Get in touch with the Hired Engineering team at _opensource@hired.com_.
|
data/Rakefile
CHANGED
data/lib/reactor/subscription.rb
CHANGED
@@ -29,7 +29,7 @@ module Reactor
|
|
29
29
|
|
30
30
|
def handler_defined?
|
31
31
|
namespace.const_defined?(handler_name) &&
|
32
|
-
namespace.const_get(handler_name).
|
32
|
+
namespace.const_get(handler_name).parents.include?(Reactor.subscriber_namespace)
|
33
33
|
end
|
34
34
|
|
35
35
|
def event_handler_names
|
@@ -68,8 +68,7 @@ module Reactor
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def build_worker_class
|
71
|
-
|
72
|
-
|
71
|
+
namespace.send(:remove_const, handler_name) if handler_defined?
|
73
72
|
|
74
73
|
worker_class = mailer_subscriber? ? build_mailer_worker : build_event_worker
|
75
74
|
namespace.const_set(handler_name, worker_class)
|
data/lib/reactor/version.rb
CHANGED
data/reactor.gemspec
CHANGED
@@ -18,11 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency
|
22
|
-
|
23
|
-
rails_version = '~> 5.0.2'
|
24
|
-
|
25
|
-
spec.add_dependency 'rails', rails_version
|
21
|
+
spec.add_dependency 'rails', '~> 5.0.4'
|
22
|
+
spec.add_dependency "sidekiq", '> 4.0'
|
26
23
|
|
27
24
|
spec.add_development_dependency "bundler"
|
28
25
|
spec.add_development_dependency "rake"
|
@@ -33,4 +30,5 @@ Gem::Specification.new do |spec|
|
|
33
30
|
spec.add_development_dependency "sqlite3"
|
34
31
|
spec.add_development_dependency "test_after_commit"
|
35
32
|
spec.add_development_dependency "simplecov"
|
33
|
+
spec.add_development_dependency "appraisal"
|
36
34
|
end
|
@@ -118,7 +118,7 @@ describe Reactor::Publishable do
|
|
118
118
|
publisher.start_at = 3.days.from_now
|
119
119
|
publisher.save!
|
120
120
|
|
121
|
-
expect{ Reactor::Event.perform(@job_args[0], @job_args[1]) }.to_not change{ Sidekiq::
|
121
|
+
expect{ Reactor::Event.perform(@job_args[0], @job_args[1]) }.to_not change{ Sidekiq::Queues.jobs_by_queue.values.flatten.count }
|
122
122
|
end
|
123
123
|
|
124
124
|
it 'keeps the if intact when rescheduling' do
|
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.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winfred
|
@@ -11,36 +11,36 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-
|
14
|
+
date: 2017-07-10 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
|
-
name:
|
17
|
+
name: rails
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
|
-
- - "
|
20
|
+
- - "~>"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 5.0.4
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "
|
27
|
+
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 5.0.4
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
31
|
+
name: sidekiq
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- - "
|
34
|
+
- - ">"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
36
|
+
version: '4.0'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- - "
|
41
|
+
- - ">"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
43
|
+
version: '4.0'
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: bundler
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
@@ -167,6 +167,20 @@ dependencies:
|
|
167
167
|
- - ">="
|
168
168
|
- !ruby/object:Gem::Version
|
169
169
|
version: '0'
|
170
|
+
- !ruby/object:Gem::Dependency
|
171
|
+
name: appraisal
|
172
|
+
requirement: !ruby/object:Gem::Requirement
|
173
|
+
requirements:
|
174
|
+
- - ">="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '0'
|
177
|
+
type: :development
|
178
|
+
prerelease: false
|
179
|
+
version_requirements: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
170
184
|
description: " rails chrono reactor "
|
171
185
|
email:
|
172
186
|
- winfred@hired.com
|
@@ -181,12 +195,15 @@ files:
|
|
181
195
|
- ".rspec"
|
182
196
|
- ".ruby-version"
|
183
197
|
- ".travis.yml"
|
198
|
+
- Appraisals
|
184
199
|
- Changes.md
|
185
200
|
- Gemfile
|
186
201
|
- Gemfile.lock
|
187
202
|
- LICENSE.txt
|
188
203
|
- README.md
|
189
204
|
- Rakefile
|
205
|
+
- gemfiles/sidekiq_4.gemfile
|
206
|
+
- gemfiles/sidekiq_5.gemfile
|
190
207
|
- lib/reactor.rb
|
191
208
|
- lib/reactor/controllers.rb
|
192
209
|
- lib/reactor/controllers/concerns/actions/action_event.rb
|
@@ -247,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
264
|
version: '0'
|
248
265
|
requirements: []
|
249
266
|
rubyforge_project:
|
250
|
-
rubygems_version: 2.
|
267
|
+
rubygems_version: 2.6.11
|
251
268
|
signing_key:
|
252
269
|
specification_version: 4
|
253
270
|
summary: Sidekiq/ActiveRecord pubsub lib
|