joshbuddy-usher 0.3.3 → 0.3.4

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.
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 3
2
+ :patch: 4
3
3
  :major: 0
4
4
  :minor: 3
@@ -6,10 +6,11 @@ class Usher
6
6
  module Interface
7
7
  class RackInterface
8
8
 
9
- Request = Struct.new(:path, :method)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: joshbuddy-usher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Hull