delayed_job 3.0.5 → 4.0.0.beta1
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.
- data/CHANGELOG.md +4 -0
- data/README.md +4 -1
- data/contrib/delayed_job_multiple.monitrc +1 -1
- data/delayed_job.gemspec +2 -2
- data/lib/delayed/message_sending.rb +13 -2
- data/lib/delayed/psych_ext.rb +6 -5
- data/lib/delayed/recipes.rb +1 -1
- data/lib/delayed_job.rb +1 -2
- data/spec/{spec_helper.rb → helper.rb} +10 -6
- data/spec/lifecycle_spec.rb +1 -1
- data/spec/message_sending_spec.rb +1 -1
- data/spec/performable_mailer_spec.rb +2 -2
- data/spec/performable_method_spec.rb +1 -1
- data/spec/test_backend_spec.rb +1 -1
- data/spec/worker_spec.rb +1 -1
- data/spec/yaml_ext_spec.rb +1 -1
- metadata +22 -19
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,11 +3,14 @@ Delayed::Job
|
|
3
3
|
[][gem]
|
4
4
|
[][travis]
|
5
5
|
[][gemnasium]
|
6
|
-
[][codeclimate]
|
7
|
+
[][coveralls]
|
8
|
+
|
7
9
|
[gem]: https://rubygems.org/gems/delayed_job
|
8
10
|
[travis]: http://travis-ci.org/collectiveidea/delayed_job
|
9
11
|
[gemnasium]: https://gemnasium.com/collectiveidea/delayed_job
|
10
12
|
[codeclimate]: https://codeclimate.com/github/collectiveidea/delayed_job
|
13
|
+
[coveralls]: https://coveralls.io/r/collectiveidea/delayed_job
|
11
14
|
|
12
15
|
Delayed::Job (or DJ) encapsulates the common pattern of asynchronously executing
|
13
16
|
longer tasks in the background.
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# 1. copy to /var/www/apps/{app_name}/shared/delayed_job.monitrc
|
5
5
|
# 2. replace {app_name} as appropriate
|
6
6
|
# you might also need to change the program strings to
|
7
|
-
# "/bin/su - {username} -c '/usr/bin/env ...'"
|
7
|
+
# "/bin/su - {username} -c '/usr/bin/env ...'"
|
8
8
|
# to load your shell environment.
|
9
9
|
#
|
10
10
|
# 3. add this to your /etc/monit/monitrc
|
data/delayed_job.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
|
-
spec.add_dependency 'activesupport', '
|
4
|
+
spec.add_dependency 'activesupport', ['>= 3.0', '< 4.1']
|
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,5 @@ 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 = '
|
16
|
+
spec.version = '4.0.0.beta1'
|
17
17
|
end
|
@@ -1,8 +1,19 @@
|
|
1
|
-
|
1
|
+
if ActiveSupport::VERSION::MAJOR == 4
|
2
|
+
require 'active_support/proxy_object'
|
3
|
+
else
|
4
|
+
require 'active_support/basic_object'
|
5
|
+
end
|
6
|
+
|
2
7
|
require 'active_support/core_ext/module/aliasing'
|
3
8
|
|
4
9
|
module Delayed
|
5
|
-
|
10
|
+
if ActiveSupport::VERSION::MAJOR == 4
|
11
|
+
klass = ActiveSupport::ProxyObject
|
12
|
+
else
|
13
|
+
klass = ActiveSupport::BasicObject
|
14
|
+
end
|
15
|
+
|
16
|
+
class DelayProxy < klass
|
6
17
|
def initialize(payload_class, target, options)
|
7
18
|
@payload_class = payload_class
|
8
19
|
@target = target
|
data/lib/delayed/psych_ext.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
if defined?(ActiveRecord)
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
coder
|
6
|
-
coder.tag = ['!ruby/ActiveRecord', self.class.name].join(':')
|
2
|
+
ActiveRecord::Base.class_eval do
|
3
|
+
def encode_with_override(coder)
|
4
|
+
encode_with_without_override(coder)
|
5
|
+
coder.tag = "!ruby/ActiveRecord:#{self.class.name}"
|
7
6
|
end
|
7
|
+
alias_method :encode_with_without_override, :encode_with
|
8
|
+
alias_method :encode_with, :encode_with_override
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
data/lib/delayed/recipes.rb
CHANGED
data/lib/delayed_job.rb
CHANGED
@@ -3,10 +3,9 @@ require 'delayed/exceptions'
|
|
3
3
|
require 'delayed/message_sending'
|
4
4
|
require 'delayed/performable_method'
|
5
5
|
|
6
|
-
# PerformableMailer is compatible with ActionMailer 3 (and possibly 3.1)
|
7
6
|
if defined?(ActionMailer)
|
8
7
|
require 'action_mailer/version'
|
9
|
-
require 'delayed/performable_mailer'
|
8
|
+
require 'delayed/performable_mailer'
|
10
9
|
end
|
11
10
|
|
12
11
|
require 'delayed/yaml_ext'
|
@@ -1,10 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
require 'simplecov'
|
2
|
+
require 'coveralls'
|
3
|
+
|
4
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
5
|
+
SimpleCov::Formatter::HTMLFormatter,
|
6
|
+
Coveralls::SimpleCov::Formatter
|
7
|
+
]
|
8
|
+
SimpleCov.start
|
5
9
|
|
6
|
-
require 'bundler/setup'
|
7
10
|
require 'logger'
|
11
|
+
require 'rspec'
|
8
12
|
|
9
13
|
require 'action_mailer'
|
10
14
|
require 'active_support/dependencies'
|
@@ -41,7 +45,7 @@ class Story < ActiveRecord::Base
|
|
41
45
|
self.primary_key = 'story_id'
|
42
46
|
def tell; text; end
|
43
47
|
def whatever(n, _); tell*n; end
|
44
|
-
default_scope where(:scoped => true)
|
48
|
+
default_scope { where(:scoped => true) }
|
45
49
|
|
46
50
|
handle_asynchronously :whatever
|
47
51
|
end
|
data/spec/lifecycle_spec.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require '
|
1
|
+
require 'helper'
|
2
2
|
|
3
3
|
require 'action_mailer'
|
4
4
|
class MyMailer < ActionMailer::Base
|
5
5
|
def signup(email)
|
6
|
-
mail :to => email, :subject => "Delaying Emails", :from => "delayedjob@example.com"
|
6
|
+
mail :to => email, :subject => "Delaying Emails", :from => "delayedjob@example.com",:body => 'Delaying Emails Body'
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
data/spec/test_backend_spec.rb
CHANGED
data/spec/worker_spec.rb
CHANGED
data/spec/yaml_ext_spec.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delayed_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
version: 4.0.0.beta1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brandon Keepers
|
@@ -16,24 +16,30 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2013-
|
19
|
+
date: 2013-03-02 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
23
|
-
|
22
|
+
name: activesupport
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ! '>='
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '3.0'
|
29
|
-
|
29
|
+
- - <
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: '4.1'
|
32
|
+
type: :runtime
|
30
33
|
prerelease: false
|
31
|
-
|
34
|
+
version_requirements: !ruby/object:Gem::Requirement
|
32
35
|
none: false
|
33
36
|
requirements:
|
34
|
-
- -
|
37
|
+
- - ! '>='
|
35
38
|
- !ruby/object:Gem::Version
|
36
39
|
version: '3.0'
|
40
|
+
- - <
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '4.1'
|
37
43
|
description: Delayed_job (or DJ) encapsulates the common pattern of asynchronously
|
38
44
|
executing longer tasks in the background. It is a direct extraction from Shopify
|
39
45
|
where the job table is responsible for a multitude of core tasks.
|
@@ -80,12 +86,12 @@ files:
|
|
80
86
|
- spec/autoloaded/struct.rb
|
81
87
|
- spec/delayed/backend/test.rb
|
82
88
|
- spec/delayed/serialization/test.rb
|
89
|
+
- spec/helper.rb
|
83
90
|
- spec/lifecycle_spec.rb
|
84
91
|
- spec/message_sending_spec.rb
|
85
92
|
- spec/performable_mailer_spec.rb
|
86
93
|
- spec/performable_method_spec.rb
|
87
94
|
- spec/sample_jobs.rb
|
88
|
-
- spec/spec_helper.rb
|
89
95
|
- spec/test_backend_spec.rb
|
90
96
|
- spec/worker_spec.rb
|
91
97
|
- spec/yaml_ext_spec.rb
|
@@ -101,22 +107,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
107
|
requirements:
|
102
108
|
- - ! '>='
|
103
109
|
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
104
111
|
segments:
|
105
112
|
- 0
|
106
|
-
hash: -
|
107
|
-
version: '0'
|
113
|
+
hash: -646849104774513769
|
108
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
115
|
none: false
|
110
116
|
requirements:
|
111
|
-
- - ! '
|
117
|
+
- - ! '>'
|
112
118
|
- !ruby/object:Gem::Version
|
113
|
-
|
114
|
-
- 0
|
115
|
-
hash: -2181840438794321912
|
116
|
-
version: '0'
|
119
|
+
version: 1.3.1
|
117
120
|
requirements: []
|
118
121
|
rubyforge_project:
|
119
|
-
rubygems_version: 1.8.
|
122
|
+
rubygems_version: 1.8.25
|
120
123
|
signing_key:
|
121
124
|
specification_version: 3
|
122
125
|
summary: Database-backed asynchronous priority queue system -- Extracted from Shopify
|
@@ -127,12 +130,12 @@ test_files:
|
|
127
130
|
- spec/autoloaded/struct.rb
|
128
131
|
- spec/delayed/backend/test.rb
|
129
132
|
- spec/delayed/serialization/test.rb
|
133
|
+
- spec/helper.rb
|
130
134
|
- spec/lifecycle_spec.rb
|
131
135
|
- spec/message_sending_spec.rb
|
132
136
|
- spec/performable_mailer_spec.rb
|
133
137
|
- spec/performable_method_spec.rb
|
134
138
|
- spec/sample_jobs.rb
|
135
|
-
- spec/spec_helper.rb
|
136
139
|
- spec/test_backend_spec.rb
|
137
140
|
- spec/worker_spec.rb
|
138
141
|
- spec/yaml_ext_spec.rb
|