lev 7.1.0 → 8.0.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
  SHA1:
3
- metadata.gz: d9ea57006e876643c43923721b4df56584b6c7a7
4
- data.tar.gz: 90fa8d60e6c1a7229d143614b1b74e0470c92458
3
+ metadata.gz: 23ac8b75438c4dcc055ba30a3df6862646138cb9
4
+ data.tar.gz: 244bc1d7505e6dd29e84412f241cb1bde0cb82d0
5
5
  SHA512:
6
- metadata.gz: 2b7a39b7c78d35f1b62d61a36607fea7fec2fe9d3416e3fd1442322967e0fd932bdbbca65b6ec9cc0e48073b14bdc9e559293559e6fc6e2c6dec29588f047362
7
- data.tar.gz: e1938a24304b4d9c3673098aa48e9c0dd13b70839a7e6c72e84b79800da9c68bb64e24fce187f3ce3545ab893c716a98447338117eddc67395ac6b8477ad88d5
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 active_job_queue: :some_other_queue
429
+ lev_routine active_job_enqueue_options: { queue: :some_other_queue }
430
430
  end
431
431
  ```
432
432
 
@@ -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 = super(*args, &block).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
 
@@ -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
- @active_job_queue = options[:active_job_queue]
11
+ @active_job_enqueue_options = options[:active_job_enqueue_options]
12
12
 
13
13
  @raise_fatal_errors = options[:raise_fatal_errors]
14
14
 
@@ -213,8 +213,8 @@ module Lev
213
213
  Lev::ActiveJob::Base.perform_later(self, *args, &block)
214
214
  end
215
215
 
216
- def active_job_queue
217
- @active_job_queue || :default
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
@@ -1,3 +1,3 @@
1
1
  module Lev
2
- VERSION = "7.1.0"
2
+ VERSION = "8.0.0"
3
3
  end
@@ -6,7 +6,7 @@ RSpec.describe 'ActiveJob routines' do
6
6
 
7
7
  context 'default configuration' do
8
8
  class LaterRoutine
9
- lev_routine active_job_queue: :something_else
9
+ lev_routine active_job_enqueue_options: { queue: :something_else }
10
10
 
11
11
  protected
12
12
  def exec; end
@@ -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
- expect_any_instance_of(Lev::ActiveJob::Base).to receive(:provider_job_id).and_return(42)
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: 7.1.0
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-04-17 00:00:00.000000000 Z
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.6.6
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.