active_interaction-extras 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73c4e77c2e101656185ad654364e8a4a609fb440
4
- data.tar.gz: 7d2a25ed77a026f5257a6370f1c52998d716496a
3
+ metadata.gz: b830f72fb06c46cac4007920afe65a33c92d2548
4
+ data.tar.gz: b954fa1ea9e8280a485b52da36c3f8379b2cb67e
5
5
  SHA512:
6
- metadata.gz: be0a3a10fcafe850259f2955997ee900e5433967242f85ff64ff54f2b4346773f24e4d3306f72113351b6702a51d13bde1c1aac922db2d6a7ef73d4cd4b4d594
7
- data.tar.gz: f2994d0a85ee3b11c736bcb9384949388f7a1636924da5e7fa4672c124b4df818553a2b666a062a588ebff11bee08f90d949edd1b35ec1ebc90c21103e511059
6
+ metadata.gz: 63ee6666b6b0b757f5724a3613ae38883bbb995941a32faf8627b1342b6c0114219a3efb09d1a5936d1db6d003708786b22126645aecd87c7ab633019f10195e
7
+ data.tar.gz: '0413834b86cd0f6fbcf135dd0bc3d9afb4b5d086973005008ad7b6db43f51680e70e897d8e71e90776573c53be3ea4153847fead72d9abefda823b03f34cdb3b'
data/README.md CHANGED
@@ -16,7 +16,6 @@ gem 'active_interaction-extras'
16
16
  class ApplicationInteraction < ActiveInteraction::Base
17
17
  include ActiveInteraction::Extras::All
18
18
  # same as
19
- # include ActiveInteraction::Extras::ActiveJob
20
19
  # include ActiveInteraction::Extras::Halt
21
20
  # include ActiveInteraction::Extras::ModelFields
22
21
  # include ActiveInteraction::Extras::RunCallback
@@ -25,28 +24,6 @@ class ApplicationInteraction < ActiveInteraction::Base
25
24
  end
26
25
  ```
27
26
 
28
- ### ActiveJob
29
-
30
- ```ruby
31
- class ApplicationInteraction < ActiveInteraction::Base
32
- include ActiveInteraction::Extras::ActiveJob
33
-
34
- class Job < ActiveJob::Base
35
- include ActiveInteraction::Extras::ActiveJob::Perform
36
- end
37
- end
38
-
39
- class DoubleService < ApplicationInteraction
40
- integer :x
41
-
42
- def execute
43
- x + x
44
- end
45
- end
46
-
47
- DoubleService.delay.run(x: 2) # queues to run in background
48
- ```
49
-
50
27
  ### Halt
51
28
 
52
29
  ```ruby
@@ -164,6 +141,55 @@ UpdateUserForm.run
164
141
  Comment.count # => 0
165
142
  ```
166
143
 
144
+ ### ActiveJob
145
+
146
+ ```ruby
147
+ class ApplicationInteraction < ActiveInteraction::Base
148
+ include ActiveInteraction::Extras::ActiveJob
149
+
150
+ class Job < ActiveJob::Base
151
+ include ActiveInteraction::Extras::ActiveJob::Perform
152
+ end
153
+ end
154
+
155
+ class DoubleService < ApplicationInteraction
156
+ integer :x
157
+
158
+ def execute
159
+ x + x
160
+ end
161
+ end
162
+
163
+ DoubleService.delay.run(x: 2) # queues to run in background
164
+ ```
165
+
166
+ ### Sidekiq
167
+
168
+ ```ruby
169
+ class ApplicationInteraction < ActiveInteraction::Base
170
+ include ActiveInteraction::Extras::Sidekiq
171
+
172
+ class Job
173
+ include Sidekiq::Worker
174
+ include ActiveInteraction::Extras::Sidekiq::Perform
175
+ end
176
+ end
177
+
178
+ class DoubleService < ApplicationInteraction
179
+ job do
180
+ sidekiq_options retry: 1
181
+ end
182
+
183
+ integer :x
184
+
185
+ def execute
186
+ x + x
187
+ end
188
+ end
189
+
190
+ DoubleService.delay.run(x: 2) # queues to run in background
191
+ ```
192
+
167
193
  ### Rspec
168
194
 
169
195
  ```ruby
@@ -1,3 +1,5 @@
1
+ require 'active_interaction/active_job'
2
+
1
3
  module ActiveInteraction::Extras::ActiveJob
2
4
  extend ActiveSupport::Concern
3
5
 
@@ -1,7 +1,6 @@
1
1
  module ActiveInteraction::Extras::All
2
2
  extend ActiveSupport::Concern
3
3
 
4
- include ActiveInteraction::Extras::ActiveJob
5
4
  include ActiveInteraction::Extras::Halt
6
5
  include ActiveInteraction::Extras::ModelFields
7
6
  include ActiveInteraction::Extras::RunCallback
@@ -0,0 +1,13 @@
1
+ require 'active_interaction/active_job'
2
+
3
+ module ActiveInteraction::Extras::Sidekiq
4
+ extend ActiveSupport::Concern
5
+
6
+ include ActiveInteraction::ActiveJob::Sidekiq::Core
7
+
8
+ module Perform
9
+ extend ActiveSupport::Concern
10
+
11
+ include ActiveInteraction::ActiveJob::Sidekiq::JobHelper
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  module ActiveInteraction
2
2
  module Extras
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_interaction-extras
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
@@ -132,6 +132,7 @@ files:
132
132
  - lib/active_interaction/extras/model_fields.rb
133
133
  - lib/active_interaction/extras/rspec.rb
134
134
  - lib/active_interaction/extras/run_callback.rb
135
+ - lib/active_interaction/extras/sidekiq.rb
135
136
  - lib/active_interaction/extras/strong_params.rb
136
137
  - lib/active_interaction/extras/transaction.rb
137
138
  - lib/active_interaction/extras/version.rb