gaffe 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/gaffe.rb +3 -1
- data/lib/gaffe/version.rb +1 -1
- data/spec/gaffe/gaffe_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f11ed5e2f7011f004427fe69184837d35b31af2
|
4
|
+
data.tar.gz: 304c3635b28278b352059fd745e1041179047aa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c62e677a735251fd1b3b89d1b9e6a8082f54d881301f1c6beb46a297403506c40345313835a8fa77788630e61b1d1bbc6471c9701d1bc6e4e56a582475ba673
|
7
|
+
data.tar.gz: 7532aaf83cd7de38e20350dc75e1266f5f4a5a1c713be971a0a08bea2c1ea10cf532ec4433b481c638db6ce288444f2b1de34235568b902deeb4706540a6d2bd
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<img src="http://i.imgur.com/k9Vo08q.png" alt="gaffe" />
|
4
4
|
</a>
|
5
5
|
<br />
|
6
|
-
Gaffe makes having customized error pages in Rails applications an easy thing.<br /> It takes advantage of a feature present in Rails 3.2
|
6
|
+
Gaffe makes having customized error pages in Rails applications an easy thing.<br /> It takes advantage of a feature present in Rails 3.2 (and 4.0, obviously) called <code>exceptions_app</code>.
|
7
7
|
<br /><br />
|
8
8
|
<a href="https://rubygems.org/gems/gaffe"><img src="https://badge.fury.io/rb/gaffe.png" /></a>
|
9
9
|
<a href="https://codeclimate.com/github/mirego/gaffe"><img src="https://codeclimate.com/github/mirego/gaffe.png" /></a>
|
data/lib/gaffe.rb
CHANGED
@@ -39,7 +39,9 @@ module Gaffe
|
|
39
39
|
controller = controller.detect { |pattern, _| env["REQUEST_URI"] =~ pattern }.try(:last)
|
40
40
|
end
|
41
41
|
|
42
|
-
controller
|
42
|
+
controller ||= builtin_errors_controller
|
43
|
+
|
44
|
+
controller.respond_to?(:constantize) ? controller.constantize : controller
|
43
45
|
end
|
44
46
|
|
45
47
|
# Return the root path of the gem
|
data/lib/gaffe/version.rb
CHANGED
data/spec/gaffe/gaffe_spec.rb
CHANGED
@@ -30,6 +30,16 @@ describe Gaffe do
|
|
30
30
|
it { expect(controller).to eql :foo }
|
31
31
|
end
|
32
32
|
|
33
|
+
context 'with custom-defined controller that respond to `#constantize`' do
|
34
|
+
before do
|
35
|
+
Gaffe.configure do |config|
|
36
|
+
config.errors_controller = "String"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
it { expect(controller).to eql String }
|
41
|
+
end
|
42
|
+
|
33
43
|
context 'with multiple custom-defined controllers' do
|
34
44
|
before do
|
35
45
|
Gaffe.configure do |config|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gaffe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rémi Prévost
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|