routing-filter 0.1.4 → 0.1.5

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.
@@ -58,7 +58,6 @@ Rack::Mount::CodeGeneration.class_eval do
58
58
  def recognize_with_filtering(request, &block)
59
59
  path, route, matches, params = request.env['PATH_INFO'], nil, nil, nil
60
60
  filters.run(:around_recognize, path, {}) do
61
- path.replace('/') if path.empty?
62
61
  route, matches, params = recognize_without_filtering(request)
63
62
  params || {}
64
63
  end
@@ -19,7 +19,8 @@ module RoutingFilter
19
19
  protected
20
20
 
21
21
  def extract_segment!(pattern, path)
22
- path.sub!(pattern, '')
22
+ path.sub!(pattern) { $2 || '' }
23
+ path.replace('/') if path.empty?
23
24
  $1
24
25
  end
25
26
 
@@ -21,7 +21,7 @@
21
21
 
22
22
  module RoutingFilter
23
23
  class Uuid < Filter
24
- UUID_SEGMENT = %r(^/?([a-z\d]{8}\-[a-z\d]{4}\-[a-z\d]{4}\-[a-z\d]{4}\-[a-z\d]{12})/?)
24
+ UUID_SEGMENT = %r(^/?([a-z\d]{8}\-[a-z\d]{4}\-[a-z\d]{4}\-[a-z\d]{4}\-[a-z\d]{12})(/)?)
25
25
 
26
26
  def around_recognize(path, env, &block)
27
27
  uuid = extract_segment!(UUID_SEGMENT, path)
@@ -1,3 +1,3 @@
1
1
  module RoutingFilter
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
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: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sven Fuchs