activejob 5.0.0.1 → 5.0.1.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activejob might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11780986d40be2ea5d17720db6795c302bfa7f81
4
- data.tar.gz: abd333efce7fd40830c9bb232e24f735bacc8018
3
+ metadata.gz: c88dc2a35d24fef3beee52a581f7b06115afa3ff
4
+ data.tar.gz: e4c8a78a5ba7de441196d36ff1885871c4489aec
5
5
  SHA512:
6
- metadata.gz: d293881a2cd624b3a539738902da169dec408c10699c065796652c0712577ae6ece594d65a9205ae3bffbd9d0a65a6dcb2a3433a44b9e14bcc92c3fdb3ccbd8a
7
- data.tar.gz: dd68b8ae60832abcded5fc4316ceaf2d5efa8932b70c3af8b086827838b8db7ced8793901880741d79ae9b1e7eba2ee1c322d4024db04a3076adb253caf72fb7
6
+ metadata.gz: 9aa3b88ea9bbfb7ab34b6601a60aeac98d3551a0975ada9f35bd330136fa998cdacdbe573507b8ab6f3b097cf2bf64cd2669cefe2aab82b9710e118e40b007d0
7
+ data.tar.gz: f55b23bcc5abb4adcdcff207664f8f094c9ce667f1e424f443d2861c1cbc32bf502aab2a28e7caa2f17fefd702523862b4cc30238845abcb97e0f9430bbf0d57
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## Rails 5.0.1.rc1 (December 01, 2016) ##
2
+
3
+ * Added instance variable `@queue` to JobWrapper.
4
+
5
+ This will fix issues in [resque-scheduler](https://github.com/resque/resque-scheduler) `#job_to_hash` method,
6
+ so we can use `#enqueue_delayed_selection`, `#remove_delayed` method in resque-scheduler smoothly.
7
+
8
+ *mu29*
9
+
10
+
1
11
  ## Rails 5.0.0 (June 30, 2016) ##
2
12
 
3
13
  * Enable class reloading prior to job dispatch, and ensure Active Record
data/README.md CHANGED
@@ -102,7 +102,7 @@ The latest version of Active Job can be installed with RubyGems:
102
102
 
103
103
  Source code can be downloaded as part of the Rails project on GitHub
104
104
 
105
- * https://github.com/rails/rails/tree/master/activejob
105
+ * https://github.com/rails/rails/tree/5-0-stable/activejob
106
106
 
107
107
  ## License
108
108
 
@@ -105,6 +105,7 @@ module ActiveJob
105
105
  # end
106
106
  def deserialize(job_data)
107
107
  self.job_id = job_data['job_id']
108
+ self.provider_job_id = job_data['provider_job_id']
108
109
  self.queue_name = job_data['queue_name']
109
110
  self.priority = job_data['priority']
110
111
  self.serialized_arguments = job_data['arguments']
@@ -7,8 +7,8 @@ module ActiveJob
7
7
  module VERSION
8
8
  MAJOR = 5
9
9
  MINOR = 0
10
- TINY = 0
11
- PRE = "1"
10
+ TINY = 1
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -27,6 +27,7 @@ module ActiveJob
27
27
  # Rails.application.config.active_job.queue_adapter = :resque
28
28
  class ResqueAdapter
29
29
  def enqueue(job) #:nodoc:
30
+ JobWrapper.instance_variable_set(:@queue, job.queue_name)
30
31
  Resque.enqueue_to job.queue_name, JobWrapper, job.serialize
31
32
  end
32
33
 
@@ -37,7 +37,7 @@ module ActiveJob
37
37
  include Sidekiq::Worker
38
38
 
39
39
  def perform(job_data)
40
- Base.execute job_data
40
+ Base.execute job_data.merge('provider_job_id' => jid)
41
41
  end
42
42
  end
43
43
  end
@@ -3,5 +3,7 @@ require 'active_support/test_case'
3
3
  module ActiveJob
4
4
  class TestCase < ActiveSupport::TestCase
5
5
  include ActiveJob::TestHelper
6
+
7
+ ActiveSupport.run_load_hooks(:active_job_test_case, self)
6
8
  end
7
9
  end
@@ -11,7 +11,7 @@ module ActiveJob
11
11
  def before_setup # :nodoc:
12
12
  test_adapter = queue_adapter_for_test
13
13
 
14
- @old_queue_adapters = (ActiveJob::Base.subclasses << ActiveJob::Base).select do |klass|
14
+ @old_queue_adapters = (ActiveJob::Base.descendants << ActiveJob::Base).select do |klass|
15
15
  # only override explicitly set adapters, a quirk of `class_attribute`
16
16
  klass.singleton_class.public_instance_methods(false).include?(:_queue_adapter)
17
17
  end.map do |klass|
@@ -269,6 +269,25 @@ module ActiveJob
269
269
  instantiate_job(matching_job)
270
270
  end
271
271
 
272
+ # Performs all enqueued jobs in the duration of the block.
273
+ #
274
+ # def test_perform_enqueued_jobs
275
+ # perform_enqueued_jobs do
276
+ # MyJob.perform_later(1, 2, 3)
277
+ # end
278
+ # assert_performed_jobs 1
279
+ # end
280
+ #
281
+ # This method also supports filtering. If the +:only+ option is specified,
282
+ # then only the listed job(s) will be performed.
283
+ #
284
+ # def test_perform_enqueued_jobs_with_only
285
+ # perform_enqueued_jobs(only: MyJob) do
286
+ # MyJob.perform_later(1, 2, 3) # will be performed
287
+ # HelloJob.perform_later(1, 2, 3) # will not be perfomed
288
+ # end
289
+ # assert_performed_jobs 1
290
+ # end
272
291
  def perform_enqueued_jobs(only: nil)
273
292
  old_perform_enqueued_jobs = queue_adapter.perform_enqueued_jobs
274
293
  old_perform_enqueued_at_jobs = queue_adapter.perform_enqueued_at_jobs
@@ -286,6 +305,11 @@ module ActiveJob
286
305
  end
287
306
  end
288
307
 
308
+ # Accesses the queue_adapter set by ActiveJob::Base.
309
+ #
310
+ # def test_assert_job_has_custom_queue_adapter_set
311
+ # assert_instance_of CustomQueueAdapter, HelloJob.queue_adapter
312
+ # end
289
313
  def queue_adapter
290
314
  ActiveJob::Base.queue_adapter
291
315
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activejob
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.1
4
+ version: 5.0.1.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-10 00:00:00.000000000 Z
11
+ date: 2016-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0.1
19
+ version: 5.0.1.rc1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0.1
26
+ version: 5.0.1.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: globalid
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -96,14 +96,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
96
  version: 2.2.2
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - ">="
99
+ - - ">"
100
100
  - !ruby/object:Gem::Version
101
- version: '0'
101
+ version: 1.3.1
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.6.6
104
+ rubygems_version: 2.5.2
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Job framework with pluggable queues.
108
108
  test_files: []
109
- has_rdoc: