async-http 0.27.1 → 0.27.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/http/middleware/builder.rb +14 -3
- data/lib/async/http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36cc450006286215c770afb827d6eceed69ae22a8ad9c656e6a9b5c390725098
|
4
|
+
data.tar.gz: 8a503fce6425578681ce03921242f3f189ca041d3bcdb518a209cf7b22b1ef86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17f315d6f0a473ef646bfbbb0fc2728243c275a8f14a85b1ee2f905a70542fdea28d08c30aeadac4eb4d979095a85579bc4c6046de75556555307954ab98ce53
|
7
|
+
data.tar.gz: 9c1af523d534885a18688acd8cd5304afa61551f104ad1650dc4a5558a04494341e8e33f44955fd4560d2a088333d8783577346d6a03fc0e92db4c319b7d3722
|
@@ -18,13 +18,24 @@
|
|
18
18
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
|
+
|
22
|
+
|
21
23
|
module Async
|
22
24
|
module HTTP
|
23
25
|
class Middleware
|
26
|
+
module NotFound
|
27
|
+
def self.close
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.call(request)
|
31
|
+
Response[404, {}, []]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
24
35
|
class Builder
|
25
|
-
def initialize(default_app =
|
36
|
+
def initialize(default_app = NotFound, &block)
|
26
37
|
@use = []
|
27
|
-
@
|
38
|
+
@app = default_app
|
28
39
|
|
29
40
|
instance_eval(&block) if block_given?
|
30
41
|
end
|
@@ -38,7 +49,7 @@ module Async
|
|
38
49
|
end
|
39
50
|
|
40
51
|
def to_app
|
41
|
-
|
52
|
+
@use.reverse.inject(@app) {|app, use| use.call(app).freeze}
|
42
53
|
end
|
43
54
|
end
|
44
55
|
|
data/lib/async/http/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|