sinatra-router 0.1.1 → 0.2.0

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.
Files changed (2) hide show
  1. data/lib/sinatra/router.rb +3 -2
  2. metadata +2 -2
@@ -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 "neither @app nor @run is set" if !@app && !@run
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 route(app, *conditions)
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.1.1
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-24 00:00:00.000000000 Z
12
+ date: 2012-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra