rackr 0.0.43 → 0.0.45

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e2cc704247949346f6cfc0fde345dc102320dafaf55b37f955aadb39b45f076
4
- data.tar.gz: ca4d5ae5a2b41ca2f543962bb9464fd1fdaec34454a681829590d12817832c8f
3
+ metadata.gz: b44fd42881233909b8fc9239a9d235c53644bc12bc40c34cf94baf66d73d2f9d
4
+ data.tar.gz: 7be5769d84a9cb8e7163da17c694481a1412ff9a26d9063fc4894fa647cb291d
5
5
  SHA512:
6
- metadata.gz: 106da24676d33cd7121ea8408cdb4a3231c44228f7f0d3e97a41114c7896da234d70411f29c3e71c3c79b54425fe8504747cc67deea37d96497364f90a1b410d
7
- data.tar.gz: f857873f017b893c49d552115cab7535b08debde99d530cf50a1b48cf50ae81cef7b212560b54559c2564c2e11b43e01e2692120aa5097bf75dde07618bd883c
6
+ metadata.gz: 5d5e78dcd9c0650ccf13d53ba4c3975c128b0f3b1143d0765fd2788a390f9daed89824ab6a70a892a6d9388ec00a44ff577407e75d1b517d505f664037148dab
7
+ data.tar.gz: 5371f8525a097bd4cc86b6ffcd0be75baf999a13488412eb66c13a8e7e599b65f4b633fb0df04ce2a863c1f787e9ce4b11eaa618b8e3d83e6256fca826b91e61
@@ -26,7 +26,7 @@ class Rackr
26
26
  def match?(env)
27
27
  return match_with_params?(env) if @has_params
28
28
 
29
- env['REQUEST_PATH'] == @path
29
+ env['PATH_INFO'] == @path
30
30
  end
31
31
 
32
32
  private
@@ -36,7 +36,7 @@ class Rackr
36
36
  end
37
37
 
38
38
  def match_with_params?(env)
39
- splitted_request_path = env['REQUEST_PATH'].split('/')
39
+ splitted_request_path = env['PATH_INFO'].split('/')
40
40
 
41
41
  return false if @splitted_path.size != splitted_request_path.size
42
42
 
data/lib/rackr/router.rb CHANGED
@@ -62,6 +62,8 @@ class Rackr
62
62
  end
63
63
 
64
64
  endpoint_result
65
+ rescue Rackr::NotFound
66
+ render_not_found(request_builder.call)
65
67
  rescue Exception => e
66
68
  @error.call(request_builder.call, e)
67
69
  end
@@ -186,7 +188,7 @@ class Rackr
186
188
  def match_route(env, last_tail = nil, found_branches = [])
187
189
  routes =
188
190
  if last_tail.nil?
189
- last_tail = env['REQUEST_PATH'].split('/').drop(1)
191
+ last_tail = env['PATH_INFO'].split('/').drop(1)
190
192
 
191
193
  @routes[env['REQUEST_METHOD']]
192
194
  else
data/lib/rackr.rb CHANGED
@@ -5,6 +5,8 @@ require_relative 'rackr/action'
5
5
  require_relative 'rackr/callback'
6
6
 
7
7
  class Rackr
8
+ class NotFound < StandardError; end
9
+
8
10
  include Action
9
11
 
10
12
  def initialize(config = {}, before: [], after: [])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rackr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.43
4
+ version: 0.0.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique F. Teixeira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-13 00:00:00.000000000 Z
11
+ date: 2023-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubi