mustermann 4.0.0.alpha → 4.0.0.alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mustermann/router.rb +3 -3
- data/lib/mustermann/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: 2aedc31385aca5281460e4f6febcbb1324893268be9b618145de232753872094
|
|
4
|
+
data.tar.gz: 3e33a069dcae0e6585070403c57b294f5c8f00ccc59e44fb8267e2c2ab3b886a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d59d5e758aacedb994f6c9dce3c0215a626d8b0603535a01ab88b998f2f1666522d2eb94f4471fd785d56a3501b0c54c190f2ba594bbd759df5544bd72a9dfb
|
|
7
|
+
data.tar.gz: fc17a19691e4cdf94466402258f9467a48def4722dddaf3a01eca8170f70ad3d5ddfe51bf5a03ce7a973756ef43be4b787ae63aa18066762f864bd88d473541c
|
data/lib/mustermann/router.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Mustermann
|
|
|
11
11
|
# router = Mustermann::Router.new do
|
|
12
12
|
# get "/hello/:name" do |env|
|
|
13
13
|
# name = env["mustermann.match"][:name]
|
|
14
|
-
# [200, { "
|
|
14
|
+
# [200, { "content-type" => "text/plain" }, ["Hello, #{name}!"]]
|
|
15
15
|
# end
|
|
16
16
|
# end
|
|
17
17
|
#
|
|
@@ -38,7 +38,7 @@ module Mustermann
|
|
|
38
38
|
# @see Mustermann::Set
|
|
39
39
|
# @see https://rack.github.io/rack/
|
|
40
40
|
class Router
|
|
41
|
-
NOT_FOUND = [404, { "
|
|
41
|
+
NOT_FOUND = [404, { "content-type" => "text/plain", "x-cascade" => "pass" }, ["Not found"]].freeze
|
|
42
42
|
VERBS = %w[GET HEAD POST PUT PATCH DELETE OPTIONS LINK UNLINK].freeze
|
|
43
43
|
private_constant :VERBS, :NOT_FOUND
|
|
44
44
|
|
|
@@ -49,7 +49,7 @@ module Mustermann
|
|
|
49
49
|
@key = key
|
|
50
50
|
@sets = VERBS.to_h { |verb| [verb, Set.new] }
|
|
51
51
|
@options = options
|
|
52
|
-
@fallback = fallback || ->(env) { NOT_FOUND }
|
|
52
|
+
@fallback = fallback || ->(env) { NOT_FOUND.dup }
|
|
53
53
|
instance_exec(&block) if block_given?
|
|
54
54
|
end
|
|
55
55
|
|
data/lib/mustermann/version.rb
CHANGED