delayed_job 4.1.8 → 4.1.9

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: 3671145ff491daea2d3e26336b54cdae0d4e0293654c11fdcb3a41a516741219
4
- data.tar.gz: 1dab4a137c0cec054cd7c73fc395d5a918f5fc7cc619ae3879687ae17b36a439
3
+ metadata.gz: 2c2e880a669ae56ceb7d75aa435f7a24540f3ff1669d5f0513eb82d7418cbcb5
4
+ data.tar.gz: aa5972d6556772c30eae6bff54bfa6fe02216d532af37d780f4da58c3beff702
5
5
  SHA512:
6
- metadata.gz: 707798d3698ef7e67896381a43b75f03f0b63653c79c514b3e932b53b6883ded11476fe8b5749e44b5722562d7f479fdb6b70f46c9c279fe08fe9eaafb0110a6
7
- data.tar.gz: 917341ca90f82622329579ae796378b241822903f5570488e2a6f9dc785028f7e14567c395d5258b409ba8b2c30ee062c0cfeaf985e094b185416296d0e3a18b
6
+ metadata.gz: edc7f370dc4f2783ada28648641be2274fee0adc260d2f4f230a999884850c5cff6aa5086b5df56c0be288ac23dd9edc997b48dc24b378ab8b8c99bf9e74107f
7
+ data.tar.gz: 3e5162db607ddf2d9b35c4a931deea4dfd494a683730652b14d067b911717c4bb8484205cec85190c7a695dba01ef68d405e6070ec961471fd9c32630c0e352c
@@ -1,29 +1,34 @@
1
+ 4.1.9 - 2020-12-09
2
+ ==================
3
+ * Support for Rails 6.1
4
+ * Add support for parameterized mailers via delay call (#1121)
5
+
1
6
  4.1.8 - 2019-08-16
2
- =================
7
+ ==================
3
8
  * Support for Rails 6.0.0
4
9
 
5
10
  4.1.7 - 2019-06-20
6
- =================
11
+ ==================
7
12
  * Fix loading Delayed::PerformableMailer when ActionMailer isn't loaded yet
8
13
 
9
14
  4.1.6 - 2019-06-19
10
- =================
15
+ ==================
11
16
  * Properly initialize ActionMailer outside railties (#1077)
12
17
  * Fix Psych load_tags support (#1093)
13
18
  * Replace REMOVED with FAILED in log message (#1048)
14
19
  * Misc doc updates (#1052, #1074, #1064, #1063)
15
20
 
16
21
  4.1.5 - 2018-04-13
17
- =================
22
+ ==================
18
23
  * Allow Rails 5.2
19
24
 
20
25
  4.1.4 - 2017-12-29
21
- =================
26
+ ==================
22
27
  * Use `yaml_tag` instead of deprecated `yaml_as` (#996)
23
28
  * Support ruby 2.5.0
24
29
 
25
30
  4.1.3 - 2017-05-26
26
- =================
31
+ ==================
27
32
  * Don't mutate the options hash (#877)
28
33
  * Log an error message when a deserialization error occurs (#894)
29
34
  * Adding the queue name to the log output (#917)
data/README.md CHANGED
@@ -1,17 +1,16 @@
1
1
  **If you're viewing this at https://github.com/collectiveidea/delayed_job,
2
2
  you're reading the documentation for the master branch.
3
3
  [View documentation for the latest release
4
- (4.1.8).](https://github.com/collectiveidea/delayed_job/tree/v4.1.8)**
4
+ (4.1.9).](https://github.com/collectiveidea/delayed_job/tree/v4.1.9)**
5
5
 
6
6
  Delayed::Job
7
7
  ============
8
8
  [![Gem Version](https://badge.fury.io/rb/delayed_job.svg)][gem]
9
- [![Build Status](https://travis-ci.org/collectiveidea/delayed_job.svg?branch=master)][travis]
9
+ ![CI](https://github.com/collectiveidea/delayed_job/workflows/CI/badge.svg)
10
10
  [![Code Climate](https://codeclimate.com/github/collectiveidea/delayed_job.svg)][codeclimate]
11
11
  [![Coverage Status](https://coveralls.io/repos/collectiveidea/delayed_job/badge.svg?branch=master)][coveralls]
12
12
 
13
13
  [gem]: https://rubygems.org/gems/delayed_job
14
- [travis]: https://travis-ci.org/collectiveidea/delayed_job
15
14
  [codeclimate]: https://codeclimate.com/github/collectiveidea/delayed_job
16
15
  [coveralls]: https://coveralls.io/r/collectiveidea/delayed_job
17
16
 
@@ -168,9 +167,10 @@ end
168
167
 
169
168
  If you ever want to call a `handle_asynchronously`'d method without Delayed Job, for instance while debugging something at the console, just add `_without_delay` to the method name. For instance, if your original method was `foo`, then call `foo_without_delay`.
170
169
 
171
- Rails 3 Mailers
172
- ===============
173
- Due to how mailers are implemented in Rails 3, we had to do a little work around to get delayed_job to work.
170
+ Rails Mailers
171
+ =============
172
+ Delayed Job uses special syntax for Rails Mailers.
173
+ Do not call the `.deliver` method when using `.delay`.
174
174
 
175
175
  ```ruby
176
176
  # without delayed_job
@@ -179,12 +179,16 @@ Notifier.signup(@user).deliver
179
179
  # with delayed_job
180
180
  Notifier.delay.signup(@user)
181
181
 
182
- # with delayed_job running at a specific time
182
+ # delayed_job running at a specific time
183
183
  Notifier.delay(run_at: 5.minutes.from_now).signup(@user)
184
+
185
+ # when using parameters, the .with method must be called before the .delay method
186
+ Notifier.with(foo: 1, bar: 2).delay.signup(@user)
184
187
  ```
185
188
 
186
- Remove the `.deliver` method to make it work. It's not ideal, but it's the best
187
- we could do for now.
189
+ You may also wish to consider using
190
+ [Active Job with Action Mailer](https://edgeguides.rubyonrails.org/active_job_basics.html#action-mailer)
191
+ which provides convenient `.deliver_later` syntax that forwards to Delayed Job under-the-hood.
188
192
 
189
193
  Named Queues
190
194
  ============
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  Gem::Specification.new do |spec|
4
- spec.add_dependency 'activesupport', ['>= 3.0', '< 6.1']
4
+ spec.add_dependency 'activesupport', ['>= 3.0', '< 6.2']
5
5
  spec.authors = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke']
6
6
  spec.description = 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.'
7
7
  spec.email = ['brian@collectiveidea.com']
@@ -13,5 +13,10 @@ Gem::Specification.new do |spec|
13
13
  spec.require_paths = ['lib']
14
14
  spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify'
15
15
  spec.test_files = Dir.glob('spec/**/*')
16
- spec.version = '4.1.8'
16
+ spec.version = '4.1.9'
17
+ spec.metadata = {
18
+ 'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md',
19
+ 'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues',
20
+ 'source_code_uri' => 'https://github.com/collectiveidea/delayed_job'
21
+ }
17
22
  end
@@ -16,6 +16,7 @@ require 'delayed/railtie' if defined?(Rails::Railtie)
16
16
  ActiveSupport.on_load(:action_mailer) do
17
17
  require 'delayed/performable_mailer'
18
18
  ActionMailer::Base.extend(Delayed::DelayMail)
19
+ ActionMailer::Parameterized::Mailer.include(Delayed::DelayMail) if defined?(ActionMailer::Parameterized::Mailer)
19
20
  end
20
21
 
21
22
  module Delayed
@@ -1,13 +1,19 @@
1
1
  require 'simplecov'
2
- require 'coveralls'
2
+ require 'simplecov-lcov'
3
3
 
4
- SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]
4
+ SimpleCov::Formatter::LcovFormatter.config do |c|
5
+ c.report_with_single_file = true
6
+ c.single_report_path = 'coverage/lcov.info'
7
+ end
8
+ SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
9
+ [
10
+ SimpleCov::Formatter::HTMLFormatter,
11
+ SimpleCov::Formatter::LcovFormatter
12
+ ]
13
+ )
5
14
 
6
15
  SimpleCov.start do
7
16
  add_filter '/spec/'
8
- # Each version of ruby and version of rails test different things
9
- # This should probably just be removed.
10
- minimum_coverage(85.0)
11
17
  end
12
18
 
13
19
  require 'logger'
@@ -40,3 +40,29 @@ describe ActionMailer::Base do
40
40
  end
41
41
  end
42
42
  end
43
+
44
+ if defined?(ActionMailer::Parameterized::Mailer)
45
+ describe ActionMailer::Parameterized::Mailer do
46
+ describe 'delay' do
47
+ it 'enqueues a PerformableEmail job' do
48
+ expect do
49
+ job = MyMailer.with(:foo => 1, :bar => 2).delay.signup('john@example.com')
50
+ expect(job.payload_object.class).to eq(Delayed::PerformableMailer)
51
+ expect(job.payload_object.object.class).to eq(ActionMailer::Parameterized::Mailer)
52
+ expect(job.payload_object.object.instance_variable_get('@mailer')).to eq(MyMailer)
53
+ expect(job.payload_object.object.instance_variable_get('@params')).to eq(:foo => 1, :bar => 2)
54
+ expect(job.payload_object.method_name).to eq(:signup)
55
+ expect(job.payload_object.args).to eq(['john@example.com'])
56
+ end.to change { Delayed::Job.count }.by(1)
57
+ end
58
+ end
59
+
60
+ describe 'delay on a mail object' do
61
+ it 'raises an exception' do
62
+ expect do
63
+ MyMailer.with(:foo => 1, :bar => 2).signup('john@example.com').delay
64
+ end.to raise_error(RuntimeError)
65
+ end
66
+ end
67
+ end
68
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.8
4
+ version: 4.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2019-08-16 00:00:00.000000000 Z
18
+ date: 2020-12-09 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activesupport
@@ -26,7 +26,7 @@ dependencies:
26
26
  version: '3.0'
27
27
  - - "<"
28
28
  - !ruby/object:Gem::Version
29
- version: '6.1'
29
+ version: '6.2'
30
30
  type: :runtime
31
31
  prerelease: false
32
32
  version_requirements: !ruby/object:Gem::Requirement
@@ -36,7 +36,7 @@ dependencies:
36
36
  version: '3.0'
37
37
  - - "<"
38
38
  - !ruby/object:Gem::Version
39
- version: '6.1'
39
+ version: '6.2'
40
40
  description: Delayed_job (or DJ) encapsulates the common pattern of asynchronously
41
41
  executing longer tasks in the background. It is a direct extraction from Shopify
42
42
  where the job table is responsible for a multitude of core tasks.
@@ -102,7 +102,10 @@ files:
102
102
  homepage: http://github.com/collectiveidea/delayed_job
103
103
  licenses:
104
104
  - MIT
105
- metadata: {}
105
+ metadata:
106
+ changelog_uri: https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md
107
+ bug_tracker_uri: https://github.com/collectiveidea/delayed_job/issues
108
+ source_code_uri: https://github.com/collectiveidea/delayed_job
106
109
  post_install_message:
107
110
  rdoc_options: []
108
111
  require_paths: