rudash 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rudash/curry.rb +2 -2
- data/lib/rudash/flip.rb +3 -3
- data/lib/rudash/negate.rb +3 -3
- data/lib/utils/dynamic_args_count.rb +1 -1
- data/lib/utils/subset_deep_match.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dc2c29db4b71e43141cac51c0323b524bd47b6a85a692654e58334bcef5da16
|
4
|
+
data.tar.gz: 94f2615e152498e46b91abe25619b41b6aa4922a69ad1393fa641aa83fb388ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16911c7d2cee5a440e226759c3667e4385115d6ff177f9e8a39585510568193ba6f4f4b1634c372e44dfc39d5925d8919af1d3c413c7f9656b9b551a674b566f
|
7
|
+
data.tar.gz: 3ac60f1e2e8c21900fb786b37440fdc5f3bbc2fc66109b930a763ba9b022b1f4bcedc7186a2fb9a8d9225a19e02e947fe132735262df59cb7f157c03df63794b
|
data/lib/rudash/curry.rb
CHANGED
data/lib/rudash/flip.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
module Rudash
|
2
2
|
module Flip
|
3
|
-
def flip(
|
4
|
-
raise 'Expected a
|
3
|
+
def flip(a_lambda)
|
4
|
+
raise 'Expected a lambda/Method' unless Rudash::Utils.function?(a_lambda)
|
5
5
|
|
6
6
|
->(*args) {
|
7
7
|
reveresed_args = args.reverse
|
8
8
|
|
9
|
-
|
9
|
+
a_lambda.call(*reveresed_args)
|
10
10
|
}
|
11
11
|
end
|
12
12
|
end
|
data/lib/rudash/negate.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Rudash
|
2
2
|
module Negate
|
3
|
-
def negate(
|
4
|
-
raise 'Expected a
|
3
|
+
def negate(a_lambda)
|
4
|
+
raise 'Expected a lambda/Method' unless Rudash::Utils.function?(a_lambda)
|
5
5
|
|
6
|
-
->(*args) { !
|
6
|
+
->(*args) { !a_lambda.call(*args) }
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# once you configured a function with a specific set of arguments then you must call it with that
|
4
4
|
# set or else you will get an exception.
|
5
5
|
# That is so useful for predicate functions that developer define out of the library scope.
|
6
|
-
# We send all the arguments to the developer defined
|
6
|
+
# We send all the arguments to the developer defined lambda and if it's failed
|
7
7
|
# because of ArgumentError we call it recursively with less argument until success.
|
8
8
|
|
9
9
|
module Rudash
|
@@ -34,7 +34,7 @@ module Rudash
|
|
34
34
|
})
|
35
35
|
|
36
36
|
# That was done for performance manners since
|
37
|
-
# R_.each don't stop when returning false from the
|
37
|
+
# R_.each don't stop when returning false from the lambda
|
38
38
|
# so we force it to stop by throwing an exception that we catch later
|
39
39
|
# It's the same hack for JavaScript forEach function.
|
40
40
|
raise if match == false
|
data/lib/version.rb
CHANGED