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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe2809ea660acc40e779db1641232e9b4ecc1872641821e874c65a4de3912b8f
4
- data.tar.gz: 47cf8932707f68d673d9f9e7e23aa4b964e4c948de0334a5a55fc850542caeba
3
+ metadata.gz: f346f3299babeef06c81665529633d10f7a13700adc683d8e123f1d72bbd5bb2
4
+ data.tar.gz: 3f37d78b4690a7094bcac06c90db5ca5cfdad4ef92f18c96d10a2f7e2cf1a78c
5
5
  SHA512:
6
- metadata.gz: 67ae1fd6e8898bdee8fc669796f43f2fa7b93ae2f593e124ff9273d44f2d470a498a122d47bec67eafea863216ebd98c8a9eaf4266c78956370ddfdaad16c9cd
7
- data.tar.gz: e3f2421c36acc78ccd81230f97d68a6eca84cdc748ccde4394dd103888516b6859bf2a997ab90a10ee1aa8d49d717857a7afb37d2c70be26d4d462beffb7b4ef
6
+ metadata.gz: 6c58e17dc27c030fd69ea7aef3fad7a3fac5ee54fa5ec2faf85d5613feb71c2b3ac10257b78b6c7421f6e92ae1d07a162f9e04dae402be128c457a704177ed04
7
+ data.tar.gz: 5561afb015a07a91a3b2d6add02a2f6e8435b91ba2d0cab042a74b30d64b43e9f83dca8eea536800b08ffe732aeb52d626a5bfc351ae8bdff35643ed383f2ddf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bsflow (2.3.0)
4
+ bsflow (2.4.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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:
@@ -1,7 +1,7 @@
1
1
  module BSFlow
2
2
  class Combine
3
- def initialize(combine_proc:, sub_procs:)
4
- @sub_procs = sub_procs
3
+ def initialize(*args, combine_proc:, sub_procs: [])
4
+ @sub_procs = args + sub_procs
5
5
  @combine_proc = combine_proc
6
6
  end
7
7
 
@@ -1,7 +1,7 @@
1
1
  module BSFlow
2
2
  class Pipeline
3
- def initialize(procs:)
4
- @procs = procs
3
+ def initialize(*args, procs: [])
4
+ @procs = args + procs
5
5
  end
6
6
 
7
7
  def call(*args)
@@ -1,3 +1,3 @@
1
1
  module BSFlow
2
- VERSION = "2.4.0"
2
+ VERSION = "2.5.0"
3
3
  end
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.0
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-03 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler