routing-filter 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,8 +53,15 @@ Rack::Mount::CodeGeneration.class_eval do
53
53
  alias :optimize_recognize_without_filtering! :optimize_recognize!
54
54
  alias :optimize_recognize! :optimize_recognize_with_filtering!
55
55
 
56
+ # note: if you overly and unnecessarily use blocks in your lowlevel libraries you make it fricking
57
+ # hard for your users to hook in anywhere
56
58
  def recognize_with_filtering(request, &block)
57
- filters.run(:around_recognize, request.env['PATH_INFO'], {}, &lambda{ recognize_without_filtering(request, &block) })
59
+ route, matches, params = nil
60
+ filters.run(:around_recognize, request.env['PATH_INFO'], {}) do |path, env|
61
+ recognize_without_filtering(request) { |r, m, p| route, matches, params = r, m, p }
62
+ params
63
+ end
64
+ block.call(route, matches, params)
58
65
  end
59
66
  end
60
67
 
@@ -1,3 +1,3 @@
1
1
  module RoutingFilter
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: routing-filter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sven Fuchs