sinatra-router 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sinatra/router.rb +3 -2
- metadata +2 -2
data/lib/sinatra/router.rb
CHANGED
@@ -13,7 +13,8 @@ module Sinatra
|
|
13
13
|
if ret = try_route(env["REQUEST_METHOD"], env["PATH_INFO"], env)
|
14
14
|
ret
|
15
15
|
else
|
16
|
-
raise "
|
16
|
+
raise "router needs to be (1) mounted as middleware or (b) contain " +
|
17
|
+
"a default run statement" if !@app && !@run
|
17
18
|
|
18
19
|
# if set as middlware, prefer that, otherwise try default run module
|
19
20
|
(@app || @run).call(env)
|
@@ -26,7 +27,7 @@ module Sinatra
|
|
26
27
|
@run = app
|
27
28
|
end
|
28
29
|
|
29
|
-
def
|
30
|
+
def mount(app, *conditions)
|
30
31
|
# mix in context based conditions with conditions given by parameter
|
31
32
|
@apps << [app, @conditions + conditions]
|
32
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|