rudash 2.14.0 → 2.15.0

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: a0efde163ec32f1ae10522e24a34dc1d316a6b106db818e18760c86a4b95b53f
4
- data.tar.gz: ff3255666168a904db28841d7f82ccc319dadc0c65054009e6b056c13b9a3927
3
+ metadata.gz: 643280f2bdd3f723c1f7c8c01d33d9bb4ee7ef04401cf16aa5c01fe9cc03a2fe
4
+ data.tar.gz: b3b5e0a3270aa5d8afbe46425bda59890bf734d45cdf4676861d3b4c28c883a7
5
5
  SHA512:
6
- metadata.gz: 99de8b06532e11d4f96c5a9ce64b96a9cd4a7dff105d8e61fed16472e8e49980cd7c59eef8b18d90522f2d8ef2a073752c069bdb2b2ce357d1f5fe989ae435f1
7
- data.tar.gz: 6b9bbd93a29b3e4af5d423ec5a06b6d1052e52dd169b2ad65ab8d99a748ad2d357f295a60cb8fdaabc79e3273c8efc507441fbb72ee4ad7494335a1b0363503c
6
+ metadata.gz: f89b8e79721bdafffde41f8676bf4332001232586fa9b1144c00370027d4fd335633c8e4dabb6a0b16dcb3df54de7e35c6d0e7cdb787510699d32ab06c5882a6
7
+ data.tar.gz: ed76efd17f99e18b7cc1cb91d5f6b7bbb13fed8deb482905ccaf93eaaaba3c67be169744f9899f1140e23d65152a77d6a1257fce07d7ff9016bb5cf8ea80e5f6
@@ -0,0 +1,15 @@
1
+ require_relative '../utils/index.rb'
2
+
3
+ module Rudash
4
+ module Flow
5
+ def flow(*funs)
6
+ flatten_funs = funs.flatten
7
+
8
+ flow_proc = -> (*args) {
9
+ self.reduce(flatten_funs, -> (acc, fn) {
10
+ Rudash::DynamicArgsCount.call(fn, *self.concat(acc))
11
+ }, args)
12
+ }
13
+ end
14
+ end
15
+ end
data/lib/rudash.rb CHANGED
@@ -49,6 +49,7 @@ require_relative './rudash/group_by.rb'
49
49
  require_relative './rudash/take.rb'
50
50
  require_relative './rudash/drop_right.rb'
51
51
  require_relative './rudash/chain.rb'
52
+ require_relative './rudash/flow.rb'
52
53
 
53
54
  require_relative './utils/chain_wrapper.rb'
54
55
 
@@ -107,4 +108,5 @@ class R_
107
108
  extend Rudash::Take
108
109
  extend Rudash::DropRight
109
110
  extend Rudash::Chain
111
+ extend Rudash::Flow
110
112
  end
data/lib/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module Rudash
2
+ VERSION = '2.15.0'
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rudash
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.0
4
+ version: 2.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Islam Attrash
@@ -33,6 +33,7 @@ files:
33
33
  - lib/rudash/find.rb
34
34
  - lib/rudash/find_last.rb
35
35
  - lib/rudash/flip.rb
36
+ - lib/rudash/flow.rb
36
37
  - lib/rudash/get.rb
37
38
  - lib/rudash/group_by.rb
38
39
  - lib/rudash/head.rb
@@ -74,6 +75,7 @@ files:
74
75
  - lib/utils/nested_path_creator.rb
75
76
  - lib/utils/path_resolver.rb
76
77
  - lib/utils/subset_deep_match.rb
78
+ - lib/version.rb
77
79
  homepage: https://github.com/Attrash-Islam/rudash
78
80
  licenses:
79
81
  - MIT