rack-multiplexer 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/multiplexer/version.rb +1 -1
- data/lib/rack/multiplexer.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7c8ab11fc06dc54a32046d1f2e609f282a223ab
|
4
|
+
data.tar.gz: 834508a68b91274b24d72356caa70960a62c4d51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a7406bf393f96a5a7c276e6489b141d2af984a9e0bf62a825f39d70f70ad27c33e5c3cf64d32b30e9cfba7a8e4ceb321bf2b747327dc2c1ccb1e1f0bc00c423
|
7
|
+
data.tar.gz: 7399eb6febb40685284406accdff52ad56ac7820e3977eb3c3112a14796206593153f505b485a5a7659db98d87b4235872f2c7cf5d397a2b5695d39347e19661
|
data/lib/rack/multiplexer.rb
CHANGED
@@ -16,7 +16,7 @@ require "rack/request"
|
|
16
16
|
#
|
17
17
|
module Rack
|
18
18
|
class Multiplexer
|
19
|
-
def initialize(not_found_application =
|
19
|
+
def initialize(not_found_application = nil, &block)
|
20
20
|
@not_found_application = not_found_application
|
21
21
|
instance_eval(&block) if block
|
22
22
|
end
|
@@ -26,7 +26,7 @@ module Rack
|
|
26
26
|
(
|
27
27
|
routes[env["REQUEST_METHOD"]].find(path) ||
|
28
28
|
routes["ANY"].find(path) ||
|
29
|
-
|
29
|
+
not_found_application
|
30
30
|
).call(env)
|
31
31
|
end
|
32
32
|
|
@@ -58,8 +58,8 @@ module Rack
|
|
58
58
|
@routes ||= Hash.new {|hash, key| hash[key] = Routes.new }
|
59
59
|
end
|
60
60
|
|
61
|
-
def
|
62
|
-
->(env) {
|
61
|
+
def not_found_application
|
62
|
+
@not_found_application ||= ->(env) {
|
63
63
|
[
|
64
64
|
404,
|
65
65
|
{
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-multiplexer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|