business_pipeline 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 7273b0377aaea159de3b5e5671d713a0450787880b4855c8b6c5014de031feeb
4
- data.tar.gz: a29ab9c61dc0b39d4f4c47a3768f71b6da32746f950932bf003ce41c194446f9
3
+ metadata.gz: e306807f9ca2fb16a2061b7167d060efd5f9bd4a1fc931fda8a42ccb012f4069
4
+ data.tar.gz: 7ef8bd744d77b0f0a3449ceda3933e764cfab86b0b8f118e9c7c1ae2c516f68c
5
5
  SHA512:
6
- metadata.gz: 96aa3f173d2dc07252bee8f7344440492b7cc12083d2d34191d23dd648daeaa98cfdd36661551f96bc9cf60b68e5eddb5b4e149231ea885d11e744c5060ee4aa
7
- data.tar.gz: fdc6c7e502e2df46a7d8ae38061c030f24d354b45d6a27173f0e839f429c0fdcf0e5990a268dac2168cf528038f94da829256edb71ddc1df50977733e24d82c8
6
+ metadata.gz: 72087eedeaa7645d53e38ac69d621859765a5b2ec4324d8708362571d35abef9deaaf0dbc7dc1771b05c761637f1b88f18570c7f9831b20229d14469203bc79d
7
+ data.tar.gz: e7154135992eb87060034a57d435d4bfd3ad550a12f5f5e1318187778d2e8a4c8759c1183a7b4b1fa253498fd3dc1f915da2d1676bbd38a34cf2eea8d321b331
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2
4
+
5
+ * Fixing processes calling inside Hooks
6
+
3
7
  ## 0.1.1
4
8
 
5
9
  * Fixing the README to document `Process#perform` instead of `Process#call`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- business_pipeline (0.1.1)
4
+ business_pipeline (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -225,7 +225,7 @@ class IndexProcess
225
225
 
226
226
  puts "Context before call is: #{context.inspect}"
227
227
 
228
- process.perform
228
+ process.call
229
229
 
230
230
  puts "Context after call is: #{context.inspect}"
231
231
  end
@@ -240,6 +240,8 @@ class IndexProcess
240
240
  end
241
241
  ```
242
242
 
243
+ **Important:** don’t call `process.perform` inside a Hook, it would trigger the hooks and create an infinite loop.
244
+
243
245
  ### Hooks execution order
244
246
 
245
247
  Execution of _around_ hooks will always be the first one. Then the _before_ hooks and to finish the _after_ ones. So writing the following Process
@@ -250,7 +252,7 @@ class IndexProcess
250
252
 
251
253
  around do |process|
252
254
  puts 'AROUND 1 START'
253
- process.perform
255
+ process.call
254
256
  puts 'AROUND 1 END'
255
257
  end
256
258
 
@@ -259,7 +261,7 @@ class IndexProcess
259
261
 
260
262
  around do |process|
261
263
  puts 'AROUND 2 START'
262
- process.perform
264
+ process.call
263
265
  puts 'AROUND 2 END'
264
266
  end
265
267
 
@@ -290,7 +292,7 @@ If for instance you wanted to wrap every Process in a transaction (which would b
290
292
  ```ruby
291
293
  class TransactionWrapping
292
294
  def call(process, context, config)
293
- ActiveRecord::Base.transaction { process.perform }
295
+ ActiveRecord::Base.transaction { process.call }
294
296
  end
295
297
  end
296
298
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BusinessPipeline
4
- VERSION = -'0.1.1'
4
+ VERSION = -'0.1.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: business_pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Courtois