lev 10.0.0 → 10.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lev/active_job/configured_job.rb +1 -1
- data/lib/lev/object.rb +1 -0
- data/lib/lev/routine.rb +8 -5
- data/lib/lev/version.rb +1 -1
- metadata +16 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb4ccab91175edafaeff83e3bab8ab84e5a650ebc88b5000bf848ff1ad171d49
|
4
|
+
data.tar.gz: ce48c8cc00ed7edfa6076b5ba91ddbf11933f0a4b9f02e65dd6548ab69fc5b6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dc7506db7fe12a5122596ea9f6cdf6682bc2f601f6b89d6dc26c49c1733e53a3d74ff0679430877deaf94c1009ab22a2bde64432cd8c946a5790237177c9f25
|
7
|
+
data.tar.gz: 53125d7cb41f17b27539b45802d4ec1dff132434c4d4dcdddc0294128c8a973a02f2bea2df8a852d986b5ecb4e46462af3d552198846a8c2f8caf10ab255d400
|
data/lib/lev/object.rb
CHANGED
@@ -8,6 +8,7 @@ class Object
|
|
8
8
|
options[:transaction] ||= Lev::TransactionIsolation.mysql_default.symbol
|
9
9
|
@transaction_isolation = Lev::TransactionIsolation.new(options[:transaction])
|
10
10
|
|
11
|
+
@job_class = options[:job_class]
|
11
12
|
@active_job_enqueue_options = options[:active_job_enqueue_options]
|
12
13
|
|
13
14
|
@raise_fatal_errors = options[:raise_fatal_errors]
|
data/lib/lev/routine.rb
CHANGED
@@ -214,23 +214,26 @@ module Lev
|
|
214
214
|
Lev::ActiveJob::ConfiguredJob.new(self, options)
|
215
215
|
end
|
216
216
|
|
217
|
-
def
|
218
|
-
|
219
|
-
Lev::ActiveJob::Base.new.perform_later(self, active_job_enqueue_options, *args, &block)
|
217
|
+
def job_class
|
218
|
+
@job_class || Lev::ActiveJob::Base
|
220
219
|
end
|
221
220
|
|
222
221
|
def active_job_enqueue_options
|
223
222
|
@active_job_enqueue_options || { queue: :default }
|
224
223
|
end
|
225
224
|
|
225
|
+
def perform_later(*args, &block)
|
226
|
+
# Delegate to a subclass of Lev::Routine::ActiveJob::Base
|
227
|
+
job_class.new.perform_later(self, active_job_enqueue_options, *args, &block)
|
228
|
+
end
|
229
|
+
|
226
230
|
# Called at a routine's class level to foretell which other routines will
|
227
231
|
# be used when this routine executes. Helpful for figuring out ahead of
|
228
232
|
# time what kind of transaction isolation level should be used.
|
229
233
|
def uses_routine(routine_class, options={})
|
230
234
|
symbol = options[:as] || class_to_symbol(routine_class)
|
231
235
|
|
232
|
-
|
233
|
-
if nested_routines[symbol]
|
236
|
+
warn("Routine #{routine_class} has already been registered") if nested_routines[symbol]
|
234
237
|
|
235
238
|
nested_routines[symbol] = {
|
236
239
|
routine_class: routine_class,
|
data/lib/lev/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.
|
4
|
+
version: 10.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -178,20 +178,6 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: byebug
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - ">="
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '0'
|
188
|
-
type: :development
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - ">="
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '0'
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
182
|
name: jobba
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,20 +192,6 @@ dependencies:
|
|
206
192
|
- - ">="
|
207
193
|
- !ruby/object:Gem::Version
|
208
194
|
version: '1.5'
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: rails
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - ">="
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: '0'
|
216
|
-
type: :development
|
217
|
-
prerelease: false
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
219
|
-
requirements:
|
220
|
-
- - ">="
|
221
|
-
- !ruby/object:Gem::Version
|
222
|
-
version: '0'
|
223
195
|
description: Ride the rails but don't touch them.
|
224
196
|
email:
|
225
197
|
- jps@kindlinglabs.com
|
@@ -293,28 +265,28 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
293
265
|
- !ruby/object:Gem::Version
|
294
266
|
version: '0'
|
295
267
|
requirements: []
|
296
|
-
rubygems_version: 3.
|
268
|
+
rubygems_version: 3.0.3
|
297
269
|
signing_key:
|
298
270
|
specification_version: 4
|
299
271
|
summary: Ride the rails but don't touch them.
|
300
272
|
test_files:
|
301
|
-
- spec/
|
273
|
+
- spec/active_job_routines_spec.rb
|
302
274
|
- spec/paramify_handler_spec.rb
|
303
|
-
- spec/
|
275
|
+
- spec/spec_helper.rb
|
276
|
+
- spec/sprocket_spec.rb
|
304
277
|
- spec/create_sprocket_spec.rb
|
305
|
-
- spec/
|
306
|
-
- spec/better_active_model_errors_spec.rb
|
307
|
-
- spec/transaction_spec.rb
|
278
|
+
- spec/outputs_spec.rb
|
308
279
|
- spec/deep_merge_spec.rb
|
309
|
-
- spec/
|
280
|
+
- spec/sprocket_handler_spec.rb
|
281
|
+
- spec/statused_routines_spec.rb
|
282
|
+
- spec/better_active_model_errors_spec.rb
|
283
|
+
- spec/routine_spec.rb
|
310
284
|
- spec/support/sprocket_handler.rb
|
311
|
-
- spec/support/paramify_handler_a.rb
|
312
|
-
- spec/support/delegating_routine.rb
|
313
285
|
- spec/support/create_sprocket.rb
|
314
286
|
- spec/support/delegated_routine.rb
|
315
287
|
- spec/support/sprocket.rb
|
316
|
-
- spec/
|
317
|
-
- spec/
|
318
|
-
- spec/
|
319
|
-
- spec/
|
320
|
-
- spec/
|
288
|
+
- spec/support/paramify_handler_a.rb
|
289
|
+
- spec/support/paramify_handler_b.rb
|
290
|
+
- spec/support/delegating_routine.rb
|
291
|
+
- spec/transaction_spec.rb
|
292
|
+
- spec/delegates_to_spec.rb
|