inst-jobs 0.11.7 → 0.11.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/delayed/message_sending.rb +9 -9
- data/lib/delayed/version.rb +1 -1
- data/spec/shared/delayed_method.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f024416c8aac90611b46a38491ebc35373bc2136
|
4
|
+
data.tar.gz: f729a0faea215acb32cc8e9d7fbd07b05f96ba9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00e97f21ed4245ee6452ce553b82e8c50e62d92e70a47515d5dfed0c2d7ec4d0a76a910b8c757eaa62d00e5cd6d79e55dfa570b748156ba9fdb50e5428055847
|
7
|
+
data.tar.gz: c09a528aeb3c0a055e0e54b6692e76e418636b170af3484467f5d451d84fcd8fa867c7a1da187b9dcab9b662984fe656444fb28d8a4ec21b3a329d75fadb927e
|
@@ -109,21 +109,21 @@ module Delayed
|
|
109
109
|
visibility = :protected
|
110
110
|
end
|
111
111
|
|
112
|
-
generated_delayed_methods.class_eval
|
113
|
-
|
114
|
-
send(
|
112
|
+
generated_delayed_methods.class_eval do
|
113
|
+
define_method without_method do |*args|
|
114
|
+
send(method, *args, synchronous: true)
|
115
115
|
end
|
116
|
-
|
116
|
+
send(visibility, without_method)
|
117
117
|
|
118
|
-
|
118
|
+
define_method(method, -> (*args, synchronous: !default_async) do
|
119
119
|
if synchronous
|
120
120
|
super(*args)
|
121
121
|
else
|
122
|
-
send_later_enqueue_args(
|
122
|
+
send_later_enqueue_args(method, enqueue_args, *args, synchronous: true)
|
123
123
|
end
|
124
|
-
end
|
125
|
-
|
126
|
-
|
124
|
+
end)
|
125
|
+
send(visibility, method)
|
126
|
+
end
|
127
127
|
end
|
128
128
|
|
129
129
|
def handle_asynchronously(method, enqueue_args={})
|
data/lib/delayed/version.rb
CHANGED
@@ -45,6 +45,17 @@ shared_examples_for 'random ruby objects' do
|
|
45
45
|
obj.ran.should be true
|
46
46
|
end
|
47
47
|
|
48
|
+
it 'must work with enqueue args that are lambdas' do
|
49
|
+
klass = Class.new do
|
50
|
+
attr_reader :ran
|
51
|
+
def test_method; @ran = true; end
|
52
|
+
add_send_later_methods :test_method, {singleton: -> (obj) { "foobar:#{obj.object_id}" }}, true
|
53
|
+
end
|
54
|
+
|
55
|
+
obj = klass.new
|
56
|
+
lambda { obj.test_method }.should change { Delayed::Job.jobs_count(:current) }.by(1)
|
57
|
+
end
|
58
|
+
|
48
59
|
it "should work without default_async" do
|
49
60
|
klass = Class.new do
|
50
61
|
attr_accessor :ran
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inst-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-01-
|
12
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: after_transaction_commit
|