underware 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/underware.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b904fcfa82bc2c780798bf1a2f89a3d743071e5b
|
4
|
+
data.tar.gz: f5df6c0140ffe29323d63dee522faf11288dca85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98524963415d8393c12c5f9338ec2efa09e7b0d6cae4506db6fb754d430858371778ec2b109dc82b2d85ecc7a4b6da4f3551452300323485a7579bbed023ffc4
|
7
|
+
data.tar.gz: fb6bc53d4d6859f19029e70439ae6f0c43b507f50c08fe2494fde0463c3d252fc4ce377e346ebadbcf52930610a3a63703032bec1bcc15c5660a886f88f0cd41
|
data/lib/underware.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
|
2
2
|
module Underware
|
3
|
+
# Just a generic do-nothing lambda
|
4
|
+
DoNothing = ->(*args){ }
|
3
5
|
|
4
6
|
# Base class for middleware. Basically, it
|
5
7
|
# just demonstrates the interface that you
|
@@ -34,7 +36,7 @@ module Underware
|
|
34
36
|
def fold_underware(mws, &block)
|
35
37
|
return fold_underware([*mws, block]) if block_given?
|
36
38
|
|
37
|
-
mws.reverse_each.inject do |folded, mw|
|
39
|
+
mws.reverse_each.inject(DoNothing) do |folded, mw|
|
38
40
|
Folded.new(mw, folded)
|
39
41
|
end
|
40
42
|
end
|