rails_event_store 1.3.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mutant.yml +1 -0
- data/Gemfile +3 -12
- data/Gemfile.lock +287 -0
- data/Gemfile.rails_5_0 +14 -0
- data/Gemfile.rails_5_0.lock +259 -0
- data/Gemfile.rails_5_1 +14 -0
- data/Gemfile.rails_5_1.lock +259 -0
- data/Gemfile.rails_5_2 +15 -0
- data/Gemfile.rails_5_2.lock +267 -0
- data/Gemfile.rails_6_0 +14 -0
- data/Gemfile.rails_6_0.lock +283 -0
- data/lib/generators/rails_event_store/bounded_context_generator.rb +32 -0
- data/lib/generators/rails_event_store/rspec_generator.rb +33 -0
- data/lib/generators/rails_event_store/test_unit_generator.rb +21 -0
- data/lib/generators/templates/bc_spec.rb +4 -0
- data/lib/generators/templates/module.rb +2 -0
- data/lib/generators/templates/require_bc_spec.rb +6 -0
- data/lib/generators/templates/spec_helper.rb +7 -0
- data/lib/generators/templates/test_helper.rb +1 -0
- data/lib/rails_event_store/active_job_scheduler.rb +9 -2
- data/lib/rails_event_store/after_commit_async_dispatcher.rb +2 -2
- data/lib/rails_event_store/async_handler_helpers.rb +18 -2
- data/lib/rails_event_store/client.rb +7 -3
- data/lib/rails_event_store/version.rb +1 -1
- data/rails_event_store.gemspec +4 -7
- metadata +29 -25
data/Gemfile.rails_6_0
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
eval_gemfile '../support/bundler/Gemfile.shared'
|
6
|
+
|
7
|
+
gem 'ruby_event_store', path: '../ruby_event_store'
|
8
|
+
gem 'ruby_event_store-browser', path: '../ruby_event_store-browser'
|
9
|
+
gem 'rails_event_store_active_record', path: '../rails_event_store_active_record'
|
10
|
+
gem 'aggregate_root', path: '../aggregate_root'
|
11
|
+
gem 'sidekiq'
|
12
|
+
gem 'rack-test'
|
13
|
+
gem 'rails', '6.0.3.4'
|
14
|
+
gem 'sqlite3', '1.4.2'
|
@@ -0,0 +1,283 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../aggregate_root
|
3
|
+
specs:
|
4
|
+
aggregate_root (2.0.0)
|
5
|
+
ruby_event_store (= 2.0.0)
|
6
|
+
|
7
|
+
PATH
|
8
|
+
remote: ../rails_event_store_active_record
|
9
|
+
specs:
|
10
|
+
rails_event_store_active_record (2.0.0)
|
11
|
+
activemodel (>= 3.0)
|
12
|
+
activerecord-import (>= 1.0.2)
|
13
|
+
activesupport (>= 3.0)
|
14
|
+
ruby_event_store (= 2.0.0)
|
15
|
+
|
16
|
+
PATH
|
17
|
+
remote: ../ruby_event_store-browser
|
18
|
+
specs:
|
19
|
+
ruby_event_store-browser (2.0.0)
|
20
|
+
ruby_event_store (= 2.0.0)
|
21
|
+
sinatra
|
22
|
+
|
23
|
+
PATH
|
24
|
+
remote: ../ruby_event_store
|
25
|
+
specs:
|
26
|
+
ruby_event_store (2.0.0)
|
27
|
+
concurrent-ruby (~> 1.0, >= 1.1.6)
|
28
|
+
|
29
|
+
PATH
|
30
|
+
remote: .
|
31
|
+
specs:
|
32
|
+
rails_event_store (2.0.0)
|
33
|
+
activejob (>= 3.0)
|
34
|
+
activemodel (>= 3.0)
|
35
|
+
activesupport (>= 3.0)
|
36
|
+
aggregate_root (= 2.0.0)
|
37
|
+
arkency-command_bus (>= 0.4)
|
38
|
+
rails_event_store_active_record (= 2.0.0)
|
39
|
+
ruby_event_store (= 2.0.0)
|
40
|
+
ruby_event_store-browser (= 2.0.0)
|
41
|
+
|
42
|
+
GEM
|
43
|
+
remote: https://rubygems.org/
|
44
|
+
remote: https://oss:7AXfeZdAfCqL1PvHm2nvDJO6Zd9UW8IK@gem.mutant.dev/
|
45
|
+
specs:
|
46
|
+
abstract_type (0.0.7)
|
47
|
+
actioncable (6.0.3.4)
|
48
|
+
actionpack (= 6.0.3.4)
|
49
|
+
nio4r (~> 2.0)
|
50
|
+
websocket-driver (>= 0.6.1)
|
51
|
+
actionmailbox (6.0.3.4)
|
52
|
+
actionpack (= 6.0.3.4)
|
53
|
+
activejob (= 6.0.3.4)
|
54
|
+
activerecord (= 6.0.3.4)
|
55
|
+
activestorage (= 6.0.3.4)
|
56
|
+
activesupport (= 6.0.3.4)
|
57
|
+
mail (>= 2.7.1)
|
58
|
+
actionmailer (6.0.3.4)
|
59
|
+
actionpack (= 6.0.3.4)
|
60
|
+
actionview (= 6.0.3.4)
|
61
|
+
activejob (= 6.0.3.4)
|
62
|
+
mail (~> 2.5, >= 2.5.4)
|
63
|
+
rails-dom-testing (~> 2.0)
|
64
|
+
actionpack (6.0.3.4)
|
65
|
+
actionview (= 6.0.3.4)
|
66
|
+
activesupport (= 6.0.3.4)
|
67
|
+
rack (~> 2.0, >= 2.0.8)
|
68
|
+
rack-test (>= 0.6.3)
|
69
|
+
rails-dom-testing (~> 2.0)
|
70
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
71
|
+
actiontext (6.0.3.4)
|
72
|
+
actionpack (= 6.0.3.4)
|
73
|
+
activerecord (= 6.0.3.4)
|
74
|
+
activestorage (= 6.0.3.4)
|
75
|
+
activesupport (= 6.0.3.4)
|
76
|
+
nokogiri (>= 1.8.5)
|
77
|
+
actionview (6.0.3.4)
|
78
|
+
activesupport (= 6.0.3.4)
|
79
|
+
builder (~> 3.1)
|
80
|
+
erubi (~> 1.4)
|
81
|
+
rails-dom-testing (~> 2.0)
|
82
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
83
|
+
activejob (6.0.3.4)
|
84
|
+
activesupport (= 6.0.3.4)
|
85
|
+
globalid (>= 0.3.6)
|
86
|
+
activemodel (6.0.3.4)
|
87
|
+
activesupport (= 6.0.3.4)
|
88
|
+
activerecord (6.0.3.4)
|
89
|
+
activemodel (= 6.0.3.4)
|
90
|
+
activesupport (= 6.0.3.4)
|
91
|
+
activerecord-import (1.0.7)
|
92
|
+
activerecord (>= 3.2)
|
93
|
+
activestorage (6.0.3.4)
|
94
|
+
actionpack (= 6.0.3.4)
|
95
|
+
activejob (= 6.0.3.4)
|
96
|
+
activerecord (= 6.0.3.4)
|
97
|
+
marcel (~> 0.3.1)
|
98
|
+
activesupport (6.0.3.4)
|
99
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
100
|
+
i18n (>= 0.7, < 2)
|
101
|
+
minitest (~> 5.1)
|
102
|
+
tzinfo (~> 1.1)
|
103
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
104
|
+
adamantium (0.2.0)
|
105
|
+
ice_nine (~> 0.11.0)
|
106
|
+
memoizable (~> 0.4.0)
|
107
|
+
anima (0.3.2)
|
108
|
+
abstract_type (~> 0.0.7)
|
109
|
+
adamantium (~> 0.2)
|
110
|
+
equalizer (~> 0.0.11)
|
111
|
+
arkency-command_bus (0.4.0)
|
112
|
+
thread_safe
|
113
|
+
ast (2.4.1)
|
114
|
+
builder (3.2.4)
|
115
|
+
concord (0.1.6)
|
116
|
+
adamantium (~> 0.2.0)
|
117
|
+
equalizer (~> 0.0.9)
|
118
|
+
concurrent-ruby (1.1.7)
|
119
|
+
connection_pool (2.2.3)
|
120
|
+
crass (1.0.6)
|
121
|
+
diff-lcs (1.4.4)
|
122
|
+
equalizer (0.0.11)
|
123
|
+
erubi (1.10.0)
|
124
|
+
globalid (0.4.2)
|
125
|
+
activesupport (>= 4.2.0)
|
126
|
+
i18n (1.8.5)
|
127
|
+
concurrent-ruby (~> 1.0)
|
128
|
+
ice_nine (0.11.2)
|
129
|
+
loofah (2.8.0)
|
130
|
+
crass (~> 1.0.2)
|
131
|
+
nokogiri (>= 1.5.9)
|
132
|
+
mail (2.7.1)
|
133
|
+
mini_mime (>= 0.1.1)
|
134
|
+
marcel (0.3.3)
|
135
|
+
mimemagic (~> 0.3.2)
|
136
|
+
memoizable (0.4.2)
|
137
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
138
|
+
method_source (1.0.0)
|
139
|
+
mimemagic (0.3.5)
|
140
|
+
mini_mime (1.0.2)
|
141
|
+
mini_portile2 (2.4.0)
|
142
|
+
minitest (5.14.2)
|
143
|
+
mprelude (0.1.0)
|
144
|
+
abstract_type (~> 0.0.7)
|
145
|
+
adamantium (~> 0.2.0)
|
146
|
+
concord (~> 0.1.5)
|
147
|
+
equalizer (~> 0.0.9)
|
148
|
+
ice_nine (~> 0.11.1)
|
149
|
+
procto (~> 0.0.2)
|
150
|
+
mustermann (1.1.1)
|
151
|
+
ruby2_keywords (~> 0.0.1)
|
152
|
+
mutant (0.10.22)
|
153
|
+
abstract_type (~> 0.0.7)
|
154
|
+
adamantium (~> 0.2.0)
|
155
|
+
anima (~> 0.3.1)
|
156
|
+
ast (~> 2.2)
|
157
|
+
concord (~> 0.1.5)
|
158
|
+
diff-lcs (~> 1.3)
|
159
|
+
equalizer (~> 0.0.9)
|
160
|
+
ice_nine (~> 0.11.1)
|
161
|
+
memoizable (~> 0.4.2)
|
162
|
+
mprelude (~> 0.1.0)
|
163
|
+
parser (~> 3.0.0)
|
164
|
+
procto (~> 0.0.2)
|
165
|
+
unparser (~> 0.5.6)
|
166
|
+
variable (~> 0.0.1)
|
167
|
+
mutant-license (0.1.1.2.1627430819213747598431630701693729869473.0)
|
168
|
+
mutant-rspec (0.10.22)
|
169
|
+
mutant (= 0.10.22)
|
170
|
+
rspec-core (>= 3.8.0, < 4.0.0)
|
171
|
+
nio4r (2.5.4)
|
172
|
+
nokogiri (1.10.10)
|
173
|
+
mini_portile2 (~> 2.4.0)
|
174
|
+
parser (3.0.0.0)
|
175
|
+
ast (~> 2.4.1)
|
176
|
+
procto (0.0.3)
|
177
|
+
rack (2.2.3)
|
178
|
+
rack-protection (2.1.0)
|
179
|
+
rack
|
180
|
+
rack-test (1.1.0)
|
181
|
+
rack (>= 1.0, < 3)
|
182
|
+
rails (6.0.3.4)
|
183
|
+
actioncable (= 6.0.3.4)
|
184
|
+
actionmailbox (= 6.0.3.4)
|
185
|
+
actionmailer (= 6.0.3.4)
|
186
|
+
actionpack (= 6.0.3.4)
|
187
|
+
actiontext (= 6.0.3.4)
|
188
|
+
actionview (= 6.0.3.4)
|
189
|
+
activejob (= 6.0.3.4)
|
190
|
+
activemodel (= 6.0.3.4)
|
191
|
+
activerecord (= 6.0.3.4)
|
192
|
+
activestorage (= 6.0.3.4)
|
193
|
+
activesupport (= 6.0.3.4)
|
194
|
+
bundler (>= 1.3.0)
|
195
|
+
railties (= 6.0.3.4)
|
196
|
+
sprockets-rails (>= 2.0.0)
|
197
|
+
rails-dom-testing (2.0.3)
|
198
|
+
activesupport (>= 4.2.0)
|
199
|
+
nokogiri (>= 1.6)
|
200
|
+
rails-html-sanitizer (1.3.0)
|
201
|
+
loofah (~> 2.3)
|
202
|
+
railties (6.0.3.4)
|
203
|
+
actionpack (= 6.0.3.4)
|
204
|
+
activesupport (= 6.0.3.4)
|
205
|
+
method_source
|
206
|
+
rake (>= 0.8.7)
|
207
|
+
thor (>= 0.20.3, < 2.0)
|
208
|
+
rake (13.0.3)
|
209
|
+
redis (4.2.5)
|
210
|
+
rspec (3.10.0)
|
211
|
+
rspec-core (~> 3.10.0)
|
212
|
+
rspec-expectations (~> 3.10.0)
|
213
|
+
rspec-mocks (~> 3.10.0)
|
214
|
+
rspec-core (3.10.1)
|
215
|
+
rspec-support (~> 3.10.0)
|
216
|
+
rspec-expectations (3.10.1)
|
217
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
218
|
+
rspec-support (~> 3.10.0)
|
219
|
+
rspec-mocks (3.10.1)
|
220
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
221
|
+
rspec-support (~> 3.10.0)
|
222
|
+
rspec-support (3.10.1)
|
223
|
+
ruby2_keywords (0.0.2)
|
224
|
+
sidekiq (6.1.2)
|
225
|
+
connection_pool (>= 2.2.2)
|
226
|
+
rack (~> 2.0)
|
227
|
+
redis (>= 4.2.0)
|
228
|
+
sinatra (2.1.0)
|
229
|
+
mustermann (~> 1.0)
|
230
|
+
rack (~> 2.2)
|
231
|
+
rack-protection (= 2.1.0)
|
232
|
+
tilt (~> 2.0)
|
233
|
+
sprockets (4.0.2)
|
234
|
+
concurrent-ruby (~> 1.0)
|
235
|
+
rack (> 1, < 3)
|
236
|
+
sprockets-rails (3.2.2)
|
237
|
+
actionpack (>= 4.0)
|
238
|
+
activesupport (>= 4.0)
|
239
|
+
sprockets (>= 3.0.0)
|
240
|
+
sqlite3 (1.4.2)
|
241
|
+
thor (1.0.1)
|
242
|
+
thread_safe (0.3.6)
|
243
|
+
tilt (2.0.10)
|
244
|
+
tzinfo (1.2.9)
|
245
|
+
thread_safe (~> 0.1)
|
246
|
+
unparser (0.5.6)
|
247
|
+
abstract_type (~> 0.0.7)
|
248
|
+
adamantium (~> 0.2.0)
|
249
|
+
anima (~> 0.3.1)
|
250
|
+
concord (~> 0.1.5)
|
251
|
+
diff-lcs (~> 1.3)
|
252
|
+
equalizer (~> 0.0.9)
|
253
|
+
mprelude (~> 0.1.0)
|
254
|
+
parser (>= 3.0.0)
|
255
|
+
procto (~> 0.0.2)
|
256
|
+
variable (0.0.1)
|
257
|
+
equalizer (~> 0.0.11)
|
258
|
+
websocket-driver (0.7.3)
|
259
|
+
websocket-extensions (>= 0.1.0)
|
260
|
+
websocket-extensions (0.1.5)
|
261
|
+
zeitwerk (2.4.2)
|
262
|
+
|
263
|
+
PLATFORMS
|
264
|
+
ruby
|
265
|
+
|
266
|
+
DEPENDENCIES
|
267
|
+
aggregate_root!
|
268
|
+
mutant (~> 0.10.21)
|
269
|
+
mutant-license!
|
270
|
+
mutant-rspec (~> 0.10.21)
|
271
|
+
rack-test
|
272
|
+
rails (= 6.0.3.4)
|
273
|
+
rails_event_store!
|
274
|
+
rails_event_store_active_record!
|
275
|
+
rake (>= 10.0)
|
276
|
+
rspec (~> 3.6)
|
277
|
+
ruby_event_store!
|
278
|
+
ruby_event_store-browser!
|
279
|
+
sidekiq
|
280
|
+
sqlite3 (= 1.4.2)
|
281
|
+
|
282
|
+
BUNDLED WITH
|
283
|
+
2.1.4
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators'
|
4
|
+
|
5
|
+
module RailsEventStore
|
6
|
+
module Generators
|
7
|
+
class BoundedContextGenerator < Rails::Generators::NamedBase
|
8
|
+
source_root File.expand_path(File.join(File.dirname(__FILE__), '../templates'))
|
9
|
+
hook_for :test_framework
|
10
|
+
|
11
|
+
def create_bounded_context
|
12
|
+
create_file "#{bounded_context_name}/lib/#{bounded_context_name}/.keep"
|
13
|
+
|
14
|
+
template "module.rb", "#{bounded_context_name}/lib/#{bounded_context_name}.rb"
|
15
|
+
|
16
|
+
application do
|
17
|
+
"config.paths.add '#{bounded_context_name}/lib', eager_load: true"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def bounded_context_namespace
|
24
|
+
name.camelize
|
25
|
+
end
|
26
|
+
|
27
|
+
def bounded_context_name
|
28
|
+
name.underscore
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators'
|
4
|
+
|
5
|
+
module RailsEventStore
|
6
|
+
module Generators
|
7
|
+
class RspecGenerator < Rails::Generators::NamedBase
|
8
|
+
source_root File.expand_path(File.join(File.dirname(__FILE__), '../templates'))
|
9
|
+
|
10
|
+
def spec_helper
|
11
|
+
template "spec_helper.rb", "#{bounded_context_name}/spec/spec_helper.rb"
|
12
|
+
end
|
13
|
+
|
14
|
+
def bc_spec
|
15
|
+
template "bc_spec.rb", "#{bounded_context_name}/spec/#{bounded_context_name}_spec.rb"
|
16
|
+
end
|
17
|
+
|
18
|
+
def require_bc_spec
|
19
|
+
template "require_bc_spec.rb", "spec/#{bounded_context_name}_spec.rb"
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def bounded_context_namespace
|
25
|
+
name.camelize
|
26
|
+
end
|
27
|
+
|
28
|
+
def bounded_context_name
|
29
|
+
name.underscore
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators'
|
4
|
+
|
5
|
+
module RailsEventStore
|
6
|
+
module Generators
|
7
|
+
class TestUnitGenerator < Rails::Generators::NamedBase
|
8
|
+
source_root File.expand_path(File.join(File.dirname(__FILE__), '../templates'))
|
9
|
+
|
10
|
+
def test_helper
|
11
|
+
template "test_helper.rb", "#{bounded_context_name}/test/test_helper.rb"
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def bounded_context_name
|
17
|
+
name.underscore
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
ENV['RAILS_ENV'] = 'test'
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('../../../spec', __FILE__)
|
4
|
+
require File.expand_path('../../../config/environment', __FILE__)
|
5
|
+
require File.expand_path('../../../spec/rails_helper', __FILE__)
|
6
|
+
|
7
|
+
require_relative '../lib/<%= bounded_context_name %>'
|
@@ -0,0 +1 @@
|
|
1
|
+
require_relative '../lib/<%= bounded_context_name %>'
|
@@ -4,12 +4,19 @@ require 'active_job'
|
|
4
4
|
|
5
5
|
module RailsEventStore
|
6
6
|
class ActiveJobScheduler
|
7
|
-
def
|
8
|
-
|
7
|
+
def initialize(serializer:)
|
8
|
+
@serializer = serializer
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(klass, record)
|
12
|
+
klass.perform_later(record.serialize(serializer).to_h)
|
9
13
|
end
|
10
14
|
|
11
15
|
def verify(subscriber)
|
12
16
|
Class === subscriber && !!(subscriber < ActiveJob::Base)
|
13
17
|
end
|
18
|
+
|
19
|
+
private
|
20
|
+
attr_reader :serializer
|
14
21
|
end
|
15
22
|
end
|