err_merchant 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,4 +1,7 @@
1
1
  = err_merchant
2
+
3
+ {<img src="https://secure.travis-ci.org/fschwahn/err_merchant.png" />}[http://travis-ci.org/fschwahn/err_merchant]
4
+
2
5
  This is a very simple Rails Engine for replacing the standard (ugly) Rails exception pages with pages which are rendered in your layout. There are several gems out there that do the same, but this one takes the approach proposed by AccUser[http://accuser.cc/posts/1-rails-3-0-exception-handling]. I just made a gem out of it because I use it in every project. This solution works seamlessly with Airbrake[http://airbrake.io/].
3
6
 
4
7
  == Installation
@@ -31,15 +34,18 @@ You can translate the error messages, by default they are the same as the standa
31
34
  Please note that there are translations missing in development mode if you don't supply translations for your locale. In production however, +config.i18n.fallbacks+ is usually set to +true+, so the error messages for the default locale will be shown if the lookup is not successful.
32
35
 
33
36
  == Changelog
34
- === 0.1.2
37
+ === 0.2.0 (2012-01-30)
38
+ * only supports rails 3.2 (code cleanup)
39
+
40
+ === 0.1.2 (2012-01-12)
35
41
  * added configuration option for layout
36
42
 
37
- === 0.1.1
43
+ === 0.1.1 (2012-01-12)
38
44
  * fix gemspec
39
45
  * add test for fallback to standard rails error pages
40
46
  * fix issue with CanCan
41
47
 
42
- === 0.1.0
48
+ === 0.1.0 (2012-01-11)
43
49
  * Initial release
44
50
 
45
51
  == License
@@ -1,10 +1,10 @@
1
1
  require 'rails/engine'
2
- require 'err_merchant/show_exceptions_patch'
2
+ require 'err_merchant/exceptions_app'
3
3
 
4
4
  module ErrMerchant
5
5
  class Engine < ::Rails::Engine
6
- initializer "err_merchant.show_exceptions_patch" do
7
- ActionDispatch::ShowExceptions.send(:include, ShowExceptionsPatch)
6
+ initializer "err_merchant.set_exceptions_app" do |app|
7
+ app.config.exceptions_app = ErrMerchant::ExceptionsApp.new
8
8
  end
9
9
  end
10
10
  end
@@ -0,0 +1,13 @@
1
+ require 'action_dispatch/middleware/public_exceptions'
2
+
3
+ module ErrMerchant
4
+ class ExceptionsApp
5
+ def call(env)
6
+ status = env["PATH_INFO"][1..-1]
7
+ ErrMerchant::ErrorsController.action(Rack::Utils::SYMBOL_TO_STATUS_CODE.invert[status.to_i]).call(env)
8
+ rescue
9
+ ActionDispatch::PublicExceptions.new(Rails.root.join('public')).call(env)
10
+ end
11
+
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module ErrMerchant
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -41,7 +41,7 @@ describe 'ErrMerchant' do
41
41
 
42
42
  page.should have_content("Seite nicht gefunden")
43
43
  end
44
-
44
+
45
45
  it 'shows english error message when no translation available' do
46
46
  I18n.locale = :fr
47
47
  visit '/failures/wild_error'
@@ -1,3 +1,3 @@
1
1
  test:
2
2
  adapter: sqlite3
3
- database: db/combustion_test.sqlite
3
+ database: db/combustion_test.sqlite
@@ -1,3 +0,0 @@
1
- ActiveRecord::Schema.define do
2
- #
3
- end