exception_handler 0.7.5 → 0.7.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.slugignore +7 -0
- data/README.md +1 -8
- data/app/controllers/exception_handler/exceptions_controller.rb +4 -0
- data/config/locales/exception_handler.en.yml +0 -1
- data/exception_handler.gemspec +2 -2
- metadata +8 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d0159ca0e6b4084616339284170c8a10e91ed30
|
|
4
|
+
data.tar.gz: 5857d0d29b10e4e6056d4cf6f67d57b1c5daaf11
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3de77586327b0612743fe04a39e853fca5f45f091587cdb24920036ebaced4ddf0227dadd0fa8cb4fe581d0b8a71cceb3d15e56c6c9e61c547d3cc93cbef4446
|
|
7
|
+
data.tar.gz: 5e9332a919cd968576a95c6ab4a15c0cb784510f4a6087431fb3568a2b10c46e046e96c8368f3b11c126f5c0f305e54005127de2edf8f9a262d352e55e93e3cf
|
data/.slugignore
ADDED
data/README.md
CHANGED
|
@@ -88,8 +88,6 @@ The secret lies in [**`config.exceptions_app`**][exception_app] ↴
|
|
|
88
88
|
|
|
89
89
|
Each time an exception is raised, [`ShowExceptions`][show_exception] takes the request and forwards it to `config.exceptions_app`. This is expected to return a response - allowing us to inject a [`controller`](app/controllers/exception_handler/exceptions_controller.rb):
|
|
90
90
|
|
|
91
|
-
> ```app.config.exceptions_app = ->(env) { ExceptionHandler::ExceptionsController.action(:show).call(env) }```
|
|
92
|
-
|
|
93
91
|
![config.exceptions_app - The key to all Rails exceptions][exceptions_app]
|
|
94
92
|
|
|
95
93
|
Because our callback maintains the request, we are able to do whatever we need before serving a response. This is a **major** advantage over the "default" (routes). The routes invokes Rails twice and does not persist the request.
|
|
@@ -130,7 +128,7 @@ Once invoked, its `model`, `controller` and `views` work together to serve the b
|
|
|
130
128
|
</p>
|
|
131
129
|
|
|
132
130
|
<p align="center">
|
|
133
|
-
<a href="#config"><img src="readme/titles/icons/config.png" alt="Cinfiguration Options" align="absmiddle" height="24" /> Config</a> <a href="#dev-mode" title="Dev Mode"><img src="readme/titles/icons/dev.png" alt="Dev" align="absmiddle" height="24" /> Dev</a> <a href="#database"><img src="readme/titles/icons/database.png" alt="Database" align="absmiddle" height="24" /> Database</a> <a href="#email"><img src="readme/titles/icons/email.png" alt="Email" align="absmiddle" height="24" /> Email</a> <a href="#views"><img src="readme/titles/icons/views.png" alt="Views" align="absmiddle" height="24" /> Views</a> <a href="#locales"><img src="readme/titles/icons/locales.png" alt="Locales" align="absmiddle" height="
|
|
131
|
+
<a href="#config"><img src="readme/titles/icons/config.png" alt="Cinfiguration Options" align="absmiddle" height="24" /> Config</a> <a href="#dev-mode" title="Dev Mode"><img src="readme/titles/icons/dev.png" alt="Dev" align="absmiddle" height="24" /> Dev</a> <a href="#database"><img src="readme/titles/icons/database.png" alt="Database" align="absmiddle" height="24" /> Database</a> <a href="#email"><img src="readme/titles/icons/email.png" alt="Email" align="absmiddle" height="24" /> Email</a> <a href="#views"><img src="readme/titles/icons/views.png" alt="Views" align="absmiddle" height="24" /> Views</a> <a href="#locales"><img src="readme/titles/icons/locales.png" alt="Locales" align="absmiddle" height="20" /> Locales</a> <a href="#custom-exceptions"><img src="readme/titles/icons/custom.png" alt="Custom Exceptions" align="absmiddle" height="18" /> Custom Exceptions</a> <a href="#generators"><img src="readme/titles/icons/generators.png" alt="Generators" align="absmiddle" height="24" /> Generators</a>
|
|
134
132
|
</p>
|
|
135
133
|
|
|
136
134
|
----
|
|
@@ -171,17 +169,12 @@ You only need to provide the inputs you want, for example:
|
|
|
171
169
|
|
|
172
170
|
**To enable `ExceptionHandler` in dev, enable the [`dev`](lib/exception_handler/config.rb#L38) option:**
|
|
173
171
|
|
|
174
|
-
# config/application.rb
|
|
175
|
-
config.exception_handler = { dev: true }
|
|
176
|
-
|
|
177
172
|
![Dev][dev_mode]
|
|
178
173
|
|
|
179
174
|
This disables [`config.consider_all_requests_local`](http://guides.rubyonrails.org/configuring.html#rails-general-configuration), making Rails behave as it would in production:
|
|
180
175
|
|
|
181
176
|
![Dev][dev_img]
|
|
182
177
|
|
|
183
|
-
This should be used temporarily.
|
|
184
|
-
|
|
185
178
|
----
|
|
186
179
|
|
|
187
180
|
## Database
|
|
@@ -8,6 +8,10 @@ module ExceptionHandler
|
|
|
8
8
|
# => CSRF
|
|
9
9
|
protect_from_forgery
|
|
10
10
|
|
|
11
|
+
# => Devise
|
|
12
|
+
# => http://stackoverflow.com/a/38531245/1143732
|
|
13
|
+
skip_before_action :authenticate_user!, raise: false
|
|
14
|
+
|
|
11
15
|
##################################
|
|
12
16
|
##################################
|
|
13
17
|
|
data/exception_handler.gemspec
CHANGED
|
@@ -12,7 +12,7 @@ module ExceptionHandler
|
|
|
12
12
|
MAJOR = 0
|
|
13
13
|
MINOR = 7
|
|
14
14
|
TINY = 5
|
|
15
|
-
PRE =
|
|
15
|
+
PRE = 15 # "alpha"
|
|
16
16
|
|
|
17
17
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
|
18
18
|
end
|
|
@@ -60,7 +60,7 @@ Gem::Specification.new do |s|
|
|
|
60
60
|
s.required_ruby_version = ">= 2.1.0"
|
|
61
61
|
|
|
62
62
|
# => Runtime
|
|
63
|
-
s.add_dependency "bundler"
|
|
63
|
+
s.add_dependency "bundler"
|
|
64
64
|
s.add_dependency "rails", ">= 4.2.0"
|
|
65
65
|
s.add_dependency "responders"
|
|
66
66
|
|
metadata
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: exception_handler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.5
|
|
4
|
+
version: 0.7.5.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Richard Peck
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-02-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '0'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - "
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rails
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -133,6 +133,7 @@ files:
|
|
|
133
133
|
- ".gitattributes"
|
|
134
134
|
- ".gitignore"
|
|
135
135
|
- ".rspec"
|
|
136
|
+
- ".slugignore"
|
|
136
137
|
- ".travis.yml"
|
|
137
138
|
- Gemfile
|
|
138
139
|
- LICENSE.txt
|
|
@@ -253,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
253
254
|
version: '0'
|
|
254
255
|
requirements: []
|
|
255
256
|
rubyforge_project:
|
|
256
|
-
rubygems_version: 2.6.
|
|
257
|
+
rubygems_version: 2.6.10
|
|
257
258
|
signing_key:
|
|
258
259
|
specification_version: 4
|
|
259
260
|
summary: Rails gem to show custom error pages in production. Also logs errors in db
|