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 +9 -3
- data/lib/err_merchant/engine.rb +3 -3
- data/lib/err_merchant/exceptions_app.rb +13 -0
- data/lib/err_merchant/version.rb +1 -1
- data/spec/err_merchant_spec.rb +1 -1
- data/spec/internal/config/database.yml +1 -1
- data/spec/internal/db/combustion_test.sqlite +0 -0
- data/spec/internal/db/schema.rb +0 -3
- data/spec/internal/log/test.log +3433 -0
- data/spec/spec_helper.rb +1 -5
- metadata +18 -20
- data/lib/err_merchant/show_exceptions_patch.rb +0 -18
- data/spec/internal/config/initializers/local_request_override.rb +0 -5
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.
|
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
|
data/lib/err_merchant/engine.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'rails/engine'
|
2
|
-
require 'err_merchant/
|
2
|
+
require 'err_merchant/exceptions_app'
|
3
3
|
|
4
4
|
module ErrMerchant
|
5
5
|
class Engine < ::Rails::Engine
|
6
|
-
initializer "err_merchant.
|
7
|
-
|
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
|
data/lib/err_merchant/version.rb
CHANGED
data/spec/err_merchant_spec.rb
CHANGED
Binary file
|
data/spec/internal/db/schema.rb
CHANGED