bsflow 2.4.0 → 2.5.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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +19 -4
- data/lib/bsflow/combine.rb +2 -2
- data/lib/bsflow/pipeline.rb +2 -2
- data/lib/bsflow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f346f3299babeef06c81665529633d10f7a13700adc683d8e123f1d72bbd5bb2
|
4
|
+
data.tar.gz: 3f37d78b4690a7094bcac06c90db5ca5cfdad4ef92f18c96d10a2f7e2cf1a78c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c58e17dc27c030fd69ea7aef3fad7a3fac5ee54fa5ec2faf85d5613feb71c2b3ac10257b78b6c7421f6e92ae1d07a162f9e04dae402be128c457a704177ed04
|
7
|
+
data.tar.gz: 5561afb015a07a91a3b2d6add02a2f6e8435b91ba2d0cab042a74b30d64b43e9f83dca8eea536800b08ffe732aeb52d626a5bfc351ae8bdff35643ed383f2ddf
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -53,8 +53,8 @@ Source code:
|
|
53
53
|
```ruby
|
54
54
|
module BSFlow
|
55
55
|
class Pipeline
|
56
|
-
def initialize(procs:)
|
57
|
-
@procs = procs
|
56
|
+
def initialize(*args, procs: [])
|
57
|
+
@procs = args + procs
|
58
58
|
end
|
59
59
|
|
60
60
|
def call(*args)
|
@@ -69,6 +69,7 @@ module BSFlow
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
72
|
+
end
|
72
73
|
```
|
73
74
|
|
74
75
|
#### Require
|
@@ -81,11 +82,18 @@ require "bsflow/pipeline"
|
|
81
82
|
|
82
83
|
```ruby
|
83
84
|
BSFlow:Pipeline.new(procs: procs) # => new_pipeline
|
85
|
+
|
86
|
+
# or
|
87
|
+
BSFlow:Pipeline.new(*procs) # => new_pipeline
|
88
|
+
|
89
|
+
# or
|
90
|
+
BSFlow:Pipeline.new(*first_part_of_procs, procs: rest_of_procs) # => new_pipeline
|
84
91
|
```
|
85
92
|
|
86
93
|
Paramaters:
|
87
94
|
|
88
95
|
- **_procs_** - an array of procs or objects responding on `.call` message. The first **_proc_** takes the "main" input of the class (any number of arguments). The result is passed to the next **_proc_** as input. The output of the last **_proc_** is the output of `.call` method of **Pipeline** class.
|
96
|
+
The procs can be passed as a normal arguments or as a list arguments
|
89
97
|
|
90
98
|
|
91
99
|
### Class BSFlow::StdoutAdapter
|
@@ -424,8 +432,8 @@ Source code:
|
|
424
432
|
```ruby
|
425
433
|
module BSFlow
|
426
434
|
class Combine
|
427
|
-
def initialize(combine_proc:, sub_procs:)
|
428
|
-
@sub_procs = sub_procs
|
435
|
+
def initialize(*args, combine_proc:, sub_procs: [])
|
436
|
+
@sub_procs = args + sub_procs
|
429
437
|
@combine_proc = combine_proc
|
430
438
|
end
|
431
439
|
|
@@ -438,6 +446,7 @@ module BSFlow
|
|
438
446
|
end
|
439
447
|
end
|
440
448
|
end
|
449
|
+
|
441
450
|
```
|
442
451
|
|
443
452
|
#### Require
|
@@ -450,6 +459,12 @@ require "bsflow/combine"
|
|
450
459
|
|
451
460
|
```ruby
|
452
461
|
BSFlow::Combine.new(sub_procs: sub_procs, combine_proc: combine_proc) # => new_combine
|
462
|
+
|
463
|
+
# or
|
464
|
+
BSFlow::Combine.new(*sub_procs, combine_proc: combine_proc) # => new_combine
|
465
|
+
|
466
|
+
# or
|
467
|
+
BSFlow::Combine.new(*first_part_of_sub_procs, sub_procs: rest_of_sub_procs, combine_proc: combine_proc) # => new_combine
|
453
468
|
```
|
454
469
|
|
455
470
|
Paramaters:
|
data/lib/bsflow/combine.rb
CHANGED
data/lib/bsflow/pipeline.rb
CHANGED
data/lib/bsflow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bsflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bartłomiej Sielski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|