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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da971d93b095041982057a4cb6fb16f08c005491d8f1e24b72116d1c446b18c9
4
- data.tar.gz: 6f9a9b4969b3717fdd6a1f70c6cb80bd0d4eabd1823a3aab56e493bcc1c70cdf
3
+ metadata.gz: fb4ccab91175edafaeff83e3bab8ab84e5a650ebc88b5000bf848ff1ad171d49
4
+ data.tar.gz: ce48c8cc00ed7edfa6076b5ba91ddbf11933f0a4b9f02e65dd6548ab69fc5b6c
5
5
  SHA512:
6
- metadata.gz: 0a3c6526b61cd1ac8940970ad1848d25962a2c198fa2c0a4ac581809e13f1e264d1ad20d67ef338caed3d563c707964b22134a350ff9d065dd0136e1b3a048b5
7
- data.tar.gz: b7edf1a66d8d3ac8b6849639e587dd7a2b3215fcf9db256a0ec815a7ecab22ef6e47180d3c93ca69ddc6131ef6372f1ba1fc98de9b5d59b9af8e1efac0118710
6
+ metadata.gz: 9dc7506db7fe12a5122596ea9f6cdf6682bc2f601f6b89d6dc26c49c1733e53a3d74ff0679430877deaf94c1009ab22a2bde64432cd8c946a5790237177c9f25
7
+ data.tar.gz: 53125d7cb41f17b27539b45802d4ec1dff132434c4d4dcdddc0294128c8a973a02f2bea2df8a852d986b5ecb4e46462af3d552198846a8c2f8caf10ab255d400
@@ -13,7 +13,7 @@ module Lev
13
13
  end
14
14
 
15
15
  def perform_later(*args, &block)
16
- Lev::ActiveJob::Base.new.perform_later(routine_class, options, *args, &block)
16
+ routine_class.job_class.new.perform_later(routine_class, options, *args, &block)
17
17
  end
18
18
  end
19
19
  end
@@ -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]
@@ -214,23 +214,26 @@ module Lev
214
214
  Lev::ActiveJob::ConfiguredJob.new(self, options)
215
215
  end
216
216
 
217
- def perform_later(*args, &block)
218
- # Delegate to a subclass of Lev::Routine::ActiveJob::Base
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
- raise Lev.configuration.illegal_argument_error, "Routine #{routine_class} has already been registered" \
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,
@@ -1,3 +1,3 @@
1
1
  module Lev
2
- VERSION = '10.0.0'
2
+ VERSION = '10.1.0'
3
3
  end
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.0.0
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-02-18 00:00:00.000000000 Z
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.1.1
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/spec_helper.rb
273
+ - spec/active_job_routines_spec.rb
302
274
  - spec/paramify_handler_spec.rb
303
- - spec/sprocket_handler_spec.rb
275
+ - spec/spec_helper.rb
276
+ - spec/sprocket_spec.rb
304
277
  - spec/create_sprocket_spec.rb
305
- - spec/delegates_to_spec.rb
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/support/paramify_handler_b.rb
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/sprocket_spec.rb
317
- - spec/outputs_spec.rb
318
- - spec/routine_spec.rb
319
- - spec/active_job_routines_spec.rb
320
- - spec/statused_routines_spec.rb
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