active_interaction-active_job 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/active_interaction/active_job.rb +0 -1
- data/lib/active_interaction/active_job/core.rb +4 -4
- data/lib/active_interaction/active_job/job_helper.rb +2 -2
- data/lib/active_interaction/active_job/version.rb +1 -1
- metadata +2 -3
- data/lib/active_interaction/active_job/configured_job.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a235e3b7e6639de507aa023bd116ec709355ac2
|
4
|
+
data.tar.gz: 8c54bd46498da02f66be4145714d156752b00f51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2a3116ebca8197c58ff46c3518bc510d88dca8e2f81e3e8bc74b8ec81e29ea4d37b25650b68151f8ad477239fdcb9f00a5806783765d1a775a9f5606ac49832
|
7
|
+
data.tar.gz: 117db2c07ce6a284f6adb3d38112b3dd0df2d854d0536abf10dbb7354ad9c41df339cccf6807b8a352d342101a3e16b5e173978e72b035937f299edf151ef6a4
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# ActiveInteraction::ActiveJob
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/active_interaction-active_job.svg)](https://badge.fury.io/rb/active_interaction-active_job)
|
4
|
+
|
3
5
|
This gem adds [active_job](http://edgeguides.rubyonrails.org/active_job_basics.html) support to [active_interaction](https://github.com/orgsync/active_interaction) gem.
|
4
6
|
|
5
7
|
With this gem you no longer need to create a separate Job class for the each interaction, this gem does it automatically for you.
|
@@ -6,9 +6,9 @@ module ActiveInteraction::ActiveJob::Core
|
|
6
6
|
end
|
7
7
|
|
8
8
|
module ClassMethods
|
9
|
-
def define_job_class
|
9
|
+
def define_job_class klass = default_job_class
|
10
10
|
unless const_defined?(:Job, false)
|
11
|
-
const_set(:Job, Class.new(
|
11
|
+
const_set(:Job, Class.new(klass))
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -26,11 +26,11 @@ module ActiveInteraction::ActiveJob::Core
|
|
26
26
|
|
27
27
|
def inherited subclass
|
28
28
|
super
|
29
|
-
subclass.
|
29
|
+
subclass.define_job_class job_class
|
30
30
|
end
|
31
31
|
|
32
32
|
def set options = {}
|
33
|
-
|
33
|
+
::ActiveJob::ConfiguredJob.new(job_class, options)
|
34
34
|
end
|
35
35
|
|
36
36
|
alias_method :delay, :set
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_interaction-active_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Katunin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -97,7 +97,6 @@ files:
|
|
97
97
|
- bin/console
|
98
98
|
- bin/setup
|
99
99
|
- lib/active_interaction/active_job.rb
|
100
|
-
- lib/active_interaction/active_job/configured_job.rb
|
101
100
|
- lib/active_interaction/active_job/core.rb
|
102
101
|
- lib/active_interaction/active_job/default_job.rb
|
103
102
|
- lib/active_interaction/active_job/job_helper.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class ActiveInteraction::ActiveJob::ConfiguredJob
|
2
|
-
def initialize job_class, service_class, options={}
|
3
|
-
@options = options
|
4
|
-
@service_class = service_class
|
5
|
-
@job_class = job_class
|
6
|
-
end
|
7
|
-
|
8
|
-
def run *args
|
9
|
-
@job_class.new(@service_class.name, *args).enqueue @options
|
10
|
-
end
|
11
|
-
|
12
|
-
alias_method :run!, :run
|
13
|
-
end
|