vidibus-routing_error 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +22 -6
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/vidibus-routing_error.gemspec +6 -7
- metadata +9 -10
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
=
|
1
|
+
= Vidibus::RoutingError
|
2
2
|
|
3
3
|
Catches ActionController::RoutingError which does not work with Rails 3
|
4
4
|
out of the box. It basically catches the exception on Rack-level and
|
@@ -17,9 +17,9 @@ controller does not work as expected. The underlying problem is discussed
|
|
17
17
|
An easy but insufficient fix for this issue is to define a catch-all route
|
18
18
|
at the end of your routes.rb:
|
19
19
|
|
20
|
-
match "*
|
20
|
+
match "*path" => "application#rescue_404"
|
21
21
|
|
22
|
-
|
22
|
+
<b>But beware of the major drawback!</b> If your application relies on engines that
|
23
23
|
extend your app with their own routes, things will break because those
|
24
24
|
routes will never get fired.
|
25
25
|
|
@@ -67,16 +67,32 @@ a ActionController::RoutingError on application level so you can rescue this err
|
|
67
67
|
|
68
68
|
== Possible Issues
|
69
69
|
|
70
|
-
|
70
|
+
=== Catch-all Route
|
71
|
+
|
72
|
+
If your application has a catch-route, this gem won't work, because routes provided by
|
73
|
+
engines will be added after any existing routes. If you don't need a catch-all route for
|
74
|
+
other purposes than rescuing from routing errors, you can savely remove it.
|
75
|
+
|
76
|
+
|
77
|
+
=== Class Caching
|
78
|
+
|
79
|
+
Depending on the structure of your application, you might get an error in development
|
80
|
+
like this:
|
71
81
|
|
72
82
|
TypeError (User can't be referred)
|
73
83
|
|
74
|
-
This error is caused by some caching-reloading madness: The middleware implanted by
|
84
|
+
This error is caused by some caching-reloading madness: The middleware implanted by
|
85
|
+
this gem is cached. But in development, your classes usually aren't. Thus some classes
|
86
|
+
may not be available under certain circumstances, e.g. if you are using before filters
|
87
|
+
for user authentication provided by some engine. You should be able to get rid of
|
88
|
+
the error above by turning on class caching. Try it (and restart the server afterwards):
|
75
89
|
|
76
90
|
# development.rb
|
77
91
|
config.cache_classes = true
|
78
92
|
|
79
|
-
If the error is gone, you're lucky as I am. But since it is not feasible to cache classes
|
93
|
+
If the error is gone, you're lucky as I am. But since it is not feasible to cache classes
|
94
|
+
in development, turn off class caching again and explicitly require the class that couldn't
|
95
|
+
be referred. In my case, it's the user class:
|
80
96
|
|
81
97
|
# top of development.rb
|
82
98
|
require "app/models/user"
|
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ begin
|
|
13
13
|
gem.add_development_dependency "rspec"
|
14
14
|
gem.add_development_dependency "relevance-rcov"
|
15
15
|
gem.add_development_dependency "rr"
|
16
|
-
gem.add_dependency "rails", "
|
16
|
+
gem.add_dependency "rails", "~> 3.0.0"
|
17
17
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
18
|
end
|
19
19
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{vidibus-routing_error}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andre Pankratz"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-05-04}
|
13
13
|
s.description = %q{Catches ActionController::RoutingError and sends it to a custom method.}
|
14
14
|
s.email = %q{andre@vidibus.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -32,32 +32,31 @@ Gem::Specification.new do |s|
|
|
32
32
|
]
|
33
33
|
s.homepage = %q{http://github.com/vidibus/vidibus-routing_error}
|
34
34
|
s.require_paths = ["lib"]
|
35
|
-
s.rubygems_version = %q{1.
|
35
|
+
s.rubygems_version = %q{1.6.2}
|
36
36
|
s.summary = %q{Catches ActionController::RoutingError in Rails 3.}
|
37
37
|
s.test_files = [
|
38
38
|
"spec/spec_helper.rb"
|
39
39
|
]
|
40
40
|
|
41
41
|
if s.respond_to? :specification_version then
|
42
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
42
|
s.specification_version = 3
|
44
43
|
|
45
44
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
46
45
|
s.add_development_dependency(%q<rspec>, [">= 0"])
|
47
46
|
s.add_development_dependency(%q<relevance-rcov>, [">= 0"])
|
48
47
|
s.add_development_dependency(%q<rr>, [">= 0"])
|
49
|
-
s.add_runtime_dependency(%q<rails>, ["
|
48
|
+
s.add_runtime_dependency(%q<rails>, ["~> 3.0.0"])
|
50
49
|
else
|
51
50
|
s.add_dependency(%q<rspec>, [">= 0"])
|
52
51
|
s.add_dependency(%q<relevance-rcov>, [">= 0"])
|
53
52
|
s.add_dependency(%q<rr>, [">= 0"])
|
54
|
-
s.add_dependency(%q<rails>, ["
|
53
|
+
s.add_dependency(%q<rails>, ["~> 3.0.0"])
|
55
54
|
end
|
56
55
|
else
|
57
56
|
s.add_dependency(%q<rspec>, [">= 0"])
|
58
57
|
s.add_dependency(%q<relevance-rcov>, [">= 0"])
|
59
58
|
s.add_dependency(%q<rr>, [">= 0"])
|
60
|
-
s.add_dependency(%q<rails>, ["
|
59
|
+
s.add_dependency(%q<rails>, ["~> 3.0.0"])
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vidibus-routing_error
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 21
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andre Pankratz
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-05-04 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -66,15 +66,14 @@ dependencies:
|
|
66
66
|
requirement: &id004 !ruby/object:Gem::Requirement
|
67
67
|
none: false
|
68
68
|
requirements:
|
69
|
-
- -
|
69
|
+
- - ~>
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
hash:
|
71
|
+
hash: 7
|
72
72
|
segments:
|
73
73
|
- 3
|
74
74
|
- 0
|
75
75
|
- 0
|
76
|
-
|
77
|
-
version: 3.0.0.rc
|
76
|
+
version: 3.0.0
|
78
77
|
type: :runtime
|
79
78
|
version_requirements: *id004
|
80
79
|
description: Catches ActionController::RoutingError and sends it to a custom method.
|
@@ -129,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
128
|
requirements: []
|
130
129
|
|
131
130
|
rubyforge_project:
|
132
|
-
rubygems_version: 1.
|
131
|
+
rubygems_version: 1.6.2
|
133
132
|
signing_key:
|
134
133
|
specification_version: 3
|
135
134
|
summary: Catches ActionController::RoutingError in Rails 3.
|