routing-filter 0.1.7 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@ ActionController::Routing::RouteSet.class_eval do
32
32
 
33
33
  def add_filters(*names)
34
34
  options = names.extract_options!
35
- names.each { |name| filters << RoutingFilter.build(name, options) }
35
+ names.each { |name| filters.unshift(RoutingFilter.build(name, options)) }
36
36
  end
37
37
 
38
38
  def recognize_path_with_filtering(path, env = {})
@@ -66,4 +66,4 @@ ActionController::Routing::RouteSet.class_eval do
66
66
  :subdomain => request.subdomains.first
67
67
  end
68
68
  end
69
- end
69
+ end
@@ -13,7 +13,7 @@ end
13
13
  ActionDispatch::Routing::RouteSet.class_eval do
14
14
  def add_filters(*names)
15
15
  options = names.extract_options!
16
- names.each { |name| @set.filters << RoutingFilter.build(name, options) }
16
+ names.each { |name| @set.filters.unshift(RoutingFilter.build(name, options)) }
17
17
  end
18
18
 
19
19
  # def recognize_path_with_filtering(path, env = {})
@@ -4,13 +4,19 @@ module RoutingFilter
4
4
  filter.previous, last.next = last, filter if last
5
5
  super
6
6
  end
7
-
7
+ alias push <<
8
+
9
+ def unshift(filter)
10
+ filter.next, first.previous = first, filter if first
11
+ super
12
+ end
13
+
8
14
  def run(method, *args, &final)
9
15
  active? ? first.run(method, *args, &final) : final.call
10
16
  end
11
-
17
+
12
18
  def active?
13
19
  RoutingFilter.active? && !empty?
14
20
  end
15
21
  end
16
- end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module RoutingFilter
2
- VERSION = '0.1.7'
2
+ VERSION = '0.2.0'
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: 21
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 7
10
- version: 0.1.7
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sven Fuchs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-30 00:00:00 +02:00
18
+ date: 2010-10-28 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -33,7 +33,7 @@ dependencies:
33
33
  type: :runtime
34
34
  version_requirements: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- name: test_declarative
36
+ name: i18n
37
37
  prerelease: false
38
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
39
  none: false
@@ -46,6 +46,34 @@ dependencies:
46
46
  version: "0"
47
47
  type: :development
48
48
  version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: rails
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ type: :development
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
64
+ name: test_declarative
65
+ prerelease: false
66
+ requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ type: :development
76
+ version_requirements: *id004
49
77
  description: Routing filters wraps around the complex beast that the Rails routing system is, allowing for unseen flexibility and power in Rails URL recognition and generation.
50
78
  email: svenfuchs@artweb-design.de
51
79
  executables: []
@@ -56,7 +84,6 @@ extra_rdoc_files: []
56
84
 
57
85
  files:
58
86
  - lib/routing-filter.rb
59
- - lib/routing_filter.rb
60
87
  - lib/routing_filter/adapters/rails_2.rb
61
88
  - lib/routing_filter/adapters/rails_3.rb
62
89
  - lib/routing_filter/chain.rb
@@ -66,6 +93,7 @@ files:
66
93
  - lib/routing_filter/filters/pagination.rb
67
94
  - lib/routing_filter/filters/uuid.rb
68
95
  - lib/routing_filter/version.rb
96
+ - lib/routing_filter.rb
69
97
  has_rdoc: true
70
98
  homepage: http://github.com/svenfuchs/routing-filter
71
99
  licenses: []