business_pipeline 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +8 -8
- data/lib/business_pipeline/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7273b0377aaea159de3b5e5671d713a0450787880b4855c8b6c5014de031feeb
|
4
|
+
data.tar.gz: a29ab9c61dc0b39d4f4c47a3768f71b6da32746f950932bf003ce41c194446f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96aa3f173d2dc07252bee8f7344440492b7cc12083d2d34191d23dd648daeaa98cfdd36661551f96bc9cf60b68e5eddb5b4e149231ea885d11e744c5060ee4aa
|
7
|
+
data.tar.gz: fdc6c7e502e2df46a7d8ae38061c030f24d354b45d6a27173f0e839f429c0fdcf0e5990a268dac2168cf528038f94da829256edb71ddc1df50977733e24d82c8
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -128,7 +128,7 @@ In our `SortUsers` and `PaginateUsers` Steps we used values from our _context_ t
|
|
128
128
|
When calling a Process, you can provide an initial _context_ by passing a Hash as argument:
|
129
129
|
|
130
130
|
```ruby
|
131
|
-
UsersIndex.new.
|
131
|
+
UsersIndex.new.perform(page: 1, sort: { created_at: :desc })
|
132
132
|
```
|
133
133
|
|
134
134
|
You can then use this initial _context_ in all your Steps.
|
@@ -136,7 +136,7 @@ You can then use this initial _context_ in all your Steps.
|
|
136
136
|
A Process returns the modified _context_ at the end of its execution. You can interrogate this _context_ to know if everything went according to plan:
|
137
137
|
|
138
138
|
```ruby
|
139
|
-
result = UsersIndex.new.
|
139
|
+
result = UsersIndex.new.perform(page: 1, sort: { created_at: :desc })
|
140
140
|
|
141
141
|
result.success? # => true
|
142
142
|
result.failure? # => false
|
@@ -153,7 +153,7 @@ Before we get started we need to first take a look at a Process' initialization.
|
|
153
153
|
|
154
154
|
```ruby
|
155
155
|
process = IndexProcess.new(collection_name: 'users', model_class: User)
|
156
|
-
process.
|
156
|
+
process.perform(page: 1, sort: { created_at: :desc })
|
157
157
|
```
|
158
158
|
|
159
159
|
### Generic Steps
|
@@ -225,7 +225,7 @@ class IndexProcess
|
|
225
225
|
|
226
226
|
puts "Context before call is: #{context.inspect}"
|
227
227
|
|
228
|
-
process.
|
228
|
+
process.perform
|
229
229
|
|
230
230
|
puts "Context after call is: #{context.inspect}"
|
231
231
|
end
|
@@ -250,7 +250,7 @@ class IndexProcess
|
|
250
250
|
|
251
251
|
around do |process|
|
252
252
|
puts 'AROUND 1 START'
|
253
|
-
process.
|
253
|
+
process.perform
|
254
254
|
puts 'AROUND 1 END'
|
255
255
|
end
|
256
256
|
|
@@ -259,7 +259,7 @@ class IndexProcess
|
|
259
259
|
|
260
260
|
around do |process|
|
261
261
|
puts 'AROUND 2 START'
|
262
|
-
process.
|
262
|
+
process.perform
|
263
263
|
puts 'AROUND 2 END'
|
264
264
|
end
|
265
265
|
|
@@ -290,7 +290,7 @@ If for instance you wanted to wrap every Process in a transaction (which would b
|
|
290
290
|
```ruby
|
291
291
|
class TransactionWrapping
|
292
292
|
def call(process, context, config)
|
293
|
-
ActiveRecord::Base.transaction { process.
|
293
|
+
ActiveRecord::Base.transaction { process.perform }
|
294
294
|
end
|
295
295
|
end
|
296
296
|
|
@@ -394,7 +394,7 @@ end
|
|
394
394
|
Calling `context.fail!` will stop the execution and merge the information you give it to the _context_.
|
395
395
|
|
396
396
|
```ruby
|
397
|
-
result = CheckingProcess.new.
|
397
|
+
result = CheckingProcess.new.perform(continue: 'no')
|
398
398
|
|
399
399
|
result.success? # => false
|
400
400
|
result.failure? # => true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: business_pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Courtois
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- ".gitignore"
|
105
105
|
- ".rspec"
|
106
106
|
- ".rubocop.yml"
|
107
|
+
- CHANGELOG.md
|
107
108
|
- CODE_OF_CONDUCT.md
|
108
109
|
- Gemfile
|
109
110
|
- Gemfile.lock
|