joshbuddy-usher 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/usher/interface/rack_interface.rb +4 -3
- metadata +1 -1
data/VERSION.yml
CHANGED
@@ -6,10 +6,11 @@ class Usher
|
|
6
6
|
module Interface
|
7
7
|
class RackInterface
|
8
8
|
|
9
|
-
|
9
|
+
RequestMethods = [:method, :host, :port, :scheme]
|
10
|
+
Request = Struct.new(:path, *RequestMethods)
|
10
11
|
|
11
12
|
def initialize
|
12
|
-
@routes = Usher.new
|
13
|
+
@routes = Usher.new(:request_methods => RequestMethods)
|
13
14
|
end
|
14
15
|
|
15
16
|
def add(path, options = {})
|
@@ -21,7 +22,7 @@ class Usher
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def call(env)
|
24
|
-
response = @routes.recognize(Request.new(env['REQUEST_URI'], env['REQUEST_METHOD']))
|
25
|
+
response = @routes.recognize(Request.new(env['REQUEST_URI'], env['REQUEST_METHOD'].downcase, env['HTTP_HOST'], env['SERVER_PORT'].to_i, env['rack.url_scheme']))
|
25
26
|
env['usher.params'] = response.params.inject({}){|h,(k,v)| h[k]=v; h }
|
26
27
|
response.path.route.params.first.call(env)
|
27
28
|
end
|