exception_handler 0.7.5 → 0.8.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.coveralls.yml +1 -0
- data/.gitignore +51 -33
- data/.rspec +3 -4
- data/.slugignore +7 -0
- data/.travis.yml +13 -5
- data/Gemfile +16 -13
- data/README.md +643 -443
- data/Rakefile +7 -7
- data/app/assets/stylesheets/exception_handler.css.erb +23 -18
- data/app/assets/stylesheets/styles/_base.css.erb +28 -35
- data/app/assets/stylesheets/styles/_exception.css.erb +106 -105
- data/app/assets/stylesheets/styles/_footer.css.erb +24 -24
- data/app/assets/stylesheets/styles/_responsive.css +5 -5
- data/app/controllers/exception_handler/exceptions_controller.rb +66 -55
- data/app/mailers/exception_handler/exception_mailer.rb +17 -17
- data/app/models/exception_handler/exception.rb +200 -191
- data/app/views/exception_handler/exceptions/show.html.erb +3 -3
- data/app/views/exception_handler/mailers/layout.haml +8 -8
- data/app/views/exception_handler/mailers/layout.text.erb +1 -1
- data/app/views/exception_handler/mailers/new_exception.erb +4 -4
- data/app/views/layouts/exception.html.erb +32 -27
- data/app/views/layouts/mailer.html.erb +5 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/config/locales/exception_handler.en.yml +28 -29
- data/config/routes.rb +42 -0
- data/db/migrate/000000_create_errors.rb +34 -34
- data/exception_handler.gemspec +64 -80
- data/lib/exception_handler.rb +56 -45
- data/lib/exception_handler/config.rb +185 -103
- data/lib/exception_handler/engine.rb +78 -60
- data/lib/exception_handler/version.rb +25 -0
- data/lib/generators/exception_handler/views_generator.rb +33 -33
- data/spec/controllers/controller_spec.rb +107 -0
- data/spec/dummy/.rspec +1 -0
- data/spec/dummy/.ruby-version +1 -0
- data/spec/dummy/Rakefile +6 -6
- data/spec/dummy/app/assets/config/manifest.js +3 -4
- data/spec/dummy/app/assets/javascripts/application.js +15 -13
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -15
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -5
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -5
- data/spec/dummy/app/controllers/application_controller.rb +2 -5
- data/spec/dummy/app/helpers/application_helper.rb +2 -2
- data/spec/dummy/app/jobs/application_job.rb +2 -2
- data/spec/dummy/app/mailers/application_mailer.rb +4 -4
- data/spec/dummy/app/models/application_record.rb +3 -3
- data/spec/dummy/app/views/layouts/application.html.erb +15 -15
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -13
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -1
- data/spec/dummy/bin/bundle +3 -3
- data/spec/dummy/bin/rails +4 -4
- data/spec/dummy/bin/rake +4 -4
- data/spec/dummy/bin/setup +36 -34
- data/spec/dummy/bin/update +31 -29
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +5 -8
- data/spec/dummy/config/application.rb +18 -21
- data/spec/dummy/config/boot.rb +5 -5
- data/spec/dummy/config/cable.yml +10 -10
- data/spec/dummy/config/database.yml +25 -25
- data/spec/dummy/config/environment.rb +5 -5
- data/spec/dummy/config/environments/development.rb +61 -62
- data/spec/dummy/config/environments/production.rb +94 -87
- data/spec/dummy/config/environments/test.rb +46 -42
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -6
- data/spec/dummy/config/initializers/assets.rb +14 -11
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -7
- data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -5
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -4
- data/spec/dummy/config/initializers/inflections.rb +16 -16
- data/spec/dummy/config/initializers/mime_types.rb +4 -4
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -14
- data/spec/dummy/config/locales/en.yml +33 -23
- data/spec/dummy/config/puma.rb +34 -47
- data/spec/dummy/config/routes.rb +3 -6
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +67 -67
- data/spec/dummy/public/422.html +67 -67
- data/spec/dummy/public/500.html +66 -66
- data/spec/dummy/spec/rails_helper.rb +57 -0
- data/spec/dummy/spec/spec_helper.rb +100 -0
- data/spec/dummy/storage/.keep +0 -0
- data/spec/features/asset_spec.rb +61 -0
- data/spec/features/config_spec.rb +51 -0
- data/spec/features/engine_spec.rb +180 -0
- data/spec/mailers/mailer_spec.rb +26 -0
- data/spec/models/model_spec.rb +26 -0
- data/spec/routing/routing_spec.rb +85 -0
- data/spec/spec_helper.rb +101 -55
- data/spec/views/views_spec.rb +29 -0
- metadata +54 -28
- data/.gitattributes +0 -1
- data/LICENSE.txt +0 -22
- data/app/assets/images/exception_handler/bg.jpg +0 -0
- data/app/assets/images/exception_handler/bg_overlay.png +0 -0
- data/spec/database.yml +0 -3
- data/spec/dummy/app/assets/javascripts/cable.coffee +0 -11
- data/spec/dummy/config/initializers/active_record_belongs_to_required_by_default.rb +0 -6
- data/spec/dummy/config/initializers/callback_terminator.rb +0 -6
- data/spec/dummy/config/initializers/per_form_csrf_tokens.rb +0 -4
- data/spec/dummy/config/initializers/request_forgery_protection.rb +0 -4
- data/spec/dummy/config/initializers/session_store.rb +0 -3
- data/spec/dummy/config/secrets.yml +0 -22
- data/spec/exception_handler.rb +0 -22
- data/spec/exception_handler/exception_controller_spec.rb +0 -18
@@ -1 +1 @@
|
|
1
|
-
<%= yield %>
|
1
|
+
<%= yield %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h1><%= Rails.application.class.parent_name %> (<%= Rails.env.titleize %>)</h1>
|
2
|
-
|
3
|
-
<strong><u><%= @exception.response %> (<%= @exception.status %>)</u></strong>
|
4
|
-
<p><%= @exception.message %></p>
|
1
|
+
<h1><%= Rails.application.class.parent_name %> (<%= Rails.env.titleize %>)</h1>
|
2
|
+
|
3
|
+
<strong><u><%= @exception.response %> (<%= @exception.status %>)</u></strong>
|
4
|
+
<p><%= @exception.message %></p>
|
@@ -1,27 +1,32 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<!-- Head -->
|
4
|
-
<head>
|
5
|
-
<!-- Info -->
|
6
|
-
<%= content_tag :title, "Error - #{@exception.status} (#{@exception.response.to_s.gsub("_", " ").titleize})
|
7
|
-
|
8
|
-
<!-- Styling -->
|
9
|
-
<%= stylesheet_link_tag :exception_handler %>
|
10
|
-
<%= favicon_link_tag "exception_handler/favicon.ico" %>
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<!-- Head -->
|
4
|
+
<head>
|
5
|
+
<!-- Info -->
|
6
|
+
<%= content_tag :title, "Error - #{@exception.status} (#{@exception.response.to_s.gsub("_", " ").titleize})" %>
|
7
|
+
|
8
|
+
<!-- Styling -->
|
9
|
+
<%= stylesheet_link_tag :exception_handler %>
|
10
|
+
<%= favicon_link_tag "exception_handler/favicon.ico" %>
|
11
|
+
|
12
|
+
<% if x = ExceptionHandler.config.options(@exception.status) %>
|
13
|
+
<style>body { background: url("<%= asset_path x %>") center center no-repeat !important; background-size: cover !important; }</style>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<!-- Auth -->
|
17
|
+
<%= csrf_meta_tags %>
|
18
|
+
</head>
|
19
|
+
|
20
|
+
<!-- Body -->
|
21
|
+
<%= content_tag :body, yield %>
|
22
|
+
|
23
|
+
<!-- Footer -->
|
24
|
+
<% if ExceptionHandler.config.try(:social) %>
|
25
|
+
<%= content_tag :footer do %>
|
26
|
+
<% ExceptionHandler.config.social.each do |k,v| %>
|
27
|
+
<%= link_to image_tag("exception_handler/connect/#{k}.png"), ExceptionHandler::Config::SOCIAL[k] + "/" + v, id: k, title: "#{k.to_s.titleize} Feed", target: :blank if v %>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
30
|
+
<% end %>
|
31
|
+
|
32
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -1,29 +1,28 @@
|
|
1
|
-
#######################################################################################
|
2
|
-
#######################################################################################
|
3
|
-
## _____ _ _ _ _ _ _ ##
|
4
|
-
## | ___| | | (_) | | | | | | | ##
|
5
|
-
## | |____ _____ ___ _ __ | |_ _ ___ _ __ | |_| | __ _ _ __ __| | | ___ _ __ ##
|
6
|
-
## | __\ \/ / __/ _ \ '_ \| __| |/ _ \| '_ \ | _ |/ _` | '_ \ / _` | |/ _ \ '__| ##
|
7
|
-
## | |___> < (_| __/ |_) | |_| | (_) | | | | | | | | (_| | | | | (_| | | __/ | ##
|
8
|
-
## \____/_/\_\___\___| .__/ \__|_|\___/|_| |_| \_| |_/\__,_|_| |_|\__,_|_|\___|_| ##
|
9
|
-
## | | ##
|
10
|
-
## |_| ##
|
11
|
-
#######################################################################################
|
12
|
-
#######################################################################################
|
13
|
-
|
14
|
-
# Have to use strings rather than integers
|
15
|
-
# https://github.com/rack/rack/blob/1.5.2/lib/rack/utils.rb#L544
|
16
|
-
|
17
|
-
# By default, exceptions will show their "response" code (404 = "Not Found")
|
18
|
-
# If you want to create custom messages, you have to assign the values as [response]: "message"
|
19
|
-
|
20
|
-
#######################################################################################
|
21
|
-
#######################################################################################
|
22
|
-
|
23
|
-
en:
|
24
|
-
exception_handler:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
#######################################################################################
|
29
|
-
#######################################################################################
|
1
|
+
#######################################################################################
|
2
|
+
#######################################################################################
|
3
|
+
## _____ _ _ _ _ _ _ ##
|
4
|
+
## | ___| | | (_) | | | | | | | ##
|
5
|
+
## | |____ _____ ___ _ __ | |_ _ ___ _ __ | |_| | __ _ _ __ __| | | ___ _ __ ##
|
6
|
+
## | __\ \/ / __/ _ \ '_ \| __| |/ _ \| '_ \ | _ |/ _` | '_ \ / _` | |/ _ \ '__| ##
|
7
|
+
## | |___> < (_| __/ |_) | |_| | (_) | | | | | | | | (_| | | | | (_| | | __/ | ##
|
8
|
+
## \____/_/\_\___\___| .__/ \__|_|\___/|_| |_| \_| |_/\__,_|_| |_|\__,_|_|\___|_| ##
|
9
|
+
## | | ##
|
10
|
+
## |_| ##
|
11
|
+
#######################################################################################
|
12
|
+
#######################################################################################
|
13
|
+
|
14
|
+
# Have to use strings rather than integers
|
15
|
+
# https://github.com/rack/rack/blob/1.5.2/lib/rack/utils.rb#L544
|
16
|
+
|
17
|
+
# By default, exceptions will show their "response" code (404 = "Not Found")
|
18
|
+
# If you want to create custom messages, you have to assign the values as [response]: "message"
|
19
|
+
|
20
|
+
#######################################################################################
|
21
|
+
#######################################################################################
|
22
|
+
|
23
|
+
en:
|
24
|
+
exception_handler:
|
25
|
+
internal_server_error: "<strong>%{status} Error</strong> %{message}"
|
26
|
+
|
27
|
+
#######################################################################################
|
28
|
+
#######################################################################################
|
data/config/routes.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
########################################
|
2
|
+
########################################
|
3
|
+
## _____ _ ##
|
4
|
+
## | ___ \ | | ##
|
5
|
+
## | |_/ /___ _ _| |_ ___ ___ ##
|
6
|
+
## | // _ \| | | | __/ _ \/ __| ##
|
7
|
+
## | |\ \ (_) | |_| | || __/\__ \ ##
|
8
|
+
## \_| \_\___/ \__,_|\__\___||___/ ##
|
9
|
+
## ##
|
10
|
+
########################################
|
11
|
+
########################################
|
12
|
+
|
13
|
+
## Good resource
|
14
|
+
## https://gist.github.com/maxivak/5d428ade54828836e6b6#merge-engine-and-app-routes
|
15
|
+
|
16
|
+
########################################
|
17
|
+
########################################
|
18
|
+
|
19
|
+
## Routes ##
|
20
|
+
Rails.application.routes.draw do
|
21
|
+
|
22
|
+
########################################
|
23
|
+
########################################
|
24
|
+
|
25
|
+
# => ExceptionHandler
|
26
|
+
# => Used to provide error page examples in "dev" mode
|
27
|
+
if Object.const_defined?('ExceptionHandler') && ExceptionHandler.config.try(:dev)
|
28
|
+
|
29
|
+
# => Items
|
30
|
+
Rack::Utils::SYMBOL_TO_STATUS_CODE.select{ |key, value| value.to_s.match('\b(?:4[0-9]{2}|5[0-9]{2}|599)\b') }.each do |code, status|
|
31
|
+
get status.to_s, to: 'exception_handler/exceptions#show', as: code, code: code
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
########################################
|
37
|
+
########################################
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
########################################
|
42
|
+
########################################
|
@@ -1,34 +1,34 @@
|
|
1
|
-
class CreateErrors < ActiveRecord::Migration[5.0]
|
2
|
-
|
3
|
-
# => ATTRS
|
4
|
-
require_relative "../../app/models/exception_handler/exception.rb"
|
5
|
-
|
6
|
-
#########################################
|
7
|
-
#########################################
|
8
|
-
|
9
|
-
# => Defs
|
10
|
-
@@table = ExceptionHandler.config.try(:db)
|
11
|
-
|
12
|
-
#########################################
|
13
|
-
|
14
|
-
# Up
|
15
|
-
def up
|
16
|
-
create_table @@table do |t|
|
17
|
-
ExceptionHandler::ATTRS.each do |attr|
|
18
|
-
t.text attr
|
19
|
-
end
|
20
|
-
t.timestamps
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
#########################################
|
25
|
-
|
26
|
-
# Down
|
27
|
-
def down
|
28
|
-
drop_table @@table, if_exists: true
|
29
|
-
end
|
30
|
-
|
31
|
-
#########################################
|
32
|
-
#########################################
|
33
|
-
|
34
|
-
end
|
1
|
+
class CreateErrors < ActiveRecord::Migration[5.0]
|
2
|
+
|
3
|
+
# => ATTRS
|
4
|
+
require_relative "../../app/models/exception_handler/exception.rb"
|
5
|
+
|
6
|
+
#########################################
|
7
|
+
#########################################
|
8
|
+
|
9
|
+
# => Defs
|
10
|
+
@@table = ExceptionHandler.config.try(:db)
|
11
|
+
|
12
|
+
#########################################
|
13
|
+
|
14
|
+
# Up
|
15
|
+
def up
|
16
|
+
create_table @@table do |t|
|
17
|
+
ExceptionHandler::ATTRS.each do |attr|
|
18
|
+
t.text attr
|
19
|
+
end
|
20
|
+
t.timestamps
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
#########################################
|
25
|
+
|
26
|
+
# Down
|
27
|
+
def down
|
28
|
+
drop_table @@table, if_exists: true
|
29
|
+
end
|
30
|
+
|
31
|
+
#########################################
|
32
|
+
#########################################
|
33
|
+
|
34
|
+
end
|
data/exception_handler.gemspec
CHANGED
@@ -1,80 +1,64 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
s.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
s.
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
s.
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
s.add_dependency "responders"
|
66
|
-
|
67
|
-
# => Extras
|
68
|
-
s.add_development_dependency "autoprefixer-rails"
|
69
|
-
|
70
|
-
# => Dev
|
71
|
-
# => For testing etc
|
72
|
-
s.add_development_dependency "rake"
|
73
|
-
s.add_development_dependency "rspec"
|
74
|
-
s.add_development_dependency "rspec-rails"
|
75
|
-
s.add_development_dependency "sqlite3", ">= 1.3.10"
|
76
|
-
|
77
|
-
##############################################################
|
78
|
-
##############################################################
|
79
|
-
|
80
|
-
end
|
1
|
+
########################################################################################
|
2
|
+
########################################################################################
|
3
|
+
|
4
|
+
# => Version
|
5
|
+
require_relative 'lib/exception_handler/version'
|
6
|
+
|
7
|
+
##############################################################
|
8
|
+
##############################################################
|
9
|
+
|
10
|
+
## Specs ##
|
11
|
+
Gem::Specification.new do |s|
|
12
|
+
|
13
|
+
## General ##
|
14
|
+
s.name = "exception_handler"
|
15
|
+
s.authors = ["R.Peck"]
|
16
|
+
s.email = ["rpeck@fl.co.uk"]
|
17
|
+
s.version = ExceptionHandler::VERSION::STRING
|
18
|
+
s.platform = Gem::Platform::RUBY
|
19
|
+
|
20
|
+
## Details ##
|
21
|
+
s.summary = %q{Rails gem to show custom error pages in production. Also logs errors in db & sends notification emails}
|
22
|
+
s.description = %q{Rails gem to create custom error pages. Captures exceptions using "exception_app" callback, routing to "Exception" controller, rendering the view as required.}
|
23
|
+
s.post_install_message = %q{ExceptionHandler 0.8.0.0 → New "config" (config.exception_handler = {exceptions: {layout: 'x', notification: true, action: {redirect_to root_path} }} ). https://www.github.com/richpeck/exception_handler#config for more info. }
|
24
|
+
s.homepage = "https://github.com/richpeck/exception_handler"
|
25
|
+
|
26
|
+
## License ##
|
27
|
+
s.license = "MIT"
|
28
|
+
|
29
|
+
##############################################################
|
30
|
+
##############################################################
|
31
|
+
|
32
|
+
## Files ##
|
33
|
+
s.files = `git ls-files -z`.split("\x0")
|
34
|
+
s.files.reject! { |fn| fn.include? "readme" } #-> https://github.com/gauntlt/gauntlt/blob/master/gauntlt.gemspec#L16
|
35
|
+
|
36
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
37
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/}) unless RUBY_VERSION >= "2.2.0" #-> deprecated in Ruby 2.2.0
|
38
|
+
s.require_paths = ["lib"]
|
39
|
+
|
40
|
+
##############################################################
|
41
|
+
##############################################################
|
42
|
+
|
43
|
+
## Ruby ##
|
44
|
+
s.required_ruby_version = ">= 2.1.0"
|
45
|
+
|
46
|
+
## Runtime
|
47
|
+
s.add_dependency "bundler"
|
48
|
+
s.add_dependency "rails", ">= 4.2.0"
|
49
|
+
s.add_dependency "responders"
|
50
|
+
|
51
|
+
## Extras ##
|
52
|
+
s.add_development_dependency "autoprefixer-rails"
|
53
|
+
|
54
|
+
## Dev ##
|
55
|
+
s.add_development_dependency "rake"
|
56
|
+
s.add_development_dependency "rspec"
|
57
|
+
s.add_development_dependency "rspec-rails"
|
58
|
+
s.add_development_dependency "coveralls"
|
59
|
+
s.add_development_dependency "sqlite3", ">= 1.3.10"
|
60
|
+
|
61
|
+
##############################################################
|
62
|
+
##############################################################
|
63
|
+
|
64
|
+
end
|
data/lib/exception_handler.rb
CHANGED
@@ -1,45 +1,56 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
#########################################################
|
45
|
-
|
1
|
+
########################################################################################
|
2
|
+
########################################################################################
|
3
|
+
## _____ _ _ _ _ _ _ ##
|
4
|
+
## | ___| | | (_) | | | | | | | ##
|
5
|
+
## | |____ _____ ___ _ __ | |_ _ ___ _ __ | |_| | __ _ _ __ __| | | ___ _ __ ##
|
6
|
+
## | __\ \/ / __/ _ \ '_ \| __| |/ _ \| '_ \ | _ |/ _` | '_ \ / _` | |/ _ \ '__| ##
|
7
|
+
## | |___> < (_| __/ |_) | |_| | (_) | | | | | | | | (_| | | | | (_| | | __/ | ##
|
8
|
+
## \____/_/\_\___\___| .__/ \__|_|\___/|_| |_| \_| |_/\__,_|_| |_|\__,_|_|\___|_| ##
|
9
|
+
## | | ##
|
10
|
+
## |_| ##
|
11
|
+
########################################################################################
|
12
|
+
########################################################################################
|
13
|
+
|
14
|
+
module ExceptionHandler
|
15
|
+
|
16
|
+
##############################
|
17
|
+
##############################
|
18
|
+
|
19
|
+
# => Table Prefix
|
20
|
+
# => Keeps Rails Engine from generating all table prefixes with the engines name
|
21
|
+
# => http://stackoverflow.com/questions/19435214/rails-mountable-engine-with-isolate-namespace-but-without-prefixed-namespace-on
|
22
|
+
def self.table_name_prefix
|
23
|
+
# => No prefix
|
24
|
+
end
|
25
|
+
|
26
|
+
# => Config
|
27
|
+
# => Invoke instance of config (ExceptionHandler.config)
|
28
|
+
mattr_accessor :config
|
29
|
+
|
30
|
+
##############################
|
31
|
+
##############################
|
32
|
+
|
33
|
+
# => Exceptions
|
34
|
+
# => https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/errors.rb
|
35
|
+
class Error < StandardError; end
|
36
|
+
|
37
|
+
##############################
|
38
|
+
##############################
|
39
|
+
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
#########################################################
|
44
|
+
#########################################################
|
45
|
+
|
46
|
+
# => Libs
|
47
|
+
# => http://stackoverflow.com/a/4528011/1143732
|
48
|
+
# => http://stackoverflow.com/a/21693468/1143732
|
49
|
+
# => https://github.com/jekyll/jekyll/blob/master/lib/jekyll.rb#L8
|
50
|
+
Dir.glob(File.join(File.dirname(__FILE__), 'exception_handler', '**/*.rb'), &method(:require))
|
51
|
+
|
52
|
+
# => External Dependencies
|
53
|
+
require 'responders'
|
54
|
+
|
55
|
+
#########################################################
|
56
|
+
#########################################################
|