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 +4 -4
- data/lib/rudash/flow.rb +15 -0
- data/lib/rudash.rb +2 -0
- data/lib/version.rb +3 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 643280f2bdd3f723c1f7c8c01d33d9bb4ee7ef04401cf16aa5c01fe9cc03a2fe
|
4
|
+
data.tar.gz: b3b5e0a3270aa5d8afbe46425bda59890bf734d45cdf4676861d3b4c28c883a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f89b8e79721bdafffde41f8676bf4332001232586fa9b1144c00370027d4fd335633c8e4dabb6a0b16dcb3df54de7e35c6d0e7cdb787510699d32ab06c5882a6
|
7
|
+
data.tar.gz: ed76efd17f99e18b7cc1cb91d5f6b7bbb13fed8deb482905ccaf93eaaaba3c67be169744f9899f1140e23d65152a77d6a1257fce07d7ff9016bb5cf8ea80e5f6
|
data/lib/rudash/flow.rb
ADDED
@@ -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
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.
|
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
|