lev 7.1.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/lev/active_job.rb +3 -3
- data/lib/lev/object.rb +1 -1
- data/lib/lev/routine.rb +2 -2
- data/lib/lev/version.rb +1 -1
- data/spec/active_job_routines_spec.rb +1 -1
- data/spec/statused_routines_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23ac8b75438c4dcc055ba30a3df6862646138cb9
|
4
|
+
data.tar.gz: 244bc1d7505e6dd29e84412f241cb1bde0cb82d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1a19da74d6ddd287fba67e6f7caf05d52651d1a572b29a9500e835ebc83654d3a1a63102b8a7e775de30429f9810d64bb335c55fb0a275cf9ef107b0451f93d
|
7
|
+
data.tar.gz: 90c37a45bbba09d725ec5ceda5661706d9b579885741309dd6f15b53ea3499fea2df7cb02b536fd17a3ce8484bf93bddf652f2ed6675a94207c91fe68921de79
|
data/README.md
CHANGED
@@ -426,7 +426,7 @@ By default jobs are placed in the `:default` queue, but you can override this in
|
|
426
426
|
|
427
427
|
```ruby
|
428
428
|
class MyRoutine
|
429
|
-
lev_routine
|
429
|
+
lev_routine active_job_enqueue_options: { queue: :some_other_queue }
|
430
430
|
end
|
431
431
|
```
|
432
432
|
|
data/lib/lev/active_job.rb
CHANGED
@@ -4,8 +4,6 @@ module Lev
|
|
4
4
|
attr_accessor(:provider_job_id) unless respond_to?(:provider_job_id)
|
5
5
|
|
6
6
|
def self.perform_later(routine_class, *args, &block)
|
7
|
-
queue_as routine_class.active_job_queue
|
8
|
-
|
9
7
|
# Create a new status object
|
10
8
|
status = Lev::create_status
|
11
9
|
|
@@ -27,7 +25,9 @@ module Lev
|
|
27
25
|
# Queue up the job and set the provider_job_id
|
28
26
|
# For delayed_job, requires either Rails 5 or
|
29
27
|
# http://stackoverflow.com/questions/29855768/rails-4-2-get-delayed-job-id-from-active-job
|
30
|
-
provider_job_id =
|
28
|
+
provider_job_id = job_or_instantiate(*args, &block)
|
29
|
+
.enqueue(routine_class.active_job_enqueue_options)
|
30
|
+
.provider_job_id
|
31
31
|
status.set_provider_job_id(provider_job_id) \
|
32
32
|
if provider_job_id.present? && status.respond_to?(:set_provider_job_id)
|
33
33
|
|
data/lib/lev/object.rb
CHANGED
@@ -8,7 +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
|
-
@
|
11
|
+
@active_job_enqueue_options = options[:active_job_enqueue_options]
|
12
12
|
|
13
13
|
@raise_fatal_errors = options[:raise_fatal_errors]
|
14
14
|
|
data/lib/lev/routine.rb
CHANGED
@@ -213,8 +213,8 @@ module Lev
|
|
213
213
|
Lev::ActiveJob::Base.perform_later(self, *args, &block)
|
214
214
|
end
|
215
215
|
|
216
|
-
def
|
217
|
-
@
|
216
|
+
def active_job_enqueue_options
|
217
|
+
@active_job_enqueue_options || { queue: :default }
|
218
218
|
end
|
219
219
|
|
220
220
|
# Called at a routine's class level to foretell which other routines will
|
data/lib/lev/version.rb
CHANGED
@@ -27,7 +27,7 @@ RSpec.describe 'Statused Routines' do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'sets the provider_job_id on the status' do
|
30
|
-
|
30
|
+
allow_any_instance_of(Lev::ActiveJob::Base).to receive(:provider_job_id).and_return(42)
|
31
31
|
|
32
32
|
expect(status.provider_job_id).to eq 42
|
33
33
|
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:
|
4
|
+
version: 8.0.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: 2017-
|
11
|
+
date: 2017-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -292,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
292
|
version: '0'
|
293
293
|
requirements: []
|
294
294
|
rubyforge_project:
|
295
|
-
rubygems_version: 2.
|
295
|
+
rubygems_version: 2.4.5.1
|
296
296
|
signing_key:
|
297
297
|
specification_version: 4
|
298
298
|
summary: Ride the rails but don't touch them.
|