http_router 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/http_router/node/arbitrary.rb +3 -1
- data/lib/http_router/version.rb +1 -1
- metadata +4 -4
@@ -1,6 +1,8 @@
|
|
1
1
|
class HttpRouter
|
2
2
|
class Node
|
3
3
|
class Arbitrary < Node
|
4
|
+
alias_method :node_lookup, :[]
|
5
|
+
|
4
6
|
def initialize(router, allow_partial, blk, param_names)
|
5
7
|
@allow_partial, @blk, @param_names = allow_partial, blk, param_names
|
6
8
|
super(router)
|
@@ -10,7 +12,7 @@ class HttpRouter
|
|
10
12
|
if request.path.empty? or (request.path.size == 1 and request.path[0] == '') or @allow_partial
|
11
13
|
catch(:pass) do
|
12
14
|
request = request.clone
|
13
|
-
request.continue = proc { |state|
|
15
|
+
request.continue = proc { |state| node_lookup(request) if state }
|
14
16
|
params = @param_names.nil? ? {} : Hash[@param_names.zip(request.params)]
|
15
17
|
@blk.call(request, params)
|
16
18
|
end
|
data/lib/http_router/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 5
|
10
|
+
version: 0.7.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joshua Hull
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-28 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|