routing-filter 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.libs << 'lib' << 'test'
6
+ t.pattern = 'test/**/*_test.rb'
7
+ t.verbose = false
8
+ end
9
+
10
+ task :default => :test
11
+
@@ -15,7 +15,7 @@ ActionController::Routing::RouteSet::NamedRouteCollection.class_eval do
15
15
  if match = code.match(%r(^return (.*) if (.*)))
16
16
  # returned string must not contain newlines, or we'll spill out of inline code comments in
17
17
  # ActionController::Routing::RouteSet::NamedRouteCollection#define_url_helper
18
- "returning(#{match[1]}) { |result|" +
18
+ "#{match[1]}.tap { |result|" +
19
19
  " ActionController::Routing::Routes.filters.run(:around_generate, *args, &lambda{ result }) " +
20
20
  "} if #{match[2]}"
21
21
  end
@@ -1,3 +1,3 @@
1
1
  module RoutingFilter
2
- VERSION = '0.2.3'
3
- end
2
+ VERSION = '0.2.4'
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: 17
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sven Fuchs
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-25 00:00:00 +01:00
19
- default_executable:
18
+ date: 2011-07-12 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: actionpack
@@ -83,37 +82,36 @@ extensions: []
83
82
  extra_rdoc_files: []
84
83
 
85
84
  files:
86
- - lib/routing-filter.rb
87
85
  - lib/routing_filter/adapters/rails_2.rb
88
86
  - lib/routing_filter/adapters/rails_3.rb
89
- - lib/routing_filter/chain.rb
90
87
  - lib/routing_filter/filter.rb
88
+ - lib/routing_filter/chain.rb
91
89
  - lib/routing_filter/filters/extension.rb
92
90
  - lib/routing_filter/filters/locale.rb
93
91
  - lib/routing_filter/filters/pagination.rb
94
92
  - lib/routing_filter/filters/uuid.rb
95
93
  - lib/routing_filter/version.rb
94
+ - lib/routing-filter.rb
96
95
  - lib/routing_filter.rb
97
96
  - test/all.rb
98
- - test/blocks.rb
99
- - test/filters/all_filters/generation.rb
100
- - test/filters/all_filters/recognition.rb
101
- - test/filters/all_filters_test.rb
102
- - test/filters/extension_test.rb
103
- - test/filters/locale_test.rb
104
- - test/filters/pagination_test.rb
105
- - test/filters/uuid_test.rb
106
97
  - test/rails_test.rb
107
98
  - test/routes_test.rb
108
- - test/routing_filter_test.rb
109
99
  - test/test_adapters/rails_2.rb
110
100
  - test/test_adapters/rails_3.rb
101
+ - test/routing_filter_test.rb
111
102
  - test/test_helper.rb
112
- - Gemfile
103
+ - test/filters/locale_test.rb
104
+ - test/filters/all_filters_test.rb
105
+ - test/filters/pagination_test.rb
106
+ - test/filters/all_filters/generation.rb
107
+ - test/filters/all_filters/recognition.rb
108
+ - test/filters/uuid_test.rb
109
+ - test/filters/extension_test.rb
113
110
  - Gemfile.lock
114
111
  - MIT-LICENSE
112
+ - Rakefile
113
+ - Gemfile
115
114
  - README.markdown
116
- has_rdoc: true
117
115
  homepage: http://github.com/svenfuchs/routing-filter
118
116
  licenses: []
119
117
 
@@ -143,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
141
  requirements: []
144
142
 
145
143
  rubyforge_project: "[none]"
146
- rubygems_version: 1.4.2
144
+ rubygems_version: 1.8.5
147
145
  signing_key:
148
146
  specification_version: 3
149
147
  summary: 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
data/test/blocks.rb DELETED
@@ -1,33 +0,0 @@
1
- # def foo
2
- # f = Proc.new { return "return from foo from inside proc" }
3
- # f.call # control leaves foo here
4
- # return "return from foo"
5
- # end
6
- #
7
- # def bar
8
- # f = lambda { return "return from lambda" }
9
- # f.call # control does not leave bar here
10
- # return "return from bar"
11
- # end
12
- #
13
- # puts foo # prints "return from foo from inside proc"
14
- # puts bar # prints "return from bar"
15
-
16
-
17
- class RouteSet
18
- def call
19
- recognize &Proc.new { return 'return from recognize block' }
20
- p "KEKSE"
21
- # recognize do
22
- # return 'return from recognize block'
23
- # end
24
- end
25
-
26
- def recognize
27
- yield
28
- p "KEKSE"
29
- end
30
- end
31
-
32
-
33
- puts RouteSet.new.call