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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3fdaf56bdba70f7b40df2b577add8be2f91cc3d3
4
- data.tar.gz: be1fd8057bdcf537341cf6e21cd15960005ebb7a
3
+ metadata.gz: 6a235e3b7e6639de507aa023bd116ec709355ac2
4
+ data.tar.gz: 8c54bd46498da02f66be4145714d156752b00f51
5
5
  SHA512:
6
- metadata.gz: e86251a810ba452ed36ee67fde2ee8891625e9c3e79109f9f5eed0ad02c6c9937ebc0ed24952429df362458b5170c070081cff8256eba37c5350ba5b3adf538a
7
- data.tar.gz: 7cb0e3ed64582a667de99b58a4ab63be54cce5447828c9d0cf03361fabe421fa37d729669e49b17386c2aac86617dfbe32869f894b4858b56953ed85dd197b44
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.
@@ -10,7 +10,6 @@ module ActiveInteraction
10
10
  extend ActiveSupport::Autoload
11
11
 
12
12
  autoload :Core
13
- autoload :ConfiguredJob
14
13
  autoload :DefaultJob
15
14
  autoload :JobHelper
16
15
  end
@@ -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(default_job_class))
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.const_set(:Job, Class.new(job_class))
29
+ subclass.define_job_class job_class
30
30
  end
31
31
 
32
32
  def set options = {}
33
- ActiveInteraction::ActiveJob::ConfiguredJob.new(job_class, self, options)
33
+ ::ActiveJob::ConfiguredJob.new(job_class, options)
34
34
  end
35
35
 
36
36
  alias_method :delay, :set
@@ -1,5 +1,5 @@
1
1
  module ActiveInteraction::ActiveJob::JobHelper
2
- def perform interaction_klass_name, *args
3
- interaction_klass_name.constantize.run!(*args)
2
+ def perform *args
3
+ self.class.parent.run!(*args)
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveInteraction
2
2
  module ActiveJob
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
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.1.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: 2016-12-30 00:00:00.000000000 Z
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