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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ce01c4c09894fecd78f12031f46135cbc4c8abf
4
- data.tar.gz: 60960d0ee25ed32565227492b3014d491c45571a
3
+ metadata.gz: 5f11ed5e2f7011f004427fe69184837d35b31af2
4
+ data.tar.gz: 304c3635b28278b352059fd745e1041179047aa6
5
5
  SHA512:
6
- metadata.gz: db16c3dc353687abeadccf095aa5b6000d94f9f68938e3106b19528a9f14a322f06f1d389fa5edef8c6cafd6a6f9f6f33e779eee8d0ef1f450bba99c4b147dd5
7
- data.tar.gz: 7083bbd24ada18edd68684b8d544e9ee22446f9bd0161721990a4437f04d39773bcdac294efe07a50cff5b77511c5812470abac52672a9478e8f5719d2e6394f
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+ called <code>exceptions_app</code>.
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 || builtin_errors_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
@@ -1,3 +1,3 @@
1
1
  module Gaffe
2
- VERSION = '1.0' # Woo-hoo
2
+ VERSION = '1.0.1'
3
3
  end
@@ -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: '1.0'
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-10-17 00:00:00.000000000 Z
12
+ date: 2013-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler