├── .gitignore
├── .travis.yml
├── Gemfile
├── Gemfile.lock
├── HISTORY
├── LICENCE
├── README.markdown
├── Rakefile
├── VERSION
├── app
├── controllers
│ └── error_response_controller.rb
├── mailers
│ └── rails_exception_handler
│ │ └── error_mailer.rb
├── models
│ └── rails_exception_handler
│ │ ├── active_record
│ │ └── error_message.rb
│ │ └── mongoid
│ │ └── error_message.rb
└── views
│ └── rails_exception_handler
│ └── error_mailer
│ ├── send_error_mail_to_admin.html.erb
│ └── send_error_mail_to_admin.text.erb
├── lib
├── generators
│ └── rails_exception_handler
│ │ ├── install_generator.rb
│ │ └── templates
│ │ └── rails_exception_handler.rb
├── patch
│ └── show_exceptions.rb
├── rails_exception_handler.rb
└── rails_exception_handler
│ ├── catcher.rb
│ ├── configuration.rb
│ ├── engine.rb
│ ├── fake_session.rb
│ ├── handler.rb
│ ├── parser.rb
│ └── storage.rb
├── rails_exception_handler.gemspec
└── spec
├── db
├── migrate
│ ├── 20110630174538_create_error_messages.rb
│ └── 20110702131654_add_sessions_table.rb
└── schema.rb
├── dummy_30
├── .gitignore
├── Rakefile
├── app
│ ├── controllers
│ │ ├── application_controller.rb
│ │ └── home_controller.rb
│ ├── helpers
│ │ └── application_helper.rb
│ ├── mailers
│ │ └── application_mailer.rb
│ ├── models
│ │ └── stored_exception.rb
│ └── views
│ │ ├── home
│ │ └── view_error.html.erb
│ │ └── layouts
│ │ ├── application.html.erb
│ │ ├── custom.html.erb
│ │ └── fallback.html.erb
├── config.ru
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── database.yml
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── examples
│ │ └── travis_db.yml
│ ├── locales
│ │ └── en.yml
│ ├── mongoid.yml
│ └── routes.rb
├── lib
│ └── tasks
│ │ └── .gitkeep
├── public
│ └── .gitkeep
└── script
│ ├── rails
│ └── setup
├── dummy_32
├── .gitignore
├── Rakefile
├── app
│ ├── assets
│ │ ├── images
│ │ │ └── rails.png
│ │ ├── javascripts
│ │ │ └── application.js
│ │ └── stylesheets
│ │ │ └── application.css
│ ├── controllers
│ │ ├── application_controller.rb
│ │ └── home_controller.rb
│ ├── helpers
│ │ └── application_helper.rb
│ ├── mailers
│ │ ├── .gitkeep
│ │ └── application_mailer.rb
│ ├── models
│ │ ├── .gitkeep
│ │ └── stored_exception.rb
│ └── views
│ │ ├── home
│ │ └── view_error.html.erb
│ │ └── layouts
│ │ ├── application.html.erb
│ │ ├── custom.html.erb
│ │ └── fallback.html.erb
├── config.ru
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── database.yml
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── examples
│ │ └── travis_db.yml
│ ├── locales
│ │ └── en.yml
│ ├── mongoid.yml
│ └── routes.rb
├── log
│ └── .gitkeep
├── public
│ └── .gitkeep
└── script
│ ├── rails
│ └── setup
├── dummy_40
├── .gitignore
├── Rakefile
├── app
│ ├── assets
│ │ ├── images
│ │ │ └── .keep
│ │ ├── javascripts
│ │ │ └── application.js
│ │ └── stylesheets
│ │ │ └── application.css
│ ├── controllers
│ │ ├── application_controller.rb
│ │ └── home_controller.rb
│ ├── helpers
│ │ └── application_helper.rb
│ ├── mailers
│ │ ├── .keep
│ │ └── application_mailer.rb
│ ├── models
│ │ ├── .keep
│ │ └── stored_exception.rb
│ └── views
│ │ ├── home
│ │ └── view_error.html.erb
│ │ └── layouts
│ │ ├── application.html.erb
│ │ ├── custom.html.erb
│ │ └── fallback.html.erb
├── bin
│ ├── bundle
│ ├── rails
│ └── rake
├── config.ru
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── database.yml
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── initializers
│ │ ├── backtrace_silencers.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ ├── mime_types.rb
│ │ ├── secret_token.rb
│ │ ├── session_store.rb
│ │ └── wrap_parameters.rb
│ ├── locales
│ │ └── en.yml
│ ├── mongoid.yml
│ └── routes.rb
├── lib
│ ├── assets
│ │ └── .keep
│ └── tasks
│ │ └── .keep
├── log
│ └── .keep
└── public
│ └── .gitkeep
├── dummy_42
├── .gitignore
├── Rakefile
├── app
│ ├── assets
│ │ ├── images
│ │ │ └── .keep
│ │ ├── javascripts
│ │ │ └── application.js
│ │ └── stylesheets
│ │ │ └── application.css
│ ├── controllers
│ │ ├── application_controller.rb
│ │ └── home_controller.rb
│ ├── helpers
│ │ └── application_helper.rb
│ ├── mailers
│ │ ├── .keep
│ │ └── application_mailer.rb
│ ├── models
│ │ ├── .keep
│ │ └── stored_exception.rb
│ └── views
│ │ ├── home
│ │ └── view_error.html.erb
│ │ └── layouts
│ │ ├── application.html.erb
│ │ ├── custom.html.erb
│ │ └── fallback.html.erb
├── bin
│ ├── bundle
│ ├── rails
│ ├── rake
│ └── setup
├── config.ru
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── database.yml
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── initializers
│ │ ├── assets.rb
│ │ ├── backtrace_silencers.rb
│ │ ├── cookies_serializer.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ ├── mime_types.rb
│ │ ├── session_store.rb
│ │ └── wrap_parameters.rb
│ ├── locales
│ │ └── en.yml
│ ├── mongoid.yml
│ ├── routes.rb
│ └── secrets.yml
├── lib
│ ├── assets
│ │ └── .keep
│ └── tasks
│ │ └── .keep
├── log
│ └── .keep
└── public
│ └── .gitkeep
├── dummy_51
├── .gitignore
├── .ruby-version
├── Rakefile
├── app
│ ├── assets
│ │ ├── config
│ │ │ └── manifest.js
│ │ ├── images
│ │ │ └── .keep
│ │ ├── javascripts
│ │ │ ├── application.js
│ │ │ ├── cable.js
│ │ │ └── channels
│ │ │ │ └── .keep
│ │ └── stylesheets
│ │ │ └── application.css
│ ├── channels
│ │ └── application_cable
│ │ │ ├── channel.rb
│ │ │ └── connection.rb
│ ├── controllers
│ │ ├── application_controller.rb
│ │ ├── concerns
│ │ │ └── .keep
│ │ └── home_controller.rb
│ ├── helpers
│ │ └── application_helper.rb
│ ├── jobs
│ │ └── application_job.rb
│ ├── mailers
│ │ └── application_mailer.rb
│ ├── models
│ │ ├── application_record.rb
│ │ ├── concerns
│ │ │ └── .keep
│ │ └── stored_exception.rb
│ └── views
│ │ ├── home
│ │ └── view_error.html.erb
│ │ └── layouts
│ │ ├── application.html.erb
│ │ ├── custom.html.erb
│ │ ├── fallback.html.erb
│ │ ├── mailer.html.erb
│ │ └── mailer.text.erb
├── bin
│ ├── bundle
│ ├── rails
│ ├── rake
│ ├── setup
│ ├── spring
│ ├── update
│ └── yarn
├── config.ru
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── cable.yml
│ ├── database.yml
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── initializers
│ │ ├── application_controller_renderer.rb
│ │ ├── assets.rb
│ │ ├── backtrace_silencers.rb
│ │ ├── cookies_serializer.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ ├── mime_types.rb
│ │ └── wrap_parameters.rb
│ ├── locales
│ │ └── en.yml
│ ├── mongoid.yml
│ ├── puma.rb
│ ├── routes.rb
│ ├── secrets.yml
│ └── spring.rb
├── lib
│ ├── assets
│ │ └── .keep
│ └── tasks
│ │ └── .keep
├── log
│ └── .keep
├── package.json
├── public
│ ├── apple-touch-icon-precomposed.png
│ ├── apple-touch-icon.png
│ ├── favicon.ico
│ └── robots.txt
└── tmp
│ └── .keep
├── dummy_60
├── .gitignore
├── .ruby-version
├── README.md
├── Rakefile
├── app
│ ├── assets
│ │ ├── config
│ │ │ └── manifest.js
│ │ ├── images
│ │ │ └── .keep
│ │ └── stylesheets
│ │ │ └── application.css
│ ├── channels
│ │ └── application_cable
│ │ │ ├── channel.rb
│ │ │ └── connection.rb
│ ├── controllers
│ │ ├── application_controller.rb
│ │ ├── concerns
│ │ │ └── .keep
│ │ └── home_controller.rb
│ ├── helpers
│ │ └── application_helper.rb
│ ├── javascript
│ │ ├── channels
│ │ │ ├── consumer.js
│ │ │ └── index.js
│ │ └── packs
│ │ │ └── application.js
│ ├── jobs
│ │ └── application_job.rb
│ ├── mailers
│ │ └── application_mailer.rb
│ ├── models
│ │ ├── application_record.rb
│ │ ├── concerns
│ │ │ └── .keep
│ │ └── stored_exception.rb
│ └── views
│ │ ├── home
│ │ └── view_error.html.erb
│ │ └── layouts
│ │ ├── application.html.erb
│ │ ├── custom.html.erb
│ │ ├── fallback.html.erb
│ │ ├── mailer.html.erb
│ │ └── mailer.text.erb
├── bin
│ ├── bundle
│ ├── rails
│ ├── rake
│ ├── setup
│ ├── spring
│ └── yarn
├── config.ru
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── cable.yml
│ ├── credentials.yml.enc
│ ├── database.yml
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── initializers
│ │ ├── application_controller_renderer.rb
│ │ ├── assets.rb
│ │ ├── backtrace_silencers.rb
│ │ ├── content_security_policy.rb
│ │ ├── cookies_serializer.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ ├── mime_types.rb
│ │ └── wrap_parameters.rb
│ ├── locales
│ │ └── en.yml
│ ├── mongoid.yml
│ ├── puma.rb
│ ├── routes.rb
│ ├── spring.rb
│ └── storage.yml
├── lib
│ ├── assets
│ │ └── .keep
│ └── tasks
│ │ └── .keep
├── log
│ └── .keep
├── public
│ ├── 422.html
│ ├── apple-touch-icon-precomposed.png
│ ├── apple-touch-icon.png
│ ├── favicon.ico
│ └── robots.txt
└── tmp
│ └── .keep
├── dummy_70
├── .gitattributes
├── .gitignore
├── .ruby-version
├── Rakefile
├── app
│ ├── assets
│ │ ├── config
│ │ │ └── manifest.js
│ │ ├── images
│ │ │ └── .keep
│ │ └── stylesheets
│ │ │ └── application.css
│ ├── channels
│ │ └── application_cable
│ │ │ ├── channel.rb
│ │ │ └── connection.rb
│ ├── controllers
│ │ ├── application_controller.rb
│ │ ├── concerns
│ │ │ └── .keep
│ │ └── home_controller.rb
│ ├── helpers
│ │ └── application_helper.rb
│ ├── jobs
│ │ └── application_job.rb
│ ├── mailers
│ │ └── application_mailer.rb
│ ├── models
│ │ ├── application_record.rb
│ │ ├── concerns
│ │ │ └── .keep
│ │ └── stored_exception.rb
│ └── views
│ │ ├── home
│ │ └── view_error.html.erb
│ │ └── layouts
│ │ ├── application.html.erb
│ │ ├── custom.html.erb
│ │ ├── fallback.html.erb
│ │ ├── mailer.html.erb
│ │ └── mailer.text.erb
├── bin
│ ├── bundle
│ ├── rails
│ ├── rake
│ └── setup
├── config.ru
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── cable.yml
│ ├── credentials.yml.enc
│ ├── database.yml
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── initializers
│ │ ├── assets.rb
│ │ ├── content_security_policy.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ └── permissions_policy.rb
│ ├── locales
│ │ └── en.yml
│ ├── puma.rb
│ ├── routes.rb
│ └── storage.yml
├── lib
│ ├── assets
│ │ └── .keep
│ └── tasks
│ │ └── .keep
├── log
│ └── .keep
├── public
│ ├── 422.html
│ ├── apple-touch-icon-precomposed.png
│ ├── apple-touch-icon.png
│ ├── favicon.ico
│ └── robots.txt
└── tmp
│ ├── .keep
│ ├── pids
│ └── .keep
│ └── storage
│ └── .keep
├── dummy_71
├── .dockerignore
├── Rakefile
├── app
│ ├── assets
│ │ ├── config
│ │ │ └── manifest.js
│ │ ├── images
│ │ │ └── .keep
│ │ └── stylesheets
│ │ │ └── application.css
│ ├── channels
│ │ └── application_cable
│ │ │ ├── channel.rb
│ │ │ └── connection.rb
│ ├── controllers
│ │ ├── application_controller.rb
│ │ ├── concerns
│ │ │ └── .keep
│ │ └── home_controller.rb
│ ├── helpers
│ │ └── application_helper.rb
│ ├── jobs
│ │ └── application_job.rb
│ ├── mailers
│ │ └── application_mailer.rb
│ ├── models
│ │ ├── application_record.rb
│ │ ├── concerns
│ │ │ └── .keep
│ │ └── stored_exception.rb
│ └── views
│ │ ├── home
│ │ └── view_error.html.erb
│ │ └── layouts
│ │ ├── application.html.erb
│ │ ├── custom.html.erb
│ │ ├── fallback.html.erb
│ │ ├── mailer.html.erb
│ │ └── mailer.text.erb
├── bin
│ ├── docker-entrypoint
│ ├── rails
│ ├── rake
│ └── setup
├── config.ru
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── cable.yml
│ ├── credentials.yml.enc
│ ├── database.yml
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── initializers
│ │ ├── assets.rb
│ │ ├── content_security_policy.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ └── permissions_policy.rb
│ ├── locales
│ │ └── en.yml
│ ├── master.key
│ ├── puma.rb
│ ├── routes.rb
│ └── storage.yml
├── lib
│ ├── assets
│ │ └── .keep
│ └── tasks
│ │ └── .keep
├── log
│ ├── .keep
│ └── test.log
├── public
│ ├── 422.html
│ ├── apple-touch-icon-precomposed.png
│ ├── apple-touch-icon.png
│ ├── favicon.ico
│ └── robots.txt
└── tmp
│ ├── .keep
│ ├── local_secret.txt
│ ├── pids
│ └── .keep
│ └── storage
│ └── .keep
├── dummy_80
├── Rakefile
├── app
│ ├── assets
│ │ ├── config
│ │ │ └── manifest.js
│ │ ├── images
│ │ │ └── .keep
│ │ └── stylesheets
│ │ │ └── application.css
│ ├── controllers
│ │ ├── application_controller.rb
│ │ ├── concerns
│ │ │ └── .keep
│ │ └── home_controller.rb
│ ├── helpers
│ │ └── application_helper.rb
│ ├── jobs
│ │ └── application_job.rb
│ ├── mailers
│ │ └── application_mailer.rb
│ ├── models
│ │ ├── application_record.rb
│ │ ├── concerns
│ │ │ └── .keep
│ │ └── stored_exception.rb
│ └── views
│ │ ├── home
│ │ └── view_error.html.erb
│ │ └── layouts
│ │ ├── application.html.erb
│ │ ├── custom.html.erb
│ │ ├── fallback.html.erb
│ │ ├── mailer.html.erb
│ │ └── mailer.text.erb
├── bin
│ ├── brakeman
│ ├── dev
│ ├── docker-entrypoint
│ ├── rails
│ ├── rake
│ ├── rubocop
│ ├── setup
│ └── thrust
├── config.ru
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── cable.yml
│ ├── credentials.yml.enc
│ ├── database.yml
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── initializers
│ │ ├── assets.rb
│ │ ├── content_security_policy.rb
│ │ ├── filter_parameter_logging.rb
│ │ └── inflections.rb
│ ├── locales
│ │ └── en.yml
│ ├── master.key
│ ├── puma.rb
│ ├── routes.rb
│ └── storage.yml
├── lib
│ └── tasks
│ │ └── .keep
├── log
│ ├── .keep
│ └── test.log
├── public
│ ├── icon.png
│ ├── icon.svg
│ └── robots.txt
└── tmp
│ ├── .keep
│ ├── local_secret.txt
│ ├── pids
│ └── .keep
│ └── storage
│ └── .keep
├── integration
├── configuration_spec.rb
├── rails_exception_handler_spec.rb
└── storage_spec.rb
├── spec_helper.rb
├── test_macros.rb
└── unit
├── catcher_spec.rb
├── configuration_spec.rb
├── handler_spec.rb
└── parser_spec.rb
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | *~
3 | *.swp
4 | pkg/
5 | spec/db/test.sqlite3*
6 | TODO
7 | .ruby-version
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 |
2 | before_script:
3 | - ./spec/dummy_32/script/setup
4 |
5 | notifications:
6 | disable: true
7 |
8 | language: ruby
9 |
10 | rvm:
11 | - 1.9.3
12 | - 2.1.10
13 | - 2.2.7
14 | - 2.3.4
15 | - 2.4.1
16 | - ree
17 | #- ruby-head
18 |
19 | gemfile:
20 | - gemfiles/rails30.gemfile
21 | - gemfiles/rails32.gemfile
22 | - gemfiles/rails40.gemfile
23 | - gemfiles/rails42.gemfile
24 | - gemfiles/rails51.gemfile
25 |
26 | matrix:
27 | include:
28 | - rvm: ree
29 | gemfile: gemfiles/rails32.187-ree.gemfile
30 | exclude:
31 | - rvm: ree
32 | gemfile: gemfiles/rails32.gemfile
33 | allow_failures:
34 | - rvm: ree
35 | gemfile: gemfiles/rails40.gemfile
36 |
37 | services:
38 | - mongodb
39 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "http://rubygems.org"
2 | ruby File.read(".ruby-version").strip
3 |
4 | group :test, :development do
5 |
6 | #gem "rails", '3.0.20'
7 | #gem "rack-test", '0.5.7'
8 | #gem 'sqlite3','1.3.13'
9 | #gem 'bson_ext'
10 | #gem 'nokogiri', '1.6.8.1'
11 |
12 | #gem "rails", '3.2.22.5'
13 | #gem "rack-test", '0.6.2'
14 | #gem 'sqlite3','1.3.13'
15 | #gem 'nokogiri', '1.6.8.1'
16 | #gem 'test-unit', '~> 3.0'
17 |
18 | #gem "rails", '4.0.13'
19 | #gem "rack-test", '0.6.3'
20 | #gem 'sqlite3','1.3.13'
21 |
22 | #gem "rails", '4.2.11.3'
23 | #gem "rack-test", '1.1.0'
24 | #gem "sqlite3", "~> 1.4"
25 |
26 | #gem "rails", '5.2.7.1'
27 | #gem "rack-test", '1.1.0'
28 | #gem "sqlite3", "~> 1.4"
29 |
30 | #gem "rails", '6.1.7.6'
31 | #gem "rack-test", '1.1.0'
32 | #gem "sqlite3", "~> 1.4"
33 |
34 | #gem "rails", '7.0.8'
35 | #gem "sprockets-rails"
36 | #gem "rack-test", '1.1.0'
37 | #gem "sqlite3", "~> 1.4"
38 |
39 | # gem "rails", '7.2.2'
40 | # gem "sprockets-rails"
41 | # gem "rack-test", '1.1.0'
42 | # gem "sqlite3", "~> 1.4"
43 |
44 | gem "rails", '8.0.0'
45 | gem "sprockets-rails"
46 | gem "rack-test", '1.1.0'
47 | gem "sqlite3", "~> 2.0"
48 |
49 |
50 | gem "juwelier", git: "git@github.com:flajann2/juwelier.git"
51 | #gem 'mongoid'
52 | gem 'pry'
53 | gem "rspec-rails", "6.0.3"
54 | gem "rails_exception_handler", :path => '.'
55 | end
56 |
--------------------------------------------------------------------------------
/LICENCE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Bjørn Trondsen
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # encoding: utf-8
2 | require 'rubygems'
3 | require 'rake'
4 | require 'juwelier'
5 |
6 | task :default => :test
7 |
8 | desc 'Run tests'
9 | task :test do
10 | files = ["spec/unit/handler_spec.rb",
11 | "spec/unit/parser_spec.rb",
12 | "spec/unit/configuration_spec.rb",
13 | "spec/integration/rails_exception_handler_spec.rb",
14 | "spec/integration/configuration_spec.rb"
15 | ]
16 | system "bundle exec rspec spec"
17 | end
18 |
19 | Juwelier::Tasks.new do |gem|
20 | # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
21 | gem.name = "rails_exception_handler"
22 | gem.homepage = "https://github.com/bjorntrondsen/rails_exception_handler"
23 | gem.license = "MIT"
24 | gem.summary = %Q{Highly customizable exception handling for Ruby on Rails}
25 | gem.description = %Q{}
26 | gem.email = ""
27 | gem.authors = ["btrondsen"]
28 | gem.extra_rdoc_files = ['README.markdown']
29 | gem.require_paths = ["lib"]
30 | gem.files.exclude 'spec/**/*'
31 |
32 | # dependencies defined in Gemfile
33 | end
34 | Juwelier::RubygemsDotOrgTasks.new
35 |
--------------------------------------------------------------------------------
/VERSION:
--------------------------------------------------------------------------------
1 | 2.4.10
--------------------------------------------------------------------------------
/app/controllers/error_response_controller.rb:
--------------------------------------------------------------------------------
1 | if(RailsExceptionHandler.configuration.activate?)
2 | class ErrorResponseController < ApplicationController
3 |
4 | if Rails::VERSION::MAJOR > 3
5 | skip_before_action :verify_authenticity_token
6 | else
7 | skip_before_filter :verify_authenticity_token
8 | end
9 |
10 |
11 | def index
12 | if Rails::VERSION::MAJOR > 4
13 | render(:html => request.env['exception_handler.response'].html_safe, :layout => request.env['exception_handler.layout'])
14 | else
15 | render(:text => @_env['exception_handler.response'], :layout => @_env['exception_handler.layout'])
16 | end
17 | end
18 |
19 | def dummy_action
20 | if Rails::VERSION::MAJOR > 4
21 | render :body => nil
22 | else
23 | render :nothing => true
24 | end
25 | end
26 | end
27 | end
28 |
--------------------------------------------------------------------------------
/app/mailers/rails_exception_handler/error_mailer.rb:
--------------------------------------------------------------------------------
1 | class RailsExceptionHandler::ErrorMailer < ApplicationMailer
2 | if RailsExceptionHandler.configuration.activate? && RailsExceptionHandler.configuration.email?
3 |
4 | # Subject can be set in your I18n file at config/locales/en.yml
5 | # with the following lookup:
6 | #
7 | # en.error_mailer.send_error_mail_to_admin.subject
8 | #
9 | def send_error_mail_to_admin(info,email)
10 | @info = JSON.parse(info)
11 | mail(to: email, subject: 'An error occured on your application')
12 | end
13 |
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/models/rails_exception_handler/active_record/error_message.rb:
--------------------------------------------------------------------------------
1 | class RailsExceptionHandler::ActiveRecord
2 |
3 | class ErrorMessage < defined?(ActiveRecord) ? ActiveRecord::Base : Object
4 | if (defined?(ActiveRecord) && RailsExceptionHandler.configuration.activate? && RailsExceptionHandler.configuration.active_record?)
5 | establish_connection(RailsExceptionHandler.configuration.active_record_store_in[:database].to_sym)
6 | self.table_name = RailsExceptionHandler.configuration.active_record_store_in[:record_table]
7 | end
8 | end
9 |
10 | end
11 |
--------------------------------------------------------------------------------
/app/models/rails_exception_handler/mongoid/error_message.rb:
--------------------------------------------------------------------------------
1 | class RailsExceptionHandler::Mongoid
2 | class ErrorMessage
3 | #if(defined?(Mongoid) && RailsExceptionHandler.configuration.activate? && RailsExceptionHandler.configuration.mongoid?)
4 | if defined?(Mongoid)
5 | include Mongoid::Document
6 | include Mongoid::Timestamps
7 | include Mongoid::Attributes::Dynamic if defined?(Mongoid::Attributes::Dynamic)
8 |
9 | store_in({:database => :exception_database, :collection => :error_message}.merge(RailsExceptionHandler.configuration.mongoid_store_in || {}))
10 |
11 | field :class_name, :type => String
12 | field :message, :type => String
13 | field :trace, :type => String
14 | field :target_url, :type => String
15 | field :referer_url, :type => String
16 | field :user_agent, :type => String
17 | field :user_info, :type => String
18 | field :app_name, :type => String
19 | field :doc_root, :type => String
20 | # Wish this could be a Hash, but since the legacy code expects that Hash.inspect is done (and they are parameters sent by the client)
21 | # it is not safe to eval it to transform it back into a Hash. Also, if config.store_request_info block did not perform inspect,
22 | # it could not be used by both Mongoid and any other storage strategy since those storage strategies would be responsible for
23 | # ensuring inspect were called. Possibly in a future major release this can be switched, though not sure if any benefit will
24 | # actually be gained from changing the type.
25 | field :params, :type => String
26 | end
27 | end
28 |
29 | end
30 |
--------------------------------------------------------------------------------
/app/views/rails_exception_handler/error_mailer/send_error_mail_to_admin.html.erb:
--------------------------------------------------------------------------------
1 |
2 | Hi boss,
3 |
4 |
5 | an error occured at <%= @info["created_at"] %>
6 |
7 |
8 | <% @info.each do |key, value| %>
9 | <% next if value.blank? %>
10 |
11 | <%= key.upcase %>
12 | <%= value %>
13 |
14 |
15 | <% end %>
16 |
--------------------------------------------------------------------------------
/app/views/rails_exception_handler/error_mailer/send_error_mail_to_admin.text.erb:
--------------------------------------------------------------------------------
1 | Hi boss,
2 | an error occured at <%= @info["created_at"] %>
3 |
4 | <% @info.each do |key, value| %>
5 | <% next if value.blank? %>
6 | <%= key.upcase %>
7 | <%= value %>
8 | <% end %>
9 |
--------------------------------------------------------------------------------
/lib/generators/rails_exception_handler/install_generator.rb:
--------------------------------------------------------------------------------
1 | class RailsExceptionHandler
2 | class InstallGenerator < Rails::Generators::Base
3 | desc "Copy initialization file"
4 | source_root File.expand_path('../templates', __FILE__)
5 | class_option :template_engine
6 |
7 | def copy_initializer
8 | copy_file 'rails_exception_handler.rb', 'config/initializers/rails_exception_handler.rb'
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/lib/patch/show_exceptions.rb:
--------------------------------------------------------------------------------
1 | # This patch enables the exception handler to catch routing errors
2 | module ActionDispatch
3 | class ShowExceptions
4 | private
5 | def render_exception_with_template(env, exception)
6 | env = env.env if env.is_a?(ActionDispatch::Request) # Rails 5 passes in the whole request object
7 | if(RailsExceptionHandler.configuration.activate?)
8 | RailsExceptionHandler::Handler.new(env, exception).handle_exception
9 | else
10 | raise exception
11 | end
12 | end
13 | alias_method :render_exception, :render_exception_with_template
14 | alias_method :template, :render_exception
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/lib/rails_exception_handler.rb:
--------------------------------------------------------------------------------
1 | class RailsExceptionHandler
2 |
3 | def initialize(app)
4 | @app = app
5 | end
6 |
7 | def call(env)
8 | @app.call(env)
9 | rescue Exception => e
10 | raise e unless RailsExceptionHandler.configuration.activate?
11 | Handler.new(env, e).handle_exception
12 | end
13 |
14 | def self.configuration
15 | @configuration ||= Configuration.new
16 | end
17 |
18 | def self.configure
19 | yield configuration
20 | return unless configuration.activate?
21 |
22 | unless Rails.configuration.middleware.class == ActionDispatch::MiddlewareStack && Rails.configuration.middleware.include?(RailsExceptionHandler)
23 | Rails.configuration.middleware.use(RailsExceptionHandler)
24 | end
25 |
26 |
27 | Rails.configuration.action_dispatch.show_exceptions = if Rails::VERSION::MAJOR < 7 || (Rails::VERSION::MAJOR == 7 && Rails::VERSION::MINOR == 0)
28 | true
29 | else
30 | :all
31 | end
32 | Rails.configuration.consider_all_requests_local = false
33 | require File.expand_path(File.dirname(__FILE__)) + '/patch/show_exceptions.rb'
34 | configuration.run_callback
35 | end
36 | end
37 |
38 | class RailsExceptionHandler::ActiveRecord
39 | end
40 | class RailsExceptionHandler::Mongoid
41 | end
42 |
43 | require 'rails_exception_handler/configuration.rb'
44 | require 'rails_exception_handler/handler.rb'
45 | require 'rails_exception_handler/parser.rb'
46 | require 'rails_exception_handler/storage.rb'
47 | require 'rails_exception_handler/engine.rb'
48 | require 'rails_exception_handler/catcher.rb'
49 | require 'rails_exception_handler/fake_session.rb'
50 | require 'net/http'
51 |
--------------------------------------------------------------------------------
/lib/rails_exception_handler/catcher.rb:
--------------------------------------------------------------------------------
1 | class RailsExceptionHandler
2 |
3 | def self.catch(&block)
4 | begin
5 | block.call
6 | rescue Exception => exception
7 | if(configuration.activate?)
8 | exception_handler = Handler.new({'REQUEST_METHOD' => "GET", "rack.input" => ""}, exception)
9 | exception_handler.handle_exception
10 | else
11 | raise exception
12 | end
13 | end
14 | end
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/lib/rails_exception_handler/configuration.rb:
--------------------------------------------------------------------------------
1 | class RailsExceptionHandler::Configuration
2 | attr_accessor :storage_strategies, :environments, :filters, :responses, :response_mapping, :fallback_layout, :store_user_info, :env_info_block, :global_info_block, :exception_info_block, :request_info_block, :mongoid_store_in, :active_record_store_in
3 |
4 | def initialize
5 | @active_record_store_in = {
6 | database: 'exception_database',
7 | record_table: 'error_messages'
8 | }
9 | @environments = [:production]
10 | @storage_strategies = []
11 | @filters = []
12 | @store_user_info = false
13 | @fallback_layout = 'application'
14 | @response_mapping = {}
15 | @responses = {}
16 | end
17 |
18 | def active_record?
19 | @storage_strategies.include?(:active_record)
20 | end
21 |
22 | def mongoid?
23 | @storage_strategies.include?(:mongoid)
24 | end
25 |
26 | def email?
27 | @storage_strategies.collect{|s| s.is_a?(Hash) ? s.keys : s}.flatten.include?(:email)
28 | end
29 |
30 | def activate?
31 | environments.include?(Rails.env.to_sym)
32 | end
33 |
34 | def after_initialize(&block)
35 | @callback = block
36 | end
37 |
38 | def run_callback
39 | @callback.call if(@callback)
40 | end
41 |
42 | def store_environment_info(&block)
43 | @env_info_block = block
44 | end
45 |
46 | def store_global_info(&block)
47 | @global_info_block = block
48 | end
49 |
50 | def store_exception_info(&block)
51 | @exception_info_block = block
52 | end
53 |
54 | def store_request_info(&block)
55 | @request_info_block = block
56 | end
57 | end
58 |
--------------------------------------------------------------------------------
/lib/rails_exception_handler/engine.rb:
--------------------------------------------------------------------------------
1 | class RailsExceptionHandler
2 | class Engine < Rails::Engine
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/lib/rails_exception_handler/fake_session.rb:
--------------------------------------------------------------------------------
1 | class RailsExceptionHandler::FakeSession < Hash
2 | def enabled?
3 | false
4 | end
5 |
6 | def options
7 | {}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/db/migrate/20110630174538_create_error_messages.rb:
--------------------------------------------------------------------------------
1 | class CreateErrorMessages < ActiveRecord::Migration
2 | def self.up
3 | create_table :error_messages do |t|
4 | t.text :class_name
5 | t.text :message
6 | t.text :trace
7 | t.text :params
8 | t.text :target_url
9 | t.text :referer_url
10 | t.text :user_agent
11 | t.string :user_info
12 | t.string :app_name
13 | t.string :remote_ip
14 | t.string :server_name
15 | t.string :remote_addr
16 | t.datetime :created_at
17 |
18 | t.timestamps
19 | end
20 | end
21 |
22 | def self.down
23 | drop_table :error_messages
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/db/migrate/20110702131654_add_sessions_table.rb:
--------------------------------------------------------------------------------
1 | class AddSessionsTable < ActiveRecord::Migration
2 | def self.up
3 | create_table :sessions do |t|
4 | t.string :session_id, :null => false
5 | t.text :data
6 | t.timestamps
7 | end
8 |
9 | add_index :sessions, :session_id
10 | add_index :sessions, :updated_at
11 | end
12 |
13 | def self.down
14 | drop_table :sessions
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/spec/dummy_30/.gitignore:
--------------------------------------------------------------------------------
1 | .bundle
2 | log/*.log
3 | tmp/
4 |
--------------------------------------------------------------------------------
/spec/dummy_30/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path('../config/application', __FILE__)
5 | require 'rake'
6 |
7 | ExceptionHandlerTestApp::Application.load_tasks
8 |
--------------------------------------------------------------------------------
/spec/dummy_30/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | protect_from_forgery
3 |
4 | def current_user
5 | mock = Object.new
6 | def mock.login
7 | 'matz'
8 | end
9 | return mock
10 | end
11 |
12 | def nil_user
13 | return nil
14 | end
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/spec/dummy_30/app/controllers/home_controller.rb:
--------------------------------------------------------------------------------
1 | class HomeController < ApplicationController
2 |
3 | def controller_error
4 | nil.foo
5 | render(:text => 'did not fail')
6 | end
7 |
8 | def model_error
9 | s = StoredException.new
10 | s.failure
11 | render(:text => 'did not fail')
12 | end
13 |
14 | def view_error
15 | end
16 |
17 | def custom_layout
18 | render :action => 'view_error', :layout => 'custom'
19 | end
20 |
21 | def syntax_error
22 | eval("arr = [")
23 | render(:text => 'did not fail')
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/dummy_30/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/spec/dummy_30/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: 'from@example.com'
3 | end
4 |
--------------------------------------------------------------------------------
/spec/dummy_30/app/models/stored_exception.rb:
--------------------------------------------------------------------------------
1 | # Only used for testing model errors
2 | class StoredException < ActiveRecord::Base
3 | set_table_name :error_messages
4 |
5 |
6 | def failure
7 | nil.foo
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/dummy_30/app/views/home/view_error.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= nil.foo %>
3 |
--------------------------------------------------------------------------------
/spec/dummy_30/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag :all %>
6 | <%= javascript_include_tag :defaults %>
7 | <%= csrf_meta_tag %>
8 |
9 |
10 |
11 | this_is_the_application_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_30/app/views/layouts/custom.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag :all %>
6 | <%= javascript_include_tag :defaults %>
7 | <%= csrf_meta_tag %>
8 |
9 |
10 |
11 | this_is_the_custom_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_30/app/views/layouts/fallback.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag :all %>
6 | <%= javascript_include_tag :defaults %>
7 | <%= csrf_meta_tag %>
8 |
9 |
10 |
11 | this_is_the_fallback_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_30/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run ExceptionHandlerTestApp::Application
5 |
--------------------------------------------------------------------------------
/spec/dummy_30/config/boot.rb:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 |
3 | # Set up gems listed in the Gemfile.
4 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5 |
6 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
7 |
--------------------------------------------------------------------------------
/spec/dummy_30/config/database.yml:
--------------------------------------------------------------------------------
1 | test: &test
2 | adapter: sqlite3
3 | database: ../db/test.sqlite3
4 | pool: 5
5 | timeout: 5000
6 |
7 |
8 | exception_database:
9 | <<: *test
10 |
--------------------------------------------------------------------------------
/spec/dummy_30/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the rails application
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the rails application
5 | ExceptionHandlerTestApp::Application.initialize!
6 |
--------------------------------------------------------------------------------
/spec/dummy_30/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | ExceptionHandlerTestApp::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the webserver when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Log error messages when you accidentally call methods on nil.
10 | config.whiny_nils = true
11 |
12 | # Show full error reports and disable caching
13 | config.consider_all_requests_local = true
14 | config.action_view.debug_rjs = true
15 | config.action_controller.perform_caching = false
16 |
17 | # Don't care if the mailer can't send
18 | config.action_mailer.raise_delivery_errors = false
19 |
20 | # Print deprecation notices to the Rails logger
21 | config.active_support.deprecation = :log
22 |
23 | # Only use best-standards-support built into browsers
24 | config.action_dispatch.best_standards_support = :builtin
25 | end
26 |
27 |
--------------------------------------------------------------------------------
/spec/dummy_30/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | ExceptionHandlerTestApp::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Log error messages when you accidentally call methods on nil.
11 | config.whiny_nils = true
12 |
13 | # Show full error reports and disable caching
14 | config.consider_all_requests_local = true
15 | config.action_controller.perform_caching = false
16 |
17 | # Raise exceptions instead of rendering exception templates
18 | config.action_dispatch.show_exceptions = false
19 |
20 | # Disable request forgery protection in test environment
21 | config.action_controller.allow_forgery_protection = false
22 |
23 | # Tell Action Mailer not to deliver emails to the real world.
24 | # The :test delivery method accumulates sent emails in the
25 | # ActionMailer::Base.deliveries array.
26 | config.action_mailer.delivery_method = :test
27 |
28 | # Use SQL instead of Active Record's schema dumper when creating the test database.
29 | # This is necessary if your schema can't be completely dumped by the schema dumper,
30 | # like if you have constraints or database-specific column types
31 | # config.active_record.schema_format = :sql
32 |
33 | # Print deprecation notices to the stderr
34 | config.active_support.deprecation = :stderr
35 | end
36 |
--------------------------------------------------------------------------------
/spec/dummy_30/config/examples/travis_db.yml:
--------------------------------------------------------------------------------
1 |
2 | test: &test
3 | adapter: mysql2
4 | encoding: utf8
5 | reconnect: false
6 | database: exception_handler_test_app_test
7 | pool: 5
8 | username: root
9 | password:
10 | host: localhost
11 |
12 | exception_database:
13 | <<: *test
14 |
--------------------------------------------------------------------------------
/spec/dummy_30/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Sample localization file for English. Add more files in this directory for other locales.
2 | # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3 |
4 | en:
5 | hello: "Hello world"
6 |
--------------------------------------------------------------------------------
/spec/dummy_30/config/mongoid.yml:
--------------------------------------------------------------------------------
1 | test:
2 | host: localhost
3 | database: this_database_doesnt_matter
--------------------------------------------------------------------------------
/spec/dummy_30/config/routes.rb:
--------------------------------------------------------------------------------
1 | ExceptionHandlerTestApp::Application.routes.draw do
2 | match 'home/controller_error' => 'home#controller_error'
3 | match 'home/model_error' => 'home#model_error'
4 | match 'home/view_error' => 'home#view_error'
5 | match 'home/custom_layout' => 'home#custom_layout'
6 | match 'home/syntax_error' => 'home#syntax_error'
7 | end
8 |
--------------------------------------------------------------------------------
/spec/dummy_30/lib/tasks/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_30/lib/tasks/.gitkeep
--------------------------------------------------------------------------------
/spec/dummy_30/public/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_30/public/.gitkeep
--------------------------------------------------------------------------------
/spec/dummy_30/script/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3 |
4 | APP_PATH = File.expand_path('../../config/application', __FILE__)
5 | require File.expand_path('../../config/boot', __FILE__)
6 | require 'rails/commands'
7 |
--------------------------------------------------------------------------------
/spec/dummy_30/script/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | require 'fileutils'
4 |
5 | Dir.chdir(File.expand_path(File.dirname(__FILE__)) + "/../")
6 |
7 | source = "config/examples/travis_db.yml"
8 | target = "config/database.yml"
9 |
10 | if File.exist?(target)
11 | puts "#{target} already exists"
12 | else
13 | FileUtils.cp(source, target)
14 | puts "#{target} copied"
15 | end
16 |
17 | system "bundle"
18 | system "bundle exec rake db:create --trace RAILS_ENV=test"
19 | system "bundle exec rake db:migrate --trace RAILS_ENV=test"
20 |
--------------------------------------------------------------------------------
/spec/dummy_32/.gitignore:
--------------------------------------------------------------------------------
1 | /.bundle
2 | /log/*.log
3 | /tmp
4 |
--------------------------------------------------------------------------------
/spec/dummy_32/Rakefile:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env rake
2 | # Add your own tasks in files placed in lib/tasks ending in .rake,
3 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4 |
5 | require File.expand_path('../config/application', __FILE__)
6 |
7 | ExceptionHandlerTestApp::Application.load_tasks
8 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/assets/images/rails.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_32/app/assets/images/rails.png
--------------------------------------------------------------------------------
/spec/dummy_32/app/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | // This is a manifest file that'll be compiled into application.js, which will include all the files
2 | // listed below.
3 | //
4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6 | //
7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 | // the compiled file.
9 | //
10 | // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11 | // GO AFTER THE REQUIRES BELOW.
12 | //
13 | //= require_tree .
14 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the top of the
9 | * compiled file, but it's generally better to create a new file per style scope.
10 | *
11 | *= require_self
12 | *= require_tree .
13 | */
14 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | protect_from_forgery
3 |
4 | def current_user
5 | mock = Object.new
6 | def mock.login
7 | 'matz'
8 | end
9 | return mock
10 | end
11 |
12 | def nil_user
13 | return nil
14 | end
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/controllers/home_controller.rb:
--------------------------------------------------------------------------------
1 | class HomeController < ApplicationController
2 |
3 | def controller_error
4 | nil.foo
5 | render(:text => 'did not fail')
6 | end
7 |
8 | def model_error
9 | s = StoredException.new
10 | s.failure
11 | render(:text => 'did not fail')
12 | end
13 |
14 | def view_error
15 | end
16 |
17 | def custom_layout
18 | render :action => 'view_error', :layout => 'custom'
19 | end
20 |
21 | def syntax_error
22 | eval("arr = [")
23 | render(:text => 'did not fail')
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/mailers/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_32/app/mailers/.gitkeep
--------------------------------------------------------------------------------
/spec/dummy_32/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: 'from@example.com'
3 | end
4 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/models/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_32/app/models/.gitkeep
--------------------------------------------------------------------------------
/spec/dummy_32/app/models/stored_exception.rb:
--------------------------------------------------------------------------------
1 | # Only used for testing model errors
2 | class StoredException < ActiveRecord::Base
3 | self.table_name = :error_messages
4 |
5 |
6 | def failure
7 | nil.foo
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/views/home/view_error.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= nil.foo %>
3 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag :all %>
6 | <%= javascript_include_tag :defaults %>
7 | <%= csrf_meta_tag %>
8 |
9 |
10 |
11 | this_is_the_application_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/views/layouts/custom.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag :all %>
6 | <%= javascript_include_tag :defaults %>
7 | <%= csrf_meta_tag %>
8 |
9 |
10 |
11 | this_is_the_custom_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_32/app/views/layouts/fallback.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag :all %>
6 | <%= javascript_include_tag :defaults %>
7 | <%= csrf_meta_tag %>
8 |
9 |
10 |
11 | this_is_the_fallback_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_32/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run ExceptionHandlerTestApp::Application
5 |
--------------------------------------------------------------------------------
/spec/dummy_32/config/boot.rb:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 |
3 | # Set up gems listed in the Gemfile.
4 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5 |
6 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
7 |
--------------------------------------------------------------------------------
/spec/dummy_32/config/database.yml:
--------------------------------------------------------------------------------
1 | test: &test
2 | adapter: sqlite3
3 | database: ../db/test.sqlite3
4 | pool: 5
5 | timeout: 5000
6 |
7 |
8 | exception_database:
9 | <<: *test
10 |
--------------------------------------------------------------------------------
/spec/dummy_32/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the rails application
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the rails application
5 | ExceptionHandlerTestApp::Application.initialize!
6 |
--------------------------------------------------------------------------------
/spec/dummy_32/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | ExceptionHandlerTestApp::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Log error messages when you accidentally call methods on nil.
10 | config.whiny_nils = true
11 |
12 | # Show full error reports and disable caching
13 | config.consider_all_requests_local = true
14 | config.action_controller.perform_caching = false
15 |
16 | # Don't care if the mailer can't send
17 | config.action_mailer.raise_delivery_errors = false
18 |
19 | # Print deprecation notices to the Rails logger
20 | config.active_support.deprecation = :log
21 |
22 | # Only use best-standards-support built into browsers
23 | config.action_dispatch.best_standards_support = :builtin
24 |
25 | # Raise exception on mass assignment protection for Active Record models
26 | config.active_record.mass_assignment_sanitizer = :strict
27 |
28 | # Log the query plan for queries taking more than this (works
29 | # with SQLite, MySQL, and PostgreSQL)
30 | config.active_record.auto_explain_threshold_in_seconds = 0.5
31 |
32 | # Do not compress assets
33 | config.assets.compress = false
34 |
35 | # Expands the lines which load the assets
36 | config.assets.debug = true
37 | end
38 |
--------------------------------------------------------------------------------
/spec/dummy_32/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | ExceptionHandlerTestApp::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Configure static asset server for tests with Cache-Control for performance
11 | config.serve_static_assets = true
12 | config.static_cache_control = "public, max-age=3600"
13 |
14 | # Log error messages when you accidentally call methods on nil
15 | config.whiny_nils = true
16 |
17 | # Show full error reports and disable caching
18 | config.consider_all_requests_local = true
19 | config.action_controller.perform_caching = false
20 |
21 | # Raise exceptions instead of rendering exception templates
22 | config.action_dispatch.show_exceptions = false
23 |
24 | # Disable request forgery protection in test environment
25 | config.action_controller.allow_forgery_protection = false
26 |
27 | # Tell Action Mailer not to deliver emails to the real world.
28 | # The :test delivery method accumulates sent emails in the
29 | # ActionMailer::Base.deliveries array.
30 | config.action_mailer.delivery_method = :test
31 |
32 | # Raise exception on mass assignment protection for Active Record models
33 | config.active_record.mass_assignment_sanitizer = :strict
34 |
35 | # Print deprecation notices to the stderr
36 | config.active_support.deprecation = :stderr
37 | end
38 |
--------------------------------------------------------------------------------
/spec/dummy_32/config/examples/travis_db.yml:
--------------------------------------------------------------------------------
1 |
2 | test: &test
3 | adapter: mysql2
4 | encoding: utf8
5 | reconnect: false
6 | database: exception_handler_test_app_test
7 | pool: 5
8 | username: root
9 | password:
10 | host: localhost
11 |
12 | exception_database:
13 | <<: *test
14 |
--------------------------------------------------------------------------------
/spec/dummy_32/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Sample localization file for English. Add more files in this directory for other locales.
2 | # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3 |
4 | en:
5 | hello: "Hello world"
6 |
--------------------------------------------------------------------------------
/spec/dummy_32/config/mongoid.yml:
--------------------------------------------------------------------------------
1 | test:
2 | sessions:
3 | default:
4 | database: this_database_doesnt_matter
5 | hosts:
6 | - localhost:27017
--------------------------------------------------------------------------------
/spec/dummy_32/config/routes.rb:
--------------------------------------------------------------------------------
1 | ExceptionHandlerTestApp::Application.routes.draw do
2 | match 'home/controller_error' => 'home#controller_error'
3 | match 'home/model_error' => 'home#model_error'
4 | match 'home/view_error' => 'home#view_error'
5 | match 'home/custom_layout' => 'home#custom_layout'
6 | match 'home/syntax_error' => 'home#syntax_error'
7 | end
8 |
--------------------------------------------------------------------------------
/spec/dummy_32/log/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_32/log/.gitkeep
--------------------------------------------------------------------------------
/spec/dummy_32/public/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_32/public/.gitkeep
--------------------------------------------------------------------------------
/spec/dummy_32/script/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3 |
4 | APP_PATH = File.expand_path('../../config/application', __FILE__)
5 | require File.expand_path('../../config/boot', __FILE__)
6 | require 'rails/commands'
7 |
--------------------------------------------------------------------------------
/spec/dummy_32/script/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | require 'fileutils'
4 |
5 | Dir.chdir(File.expand_path(File.dirname(__FILE__)) + "/../")
6 |
7 | source = "config/examples/travis_db.yml"
8 | target = "config/database.yml"
9 |
10 | if File.exist?(target)
11 | puts "#{target} already exists"
12 | else
13 | FileUtils.cp(source, target)
14 | puts "#{target} copied"
15 | end
16 |
17 | system "bundle"
18 | system "bundle exec rake db:create --trace RAILS_ENV=test"
19 | system "bundle exec rake db:migrate --trace RAILS_ENV=test"
20 |
--------------------------------------------------------------------------------
/spec/dummy_40/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile '~/.gitignore_global'
6 |
7 | # Ignore bundler config.
8 | /.bundle
9 |
10 | # Ignore the default SQLite database.
11 | /db/*.sqlite3
12 | /db/*.sqlite3-journal
13 |
14 | # Ignore all logfiles and tempfiles.
15 | /log/*.log
16 | /tmp
17 |
--------------------------------------------------------------------------------
/spec/dummy_40/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path('../config/application', __FILE__)
5 |
6 | ExceptionHandlerTestApp::Application.load_tasks
7 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_40/app/assets/images/.keep
--------------------------------------------------------------------------------
/spec/dummy_40/app/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | // This is a manifest file that'll be compiled into application.js, which will include all the files
2 | // listed below.
3 | //
4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6 | //
7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 | // compiled file.
9 | //
10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11 | // about supported directives.
12 | //
13 | //= require_tree .
14 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the top of the
9 | * compiled file, but it's generally better to create a new file per style scope.
10 | *
11 | *= require_self
12 | *= require_tree .
13 | */
14 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | # Prevent CSRF attacks by raising an exception.
3 | # For APIs, you may want to use :null_session instead.
4 | protect_from_forgery with: :exception
5 |
6 | def current_user
7 | mock = Object.new
8 | def mock.login
9 | 'matz'
10 | end
11 | return mock
12 | end
13 |
14 | def nil_user
15 | return nil
16 | end
17 |
18 | end
19 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/controllers/home_controller.rb:
--------------------------------------------------------------------------------
1 | class HomeController < ApplicationController
2 |
3 | def controller_error
4 | nil.foo
5 | render(:text => 'did not fail')
6 | end
7 |
8 | def model_error
9 | s = StoredException.new
10 | s.failure
11 | render(:text => 'did not fail')
12 | end
13 |
14 | def view_error
15 | end
16 |
17 | def custom_layout
18 | render :action => 'view_error', :layout => 'custom'
19 | end
20 |
21 | def syntax_error
22 | eval("arr = [")
23 | render(:text => 'did not fail')
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_40/app/mailers/.keep
--------------------------------------------------------------------------------
/spec/dummy_40/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: 'from@example.com'
3 | end
4 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_40/app/models/.keep
--------------------------------------------------------------------------------
/spec/dummy_40/app/models/stored_exception.rb:
--------------------------------------------------------------------------------
1 | # Only used for testing model errors
2 | class StoredException < ActiveRecord::Base
3 | self.table_name = :error_messages
4 |
5 |
6 | def failure
7 | nil.foo
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/views/home/view_error.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= nil.foo %>
3 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | this_is_the_application_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/views/layouts/custom.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | this_is_the_custom_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_40/app/views/layouts/fallback.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | this_is_the_fallback_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_40/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/spec/dummy_40/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path('../../config/application', __FILE__)
3 | require_relative '../config/boot'
4 | require 'rails/commands'
5 |
--------------------------------------------------------------------------------
/spec/dummy_40/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/spec/dummy_40/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run Rails.application
5 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | require 'rails/all'
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(:default, Rails.env)
8 |
9 | module ExceptionHandlerTestApp
10 | class Application < Rails::Application
11 | # Settings in config/environments/* take precedence over those specified here.
12 | # Application configuration should go into files in config/initializers
13 | # -- all .rb files in that directory are automatically loaded.
14 |
15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17 | # config.time_zone = 'Central Time (US & Canada)'
18 |
19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21 | # config.i18n.default_locale = :de
22 | end
23 | end
24 |
25 | RailsExceptionHandler.configure do |config|
26 | config.environments = [:test]
27 | config.storage_strategies = [:active_record]
28 | end
29 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/boot.rb:
--------------------------------------------------------------------------------
1 | # Set up gems listed in the Gemfile.
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 |
4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/database.yml:
--------------------------------------------------------------------------------
1 | test: &test
2 | adapter: sqlite3
3 | database: ../db/test.sqlite3
4 | pool: 5
5 | timeout: 5000
6 |
7 |
8 | exception_database:
9 | <<: *test
10 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the Rails application.
5 | ExceptionHandlerTestApp::Application.initialize!
6 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | ExceptionHandlerTestApp::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Do not eager load code on boot.
10 | config.eager_load = false
11 |
12 | # Show full error reports and disable caching.
13 | config.consider_all_requests_local = true
14 | config.action_controller.perform_caching = false
15 |
16 | # Don't care if the mailer can't send.
17 | config.action_mailer.raise_delivery_errors = false
18 |
19 | # Print deprecation notices to the Rails logger.
20 | config.active_support.deprecation = :log
21 |
22 | # Raise an error on page load if there are pending migrations
23 | config.active_record.migration_error = :page_load
24 |
25 | # Debug mode disables concatenation and preprocessing of assets.
26 | # This option may cause significant delays in view rendering with a large
27 | # number of complex assets.
28 | config.assets.debug = true
29 | end
30 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | ExceptionHandlerTestApp::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Do not eager load code on boot. This avoids loading your whole application
11 | # just for the purpose of running a single test. If you are using a tool that
12 | # preloads Rails for running tests, you may have to set it to true.
13 | config.eager_load = false
14 |
15 | # Configure static asset server for tests with Cache-Control for performance.
16 | config.serve_static_assets = true
17 | config.static_cache_control = "public, max-age=3600"
18 |
19 | # Show full error reports and disable caching.
20 | config.consider_all_requests_local = true
21 | config.action_controller.perform_caching = false
22 |
23 | # Raise exceptions instead of rendering exception templates.
24 | config.action_dispatch.show_exceptions = false
25 |
26 | # Disable request forgery protection in test environment.
27 | config.action_controller.allow_forgery_protection = false
28 |
29 | # Tell Action Mailer not to deliver emails to the real world.
30 | # The :test delivery method accumulates sent emails in the
31 | # ActionMailer::Base.deliveries array.
32 | config.action_mailer.delivery_method = :test
33 |
34 | # Print deprecation notices to the stderr.
35 | config.active_support.deprecation = :stderr
36 | end
37 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 | # Mime::Type.register_alias "text/html", :iphone
6 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/initializers/secret_token.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key is used for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 |
6 | # Make sure the secret is at least 30 characters and all random,
7 | # no regular words or you'll be exposed to dictionary attacks.
8 | # You can use `rake secret` to generate a secure secret key.
9 |
10 | # Make sure your secret_key_base is kept private
11 | # if you're sharing your code publicly.
12 | ExceptionHandlerTestApp::Application.config.secret_key_base = '1299a34f59976ec1fbb2d3c751ab7066e532dd4956ee91718329dcbeaf49a40170496fbf4109c00636328683b886efe0ad35b8c3f7628edc5ea6251eca48ccc4'
13 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | ExceptionHandlerTestApp::Application.config.session_store :cookie_store, key: '_dummy_40_session'
4 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more, please read the Rails Internationalization guide
20 | # available at http://guides.rubyonrails.org/i18n.html.
21 |
22 | en:
23 | hello: "Hello world"
24 |
--------------------------------------------------------------------------------
/spec/dummy_40/config/mongoid.yml:
--------------------------------------------------------------------------------
1 | test:
2 | clients:
3 | default:
4 | database: this_database_doesnt_matter
5 | hosts:
6 | - localhost:27017
7 |
--------------------------------------------------------------------------------
/spec/dummy_40/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_40/lib/assets/.keep
--------------------------------------------------------------------------------
/spec/dummy_40/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_40/lib/tasks/.keep
--------------------------------------------------------------------------------
/spec/dummy_40/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_40/log/.keep
--------------------------------------------------------------------------------
/spec/dummy_40/public/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_40/public/.gitkeep
--------------------------------------------------------------------------------
/spec/dummy_42/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile '~/.gitignore_global'
6 |
7 | # Ignore bundler config.
8 | /.bundle
9 |
10 | # Ignore the default SQLite database.
11 | /db/*.sqlite3
12 | /db/*.sqlite3-journal
13 |
14 | # Ignore all logfiles and tempfiles.
15 | /log/*
16 | !/log/.keep
17 | /tmp
18 |
--------------------------------------------------------------------------------
/spec/dummy_42/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path('../config/application', __FILE__)
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_42/app/assets/images/.keep
--------------------------------------------------------------------------------
/spec/dummy_42/app/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | // This is a manifest file that'll be compiled into application.js, which will include all the files
2 | // listed below.
3 | //
4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 | // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6 | //
7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 | // compiled file.
9 | //
10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11 | // about supported directives.
12 | //
13 | //= require_tree .
14 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any styles
10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11 | * file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | # Prevent CSRF attacks by raising an exception.
3 | # For APIs, you may want to use :null_session instead.
4 | protect_from_forgery with: :exception
5 |
6 | def current_user
7 | mock = Object.new
8 | def mock.login
9 | 'matz'
10 | end
11 | return mock
12 | end
13 |
14 | def nil_user
15 | return nil
16 | end
17 |
18 | end
19 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/controllers/home_controller.rb:
--------------------------------------------------------------------------------
1 | class HomeController < ApplicationController
2 |
3 | def controller_error
4 | nil.foo
5 | render(:text => 'did not fail')
6 | end
7 |
8 | def model_error
9 | s = StoredException.new
10 | s.failure
11 | render(:text => 'did not fail')
12 | end
13 |
14 | def view_error
15 | end
16 |
17 | def custom_layout
18 | render :action => 'view_error', :layout => 'custom'
19 | end
20 |
21 | def syntax_error
22 | eval("arr = [")
23 | render(:text => 'did not fail')
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_42/app/mailers/.keep
--------------------------------------------------------------------------------
/spec/dummy_42/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: 'from@example.com'
3 | end
4 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_42/app/models/.keep
--------------------------------------------------------------------------------
/spec/dummy_42/app/models/stored_exception.rb:
--------------------------------------------------------------------------------
1 | # Only used for testing model errors
2 | class StoredException < ActiveRecord::Base
3 | self.table_name = :error_messages
4 |
5 |
6 | def failure
7 | nil.foo
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/views/home/view_error.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= nil.foo %>
3 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | this_is_the_application_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/views/layouts/custom.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | this_is_the_custom_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_42/app/views/layouts/fallback.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | this_is_the_fallback_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_42/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/spec/dummy_42/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path('../../config/application', __FILE__)
3 | require_relative '../config/boot'
4 | require 'rails/commands'
5 |
--------------------------------------------------------------------------------
/spec/dummy_42/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/spec/dummy_42/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'pathname'
3 |
4 | # path to your application root.
5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6 |
7 | Dir.chdir APP_ROOT do
8 | # This script is a starting point to setup your application.
9 | # Add necessary setup steps to this file:
10 |
11 | puts "== Installing dependencies =="
12 | system "gem install bundler --conservative"
13 | system "bundle check || bundle install"
14 |
15 | # puts "\n== Copying sample files =="
16 | # unless File.exist?("config/database.yml")
17 | # system "cp config/database.yml.sample config/database.yml"
18 | # end
19 |
20 | puts "\n== Preparing database =="
21 | system "bin/rake db:setup"
22 |
23 | puts "\n== Removing old logs and tempfiles =="
24 | system "rm -f log/*"
25 | system "rm -rf tmp/cache"
26 |
27 | puts "\n== Restarting application server =="
28 | system "touch tmp/restart.txt"
29 | end
30 |
--------------------------------------------------------------------------------
/spec/dummy_42/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run Rails.application
5 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | require 'rails/all'
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module ExceptionHandlerTestApp
10 | class Application < Rails::Application
11 | # Settings in config/environments/* take precedence over those specified here.
12 | # Application configuration should go into files in config/initializers
13 | # -- all .rb files in that directory are automatically loaded.
14 |
15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17 | # config.time_zone = 'Central Time (US & Canada)'
18 |
19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21 | # config.i18n.default_locale = :de
22 |
23 | # Do not swallow errors in after_commit/after_rollback callbacks.
24 | config.active_record.raise_in_transactional_callbacks = true
25 | end
26 | end
27 |
28 | RailsExceptionHandler.configure do |config|
29 | config.environments = [:test]
30 | config.storage_strategies = [:active_record]
31 | end
32 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2 |
3 | require 'bundler/setup' # Set up gems listed in the Gemfile.
4 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/database.yml:
--------------------------------------------------------------------------------
1 | test: &test
2 | adapter: sqlite3
3 | database: ../db/test.sqlite3
4 | pool: 5
5 | timeout: 5000
6 |
7 |
8 | exception_database:
9 | <<: *test
10 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = '1.0'
5 |
6 | # Add additional assets to the asset load path
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 |
9 | # Precompile additional assets.
10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11 | # Rails.application.config.assets.precompile += %w( search.js )
12 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.action_dispatch.cookies_serializer = :json
4 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.session_store :cookie_store, key: '_exception_handler_test_app_session'
4 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more, please read the Rails Internationalization guide
20 | # available at http://guides.rubyonrails.org/i18n.html.
21 |
22 | en:
23 | hello: "Hello world"
24 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/mongoid.yml:
--------------------------------------------------------------------------------
1 | test:
2 | clients:
3 | default:
4 | database: this_database_doesnt_matter
5 | hosts:
6 | - localhost:27017
7 |
--------------------------------------------------------------------------------
/spec/dummy_42/config/secrets.yml:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key is used for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 |
6 | # Make sure the secret is at least 30 characters and all random,
7 | # no regular words or you'll be exposed to dictionary attacks.
8 | # You can use `rake secret` to generate a secure secret key.
9 |
10 | # Make sure the secrets in this file are kept private
11 | # if you're sharing your code publicly.
12 |
13 | development:
14 | secret_key_base: bbdbc08e27b9bd967ff3ec872cdfef2fc154f4ab1ac79c63bf3b1fcc2517dde4114573d02c575397bf52956f785db81dc77edd31acc5cafedb2d06ce61f4ff31
15 |
16 | test:
17 | secret_key_base: 3ea02a4b7d45c2bdc4929011d468caa2552c861b936f453c63ea7b6d96405b2eec08fcb0791c60998eb79fb8c69a7f992a40928eaabaa93d77a904a4f605dc0a
18 |
19 | # Do not keep production secrets in the repository,
20 | # instead read values from the environment.
21 | production:
22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
23 |
--------------------------------------------------------------------------------
/spec/dummy_42/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_42/lib/assets/.keep
--------------------------------------------------------------------------------
/spec/dummy_42/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_42/lib/tasks/.keep
--------------------------------------------------------------------------------
/spec/dummy_42/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_42/log/.keep
--------------------------------------------------------------------------------
/spec/dummy_42/public/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_42/public/.gitkeep
--------------------------------------------------------------------------------
/spec/dummy_51/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile '~/.gitignore_global'
6 |
7 | # Ignore bundler config.
8 | /.bundle
9 |
10 | # Ignore the default SQLite database.
11 | /db/*.sqlite3
12 | /db/*.sqlite3-journal
13 |
14 | # Ignore all logfiles and tempfiles.
15 | /log/*
16 | /tmp/*
17 | !/log/.keep
18 | !/tmp/.keep
19 |
20 | /node_modules
21 | /yarn-error.log
22 |
23 | .byebug_history
24 |
--------------------------------------------------------------------------------
/spec/dummy_51/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.4.1
2 |
--------------------------------------------------------------------------------
/spec/dummy_51/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require_relative 'config/application'
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/assets/config/manifest.js:
--------------------------------------------------------------------------------
1 | //= link_tree ../images
2 | //= link_directory ../javascripts .js
3 | //= link_directory ../stylesheets .css
4 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/app/assets/images/.keep
--------------------------------------------------------------------------------
/spec/dummy_51/app/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | // This is a manifest file that'll be compiled into application.js, which will include all the files
2 | // listed below.
3 | //
4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
5 | // vendor/assets/javascripts directory can be referenced here using a relative path.
6 | //
7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 | // compiled file. JavaScript code in this file should be added after the last require_* statement.
9 | //
10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11 | // about supported directives.
12 | //
13 | //= require rails-ujs
14 | //= require_tree .
15 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/assets/javascripts/cable.js:
--------------------------------------------------------------------------------
1 | // Action Cable provides the framework to deal with WebSockets in Rails.
2 | // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3 | //
4 | //= require action_cable
5 | //= require_self
6 | //= require_tree ./channels
7 |
8 | (function() {
9 | this.App || (this.App = {});
10 |
11 | App.cable = ActionCable.createConsumer();
12 |
13 | }).call(this);
14 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/assets/javascripts/channels/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/app/assets/javascripts/channels/.keep
--------------------------------------------------------------------------------
/spec/dummy_51/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6 | * vendor/assets/stylesheets directory can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10 | * files in this directory. Styles in this file should be added after the last require_* statement.
11 | * It is generally better to create a new file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/channels/application_cable/channel.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Channel < ActionCable::Channel::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/channels/application_cable/connection.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Connection < ActionCable::Connection::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | protect_from_forgery with: :exception
3 |
4 | def current_user
5 | mock = Object.new
6 | def mock.login
7 | 'matz'
8 | end
9 | return mock
10 | end
11 |
12 | def nil_user
13 | return nil
14 | end
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/spec/dummy_51/app/controllers/home_controller.rb:
--------------------------------------------------------------------------------
1 | class HomeController < ApplicationController
2 |
3 | def controller_error
4 | nil.foo
5 | render(:text => 'did not fail')
6 | end
7 |
8 | def model_error
9 | s = StoredException.new
10 | s.failure
11 | render(:text => 'did not fail')
12 | end
13 |
14 | def view_error
15 | end
16 |
17 | def custom_layout
18 | render :action => 'view_error', :layout => 'custom'
19 | end
20 |
21 | def syntax_error
22 | eval("arr = [")
23 | render(:text => 'did not fail')
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | end
3 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: 'from@example.com'
3 | layout 'mailer'
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | self.abstract_class = true
3 | end
4 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/app/models/concerns/.keep
--------------------------------------------------------------------------------
/spec/dummy_51/app/models/stored_exception.rb:
--------------------------------------------------------------------------------
1 | # Only used for testing model errors
2 | class StoredException < ApplicationRecord
3 | self.table_name = :error_messages
4 |
5 | def failure
6 | nil.foo
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/views/home/view_error.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= nil.foo %>
3 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | this_is_the_application_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/views/layouts/custom.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | this_is_the_custom_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/views/layouts/fallback.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | this_is_the_fallback_layout
12 | <%= yield %>
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/spec/dummy_51/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/spec/dummy_51/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/spec/dummy_51/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | APP_PATH = File.expand_path('../config/application', __dir__)
8 | require_relative '../config/boot'
9 | require 'rails/commands'
10 |
--------------------------------------------------------------------------------
/spec/dummy_51/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | require_relative '../config/boot'
8 | require 'rake'
9 | Rake.application.run
10 |
--------------------------------------------------------------------------------
/spec/dummy_51/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'pathname'
3 | require 'fileutils'
4 | include FileUtils
5 |
6 | # path to your application root.
7 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8 |
9 | def system!(*args)
10 | system(*args) || abort("\n== Command #{args} failed ==")
11 | end
12 |
13 | chdir APP_ROOT do
14 | # This script is a starting point to setup your application.
15 | # Add necessary setup steps to this file.
16 |
17 | puts '== Installing dependencies =='
18 | system! 'gem install bundler --conservative'
19 | system('bundle check') || system!('bundle install')
20 |
21 | # Install JavaScript dependencies if using Yarn
22 | # system('bin/yarn')
23 |
24 |
25 | # puts "\n== Copying sample files =="
26 | # unless File.exist?('config/database.yml')
27 | # cp 'config/database.yml.sample', 'config/database.yml'
28 | # end
29 |
30 | puts "\n== Preparing database =="
31 | system! 'bin/rails db:setup'
32 |
33 | puts "\n== Removing old logs and tempfiles =="
34 | system! 'bin/rails log:clear tmp:clear'
35 |
36 | puts "\n== Restarting application server =="
37 | system! 'bin/rails restart'
38 | end
39 |
--------------------------------------------------------------------------------
/spec/dummy_51/bin/spring:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # This file loads spring without using Bundler, in order to be fast.
4 | # It gets overwritten when you run the `spring binstub` command.
5 |
6 | unless defined?(Spring)
7 | require 'rubygems'
8 | require 'bundler'
9 |
10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11 | spring = lockfile.specs.detect { |spec| spec.name == "spring" }
12 | if spring
13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14 | gem 'spring', spring.version
15 | require 'spring/binstub'
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/spec/dummy_51/bin/update:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'pathname'
3 | require 'fileutils'
4 | include FileUtils
5 |
6 | # path to your application root.
7 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8 |
9 | def system!(*args)
10 | system(*args) || abort("\n== Command #{args} failed ==")
11 | end
12 |
13 | chdir APP_ROOT do
14 | # This script is a way to update your development environment automatically.
15 | # Add necessary update steps to this file.
16 |
17 | puts '== Installing dependencies =='
18 | system! 'gem install bundler --conservative'
19 | system('bundle check') || system!('bundle install')
20 |
21 | puts "\n== Updating database =="
22 | system! 'bin/rails db:migrate'
23 |
24 | puts "\n== Removing old logs and tempfiles =="
25 | system! 'bin/rails log:clear tmp:clear'
26 |
27 | puts "\n== Restarting application server =="
28 | system! 'bin/rails restart'
29 | end
30 |
--------------------------------------------------------------------------------
/spec/dummy_51/bin/yarn:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | VENDOR_PATH = File.expand_path('..', __dir__)
3 | Dir.chdir(VENDOR_PATH) do
4 | begin
5 | exec "yarnpkg #{ARGV.join(" ")}"
6 | rescue Errno::ENOENT
7 | $stderr.puts "Yarn executable was not detected in the system."
8 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9 | exit 1
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/spec/dummy_51/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require_relative 'config/environment'
4 |
5 | run Rails.application
6 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/application.rb:
--------------------------------------------------------------------------------
1 | require_relative 'boot'
2 |
3 | require 'rails/all'
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module ExceptionHandlerTestApp
10 | class Application < Rails::Application
11 | # Initialize configuration defaults for originally generated Rails version.
12 | config.load_defaults 5.1
13 |
14 | # Settings in config/environments/* take precedence over those specified here.
15 | # Application configuration should go into files in config/initializers
16 | # -- all .rb files in that directory are automatically loaded.
17 | end
18 | end
19 |
20 | RailsExceptionHandler.configure do |config|
21 | config.environments = [:test]
22 | config.storage_strategies = [:active_record]
23 | end
24 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2 |
3 | require 'bundler/setup' # Set up gems listed in the Gemfile.
4 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: async
6 |
7 | production:
8 | adapter: redis
9 | url: redis://localhost:6379/1
10 | channel_prefix: dummy_51_production
11 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/database.yml:
--------------------------------------------------------------------------------
1 | test: &test
2 | adapter: sqlite3
3 | database: ../db/test.sqlite3
4 | pool: 5
5 | timeout: 5000
6 |
7 |
8 | exception_database:
9 | <<: *test
10 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative 'application'
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/initializers/application_controller_renderer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # ApplicationController.renderer.defaults.merge!(
4 | # http_host: 'example.org',
5 | # https: false
6 | # )
7 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = '1.0'
5 |
6 | # Add additional assets to the asset load path.
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 | # Add Yarn node_modules folder to the asset load path.
9 | Rails.application.config.assets.paths << Rails.root.join('node_modules')
10 |
11 | # Precompile additional assets.
12 | # application.js, application.css, and all non-JS/CSS in the app/assets
13 | # folder are already added.
14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css )
15 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Specify a serializer for the signed and encrypted cookie jars.
4 | # Valid options are :json, :marshal, and :hybrid.
5 | Rails.application.config.action_dispatch.cookies_serializer = :json
6 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json]
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # The following keys must be escaped otherwise they will not be retrieved by
20 | # the default I18n backend:
21 | #
22 | # true, false, on, off, yes, no
23 | #
24 | # Instead, surround them with single quotes.
25 | #
26 | # en:
27 | # 'true': 'foo'
28 | #
29 | # To learn more, please read the Rails Internationalization guide
30 | # available at http://guides.rubyonrails.org/i18n.html.
31 |
32 | en:
33 | hello: "Hello world"
34 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/mongoid.yml:
--------------------------------------------------------------------------------
1 | test:
2 | clients:
3 | default:
4 | database: this_database_doesnt_matter
5 | hosts:
6 | - localhost:27017
7 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
3 | get 'home/controller_error' => 'home#controller_error'
4 | get 'home/model_error' => 'home#model_error'
5 | get 'home/view_error' => 'home#view_error'
6 | get 'home/custom_layout' => 'home#custom_layout'
7 | get 'home/syntax_error' => 'home#syntax_error'
8 | end
9 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/secrets.yml:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key is used for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 |
6 | # Make sure the secret is at least 30 characters and all random,
7 | # no regular words or you'll be exposed to dictionary attacks.
8 | # You can use `rails secret` to generate a secure secret key.
9 |
10 | # Make sure the secrets in this file are kept private
11 | # if you're sharing your code publicly.
12 |
13 | # Shared secrets are available across all environments.
14 |
15 | # shared:
16 | # api_key: a1B2c3D4e5F6
17 |
18 | # Environmental secrets are only available for that specific environment.
19 |
20 | development:
21 | secret_key_base: d888b16e582ce700f79a06aded9fef512f5c85d561f854bdb8952e4b56bf88fc7ac8e2cd67edaafedb994214d8b300e0bc0661e38ae6370e84ff65c46f5af596
22 |
23 | test:
24 | secret_key_base: 57eec5e17e5fcd8259ef60e08f7b175d002d1e7359eaa026fd452848981eef7dc4047344dd89ac998008a38aa15ddd3262e1c59f07365b6e86121363a1aa20f6
25 |
26 | # Do not keep production secrets in the unencrypted secrets file.
27 | # Instead, either read values from the environment.
28 | # Or, use `bin/rails secrets:setup` to configure encrypted secrets
29 | # and move the `production:` environment over there.
30 |
31 | production:
32 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
33 |
--------------------------------------------------------------------------------
/spec/dummy_51/config/spring.rb:
--------------------------------------------------------------------------------
1 | %w(
2 | .ruby-version
3 | .rbenv-vars
4 | tmp/restart.txt
5 | tmp/caching-dev.txt
6 | ).each { |path| Spring.watch(path) }
7 |
--------------------------------------------------------------------------------
/spec/dummy_51/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/lib/assets/.keep
--------------------------------------------------------------------------------
/spec/dummy_51/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/lib/tasks/.keep
--------------------------------------------------------------------------------
/spec/dummy_51/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/log/.keep
--------------------------------------------------------------------------------
/spec/dummy_51/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dummy_51",
3 | "private": true,
4 | "dependencies": {}
5 | }
6 |
--------------------------------------------------------------------------------
/spec/dummy_51/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/public/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/spec/dummy_51/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/spec/dummy_51/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/public/favicon.ico
--------------------------------------------------------------------------------
/spec/dummy_51/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/spec/dummy_51/tmp/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_51/tmp/.keep
--------------------------------------------------------------------------------
/spec/dummy_60/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile '~/.gitignore_global'
6 |
7 | # Ignore bundler config.
8 | /.bundle
9 |
10 | # Ignore the default SQLite database.
11 | /db/*.sqlite3
12 | /db/*.sqlite3-journal
13 |
14 | # Ignore all logfiles and tempfiles.
15 | /log/*
16 | /tmp/*
17 | !/log/.keep
18 | !/tmp/.keep
19 |
20 | # Ignore uploaded files in development.
21 | /storage/*
22 | !/storage/.keep
23 |
24 | /public/assets
25 | .byebug_history
26 |
27 | # Ignore master key for decrypting credentials and more.
28 | /config/master.key
29 |
--------------------------------------------------------------------------------
/spec/dummy_60/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.6.3
2 |
--------------------------------------------------------------------------------
/spec/dummy_60/README.md:
--------------------------------------------------------------------------------
1 | # README
2 |
3 | This README would normally document whatever steps are necessary to get the
4 | application up and running.
5 |
6 | Things you may want to cover:
7 |
8 | * Ruby version
9 |
10 | * System dependencies
11 |
12 | * Configuration
13 |
14 | * Database creation
15 |
16 | * Database initialization
17 |
18 | * How to run the test suite
19 |
20 | * Services (job queues, cache servers, search engines, etc.)
21 |
22 | * Deployment instructions
23 |
24 | * ...
25 |
--------------------------------------------------------------------------------
/spec/dummy_60/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require_relative 'config/application'
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/assets/config/manifest.js:
--------------------------------------------------------------------------------
1 | //= link_tree ../images
2 | //= link_directory ../stylesheets .css
3 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_60/app/assets/images/.keep
--------------------------------------------------------------------------------
/spec/dummy_60/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6 | * vendor/assets/stylesheets directory can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10 | * files in this directory. Styles in this file should be added after the last require_* statement.
11 | * It is generally better to create a new file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/channels/application_cable/channel.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Channel < ActionCable::Channel::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/channels/application_cable/connection.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Connection < ActionCable::Connection::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 |
3 | def current_user
4 | mock = Object.new
5 | def mock.login
6 | 'matz'
7 | end
8 | return mock
9 | end
10 |
11 | def nil_user
12 | return nil
13 | end
14 |
15 | end
16 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_60/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/spec/dummy_60/app/controllers/home_controller.rb:
--------------------------------------------------------------------------------
1 | class HomeController < ApplicationController
2 |
3 | def controller_error
4 | nil.foo
5 | render(:text => 'did not fail')
6 | end
7 |
8 | def model_error
9 | s = StoredException.new
10 | s.failure
11 | render(:text => 'did not fail')
12 | end
13 |
14 | def view_error
15 | end
16 |
17 | def custom_layout
18 | render :action => 'view_error', :layout => 'custom'
19 | end
20 |
21 | def syntax_error
22 | eval("arr = [")
23 | render(:text => 'did not fail')
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/javascript/channels/consumer.js:
--------------------------------------------------------------------------------
1 | // Action Cable provides the framework to deal with WebSockets in Rails.
2 | // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3 |
4 | import { createConsumer } from "@rails/actioncable"
5 |
6 | export default createConsumer()
7 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/javascript/channels/index.js:
--------------------------------------------------------------------------------
1 | // Load all the channels within this directory and all subdirectories.
2 | // Channel files must be named *_channel.js.
3 |
4 | const channels = require.context('.', true, /_channel\.js$/)
5 | channels.keys().forEach(channels)
6 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/javascript/packs/application.js:
--------------------------------------------------------------------------------
1 | // This file is automatically compiled by Webpack, along with any other files
2 | // present in this directory. You're encouraged to place your actual application logic in
3 | // a relevant structure within app/javascript and only use these pack files to reference
4 | // that code so it'll be compiled.
5 |
6 | require("@rails/ujs").start()
7 | require("turbolinks").start()
8 | require("@rails/activestorage").start()
9 | require("channels")
10 |
11 |
12 | // Uncomment to copy all static images under ../images to the output folder and reference
13 | // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
14 | // or the `imagePath` JavaScript helper below.
15 | //
16 | // const images = require.context('../images', true)
17 | // const imagePath = (name) => images(name, true)
18 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | # Automatically retry jobs that encountered a deadlock
3 | # retry_on ActiveRecord::Deadlocked
4 |
5 | # Most jobs are safe to ignore if the underlying records are no longer available
6 | # discard_on ActiveJob::DeserializationError
7 | end
8 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: 'from@example.com'
3 | layout 'mailer'
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | self.abstract_class = true
3 | end
4 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_60/app/models/concerns/.keep
--------------------------------------------------------------------------------
/spec/dummy_60/app/models/stored_exception.rb:
--------------------------------------------------------------------------------
1 | # Only used for testing model errors
2 | class StoredException < ApplicationRecord
3 | self.table_name = :error_messages
4 |
5 | def failure
6 | nil.foo
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/views/home/view_error.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= nil.foo %>
3 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_application_layout
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/views/layouts/custom.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_custom_layout
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/views/layouts/fallback.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_fallback_layout
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/spec/dummy_60/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/spec/dummy_60/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | APP_PATH = File.expand_path('../config/application', __dir__)
8 | require_relative '../config/boot'
9 | require 'rails/commands'
10 |
--------------------------------------------------------------------------------
/spec/dummy_60/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | require_relative '../config/boot'
8 | require 'rake'
9 | Rake.application.run
10 |
--------------------------------------------------------------------------------
/spec/dummy_60/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'fileutils'
3 |
4 | # path to your application root.
5 | APP_ROOT = File.expand_path('..', __dir__)
6 |
7 | def system!(*args)
8 | system(*args) || abort("\n== Command #{args} failed ==")
9 | end
10 |
11 | FileUtils.chdir APP_ROOT do
12 | # This script is a way to setup or update your development environment automatically.
13 | # This script is idempotent, so that you can run it at anytime and get an expectable outcome.
14 | # Add necessary setup steps to this file.
15 |
16 | puts '== Installing dependencies =='
17 | system! 'gem install bundler --conservative'
18 | system('bundle check') || system!('bundle install')
19 |
20 | # Install JavaScript dependencies
21 | # system('bin/yarn')
22 |
23 | # puts "\n== Copying sample files =="
24 | # unless File.exist?('config/database.yml')
25 | # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
26 | # end
27 |
28 | puts "\n== Preparing database =="
29 | system! 'bin/rails db:prepare'
30 |
31 | puts "\n== Removing old logs and tempfiles =="
32 | system! 'bin/rails log:clear tmp:clear'
33 |
34 | puts "\n== Restarting application server =="
35 | system! 'bin/rails restart'
36 | end
37 |
--------------------------------------------------------------------------------
/spec/dummy_60/bin/spring:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # This file loads Spring without using Bundler, in order to be fast.
4 | # It gets overwritten when you run the `spring binstub` command.
5 |
6 | unless defined?(Spring)
7 | require 'rubygems'
8 | require 'bundler'
9 |
10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11 | spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
12 | if spring
13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14 | gem 'spring', spring.version
15 | require 'spring/binstub'
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/spec/dummy_60/bin/yarn:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_ROOT = File.expand_path('..', __dir__)
3 | Dir.chdir(APP_ROOT) do
4 | begin
5 | exec "yarnpkg", *ARGV
6 | rescue Errno::ENOENT
7 | $stderr.puts "Yarn executable was not detected in the system."
8 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9 | exit 1
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/spec/dummy_60/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require_relative 'config/environment'
4 |
5 | run Rails.application
6 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/application.rb:
--------------------------------------------------------------------------------
1 | require_relative 'boot'
2 |
3 | require 'rails/all'
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module ExceptionHandlerTestApp
10 | class Application < Rails::Application
11 | # Initialize configuration defaults for originally generated Rails version.
12 | config.load_defaults 6.0
13 |
14 | # Settings in config/environments/* take precedence over those specified here.
15 | # Application configuration can go into files in config/initializers
16 | # -- all .rb files in that directory are automatically loaded after loading
17 | # the framework and any gems in your application.
18 |
19 | RailsExceptionHandler.configure do |config|
20 | config.environments = [:test]
21 | config.storage_strategies = [:active_record]
22 | end
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2 |
3 | require 'bundler/setup' # Set up gems listed in the Gemfile.
4 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: test
6 |
7 | production:
8 | adapter: redis
9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10 | channel_prefix: exception_handler_test_app_production
11 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/credentials.yml.enc:
--------------------------------------------------------------------------------
1 | Vrooftbt3GvF8K9J1+SkZ1Wt2qnG0fPdNRAxaYesqRsfThV/Xu1PEa3iYEX7KW1zn6+GhXPgVd5RD0BZXnIfxgG8odbQDtY5/8HUZnvrjCTf2l7HZvyTdCQqtgPMWKowu3dt7GivBzbQFAbQRi8s2Pkz9SVjunyBHyarYErpXxPbcryFPKX6xRytv5yRJIQr8y8DRsUrSUAKGexWJL0YEXGDl+3jJyqQK/4ZGw3b9QN3jbTnriQIhKFrLa/sLjut0afjwPNOa8m+GZj9lVQvBWap18Tyw3OC2GVeFxLGx7oa/F4ZynnTAoj9YBjY2ldGjx7nQYneCOlxXjFl+4k3rkuS8RI9HsiV1b1Rz7G94VtOOPssyuwD+l1s+r+SlKE+yPHaRXF6GZcgAZk1Ivmc5zQrlJsHnzEhyBn3--RHDozNwSHUF2Chjy--lZ/ekj1U5ikZnBVw5dELXA==
--------------------------------------------------------------------------------
/spec/dummy_60/config/database.yml:
--------------------------------------------------------------------------------
1 | test: &test
2 | adapter: sqlite3
3 | database: ../db/test.sqlite3
4 | pool: 5
5 | timeout: 5000
6 |
7 |
8 | exception_database:
9 | <<: *test
10 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative 'application'
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/initializers/application_controller_renderer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # ActiveSupport::Reloader.to_prepare do
4 | # ApplicationController.renderer.defaults.merge!(
5 | # http_host: 'example.org',
6 | # https: false
7 | # )
8 | # end
9 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = '1.0'
5 |
6 | # Add additional assets to the asset load path.
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 | # Add Yarn node_modules folder to the asset load path.
9 | Rails.application.config.assets.paths << Rails.root.join('node_modules')
10 |
11 | # Precompile additional assets.
12 | # application.js, application.css, and all non-JS/CSS in the app/assets
13 | # folder are already added.
14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css )
15 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/initializers/content_security_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide content security policy
4 | # For further information see the following documentation
5 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6 |
7 | # Rails.application.config.content_security_policy do |policy|
8 | # policy.default_src :self, :https
9 | # policy.font_src :self, :https, :data
10 | # policy.img_src :self, :https, :data
11 | # policy.object_src :none
12 | # policy.script_src :self, :https
13 | # policy.style_src :self, :https
14 | # # If you are using webpack-dev-server then specify webpack-dev-server host
15 | # policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
16 |
17 | # # Specify URI for violation reports
18 | # # policy.report_uri "/csp-violation-report-endpoint"
19 | # end
20 |
21 | # If you are using UJS then enable automatic nonce generation
22 | # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
23 |
24 | # Set the nonce only to specific directives
25 | # Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
26 |
27 | # Report CSP violations to a specified URI
28 | # For further information see the following documentation:
29 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
30 | # Rails.application.config.content_security_policy_report_only = true
31 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Specify a serializer for the signed and encrypted cookie jars.
4 | # Valid options are :json, :marshal, and :hybrid.
5 | Rails.application.config.action_dispatch.cookies_serializer = :json
6 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json]
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # The following keys must be escaped otherwise they will not be retrieved by
20 | # the default I18n backend:
21 | #
22 | # true, false, on, off, yes, no
23 | #
24 | # Instead, surround them with single quotes.
25 | #
26 | # en:
27 | # 'true': 'foo'
28 | #
29 | # To learn more, please read the Rails Internationalization guide
30 | # available at https://guides.rubyonrails.org/i18n.html.
31 |
32 | en:
33 | hello: "Hello world"
34 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/mongoid.yml:
--------------------------------------------------------------------------------
1 | test:
2 | clients:
3 | default:
4 | database: this_database_doesnt_matter
5 | hosts:
6 | - localhost:27017
7 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
3 | get 'home/controller_error' => 'home#controller_error'
4 | get 'home/model_error' => 'home#model_error'
5 | get 'home/view_error' => 'home#view_error'
6 | get 'home/custom_layout' => 'home#custom_layout'
7 | get 'home/syntax_error' => 'home#syntax_error'
8 | end
9 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/spring.rb:
--------------------------------------------------------------------------------
1 | Spring.watch(
2 | ".ruby-version",
3 | ".rbenv-vars",
4 | "tmp/restart.txt",
5 | "tmp/caching-dev.txt"
6 | )
7 |
--------------------------------------------------------------------------------
/spec/dummy_60/config/storage.yml:
--------------------------------------------------------------------------------
1 | test:
2 | service: Disk
3 | root: <%= Rails.root.join("tmp/storage") %>
4 |
5 | local:
6 | service: Disk
7 | root: <%= Rails.root.join("storage") %>
8 |
9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 | # amazon:
11 | # service: S3
12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 | # region: us-east-1
15 | # bucket: your_own_bucket
16 |
17 | # Remember not to checkin your GCS keyfile to a repository
18 | # google:
19 | # service: GCS
20 | # project: your_project
21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22 | # bucket: your_own_bucket
23 |
24 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25 | # microsoft:
26 | # service: AzureStorage
27 | # storage_account_name: your_account_name
28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29 | # container: your_container_name
30 |
31 | # mirror:
32 | # service: Mirror
33 | # primary: local
34 | # mirrors: [ amazon, google, microsoft ]
35 |
--------------------------------------------------------------------------------
/spec/dummy_60/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_60/lib/assets/.keep
--------------------------------------------------------------------------------
/spec/dummy_60/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_60/lib/tasks/.keep
--------------------------------------------------------------------------------
/spec/dummy_60/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_60/log/.keep
--------------------------------------------------------------------------------
/spec/dummy_60/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_60/public/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/spec/dummy_60/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_60/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/spec/dummy_60/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_60/public/favicon.ico
--------------------------------------------------------------------------------
/spec/dummy_60/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/spec/dummy_60/tmp/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_60/tmp/.keep
--------------------------------------------------------------------------------
/spec/dummy_70/.gitattributes:
--------------------------------------------------------------------------------
1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files.
2 |
3 | # Mark the database schema as having been generated.
4 | db/schema.rb linguist-generated
5 |
6 | # Mark any vendored files as having been vendored.
7 | vendor/* linguist-vendored
8 |
--------------------------------------------------------------------------------
/spec/dummy_70/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile '~/.gitignore_global'
6 |
7 | # Ignore bundler config.
8 | /.bundle
9 |
10 | # Ignore the default SQLite database.
11 | /db/*.sqlite3
12 | /db/*.sqlite3-*
13 |
14 | # Ignore all logfiles and tempfiles.
15 | /log/*
16 | /tmp/*
17 | !/log/.keep
18 | !/tmp/.keep
19 |
20 | # Ignore pidfiles, but keep the directory.
21 | /tmp/pids/*
22 | !/tmp/pids/
23 | !/tmp/pids/.keep
24 |
25 | # Ignore uploaded files in development.
26 | /storage/*
27 | !/storage/.keep
28 | /tmp/storage/*
29 | !/tmp/storage/
30 | !/tmp/storage/.keep
31 |
32 | /public/assets
33 |
34 | # Ignore master key for decrypting credentials and more.
35 | /config/master.key
36 |
--------------------------------------------------------------------------------
/spec/dummy_70/.ruby-version:
--------------------------------------------------------------------------------
1 | 3.0.3
2 |
--------------------------------------------------------------------------------
/spec/dummy_70/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require_relative "config/application"
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/assets/config/manifest.js:
--------------------------------------------------------------------------------
1 | //= link_tree ../images
2 | //= link_directory ../stylesheets .css
3 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/app/assets/images/.keep
--------------------------------------------------------------------------------
/spec/dummy_70/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
6 | * vendor/assets/stylesheets directory can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS
10 | * files in this directory. Styles in this file should be added after the last require_* statement.
11 | * It is generally better to create a new file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/channels/application_cable/channel.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Channel < ActionCable::Channel::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/channels/application_cable/connection.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Connection < ActionCable::Connection::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 |
3 | def current_user
4 | mock = Object.new
5 | def mock.login
6 | 'matz'
7 | end
8 | return mock
9 | end
10 |
11 | def nil_user
12 | return nil
13 | end
14 |
15 | end
16 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/spec/dummy_70/app/controllers/home_controller.rb:
--------------------------------------------------------------------------------
1 | class HomeController < ApplicationController
2 |
3 | def controller_error
4 | nil.foo
5 | render(:text => 'did not fail')
6 | end
7 |
8 | def model_error
9 | s = StoredException.new
10 | s.failure
11 | render(:text => 'did not fail')
12 | end
13 |
14 | def view_error
15 | end
16 |
17 | def custom_layout
18 | render :action => 'view_error', :layout => 'custom'
19 | end
20 |
21 | def syntax_error
22 | eval("arr = [")
23 | render(:text => 'did not fail')
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | # Automatically retry jobs that encountered a deadlock
3 | # retry_on ActiveRecord::Deadlocked
4 |
5 | # Most jobs are safe to ignore if the underlying records are no longer available
6 | # discard_on ActiveJob::DeserializationError
7 | end
8 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: "from@example.com"
3 | layout "mailer"
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | primary_abstract_class
3 | end
4 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/app/models/concerns/.keep
--------------------------------------------------------------------------------
/spec/dummy_70/app/models/stored_exception.rb:
--------------------------------------------------------------------------------
1 | # Only used for testing model errors
2 | class StoredException < ApplicationRecord
3 | self.table_name = :error_messages
4 |
5 | def failure
6 | nil.foo
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/views/home/view_error.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= nil.foo %>
3 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_application_layout
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/views/layouts/custom.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_custom_layout
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/views/layouts/fallback.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_fallback_layout
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/spec/dummy_70/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/spec/dummy_70/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path("../config/application", __dir__)
3 | require_relative "../config/boot"
4 | require "rails/commands"
5 |
--------------------------------------------------------------------------------
/spec/dummy_70/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative "../config/boot"
3 | require "rake"
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/spec/dummy_70/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "fileutils"
3 |
4 | # path to your application root.
5 | APP_ROOT = File.expand_path("..", __dir__)
6 |
7 | def system!(*args)
8 | system(*args) || abort("\n== Command #{args} failed ==")
9 | end
10 |
11 | FileUtils.chdir APP_ROOT do
12 | # This script is a way to set up or update your development environment automatically.
13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14 | # Add necessary setup steps to this file.
15 |
16 | puts "== Installing dependencies =="
17 | system! "gem install bundler --conservative"
18 | system("bundle check") || system!("bundle install")
19 |
20 | # puts "\n== Copying sample files =="
21 | # unless File.exist?("config/database.yml")
22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml"
23 | # end
24 |
25 | puts "\n== Preparing database =="
26 | system! "bin/rails db:prepare"
27 |
28 | puts "\n== Removing old logs and tempfiles =="
29 | system! "bin/rails log:clear tmp:clear"
30 |
31 | puts "\n== Restarting application server =="
32 | system! "bin/rails restart"
33 | end
34 |
--------------------------------------------------------------------------------
/spec/dummy_70/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require_relative "config/environment"
4 |
5 | run Rails.application
6 | Rails.application.load_server
7 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/application.rb:
--------------------------------------------------------------------------------
1 | require_relative "boot"
2 |
3 | require "rails/all"
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module ExceptionHandlerTestApp
10 | class Application < Rails::Application
11 | # Initialize configuration defaults for originally generated Rails version.
12 | config.load_defaults 7.0
13 |
14 | # Configuration for the application, engines, and railties goes here.
15 | #
16 | # These settings can be overridden in specific environments using the files
17 | # in config/environments, which are processed later.
18 | #
19 | # config.time_zone = "Central Time (US & Canada)"
20 | # config.eager_load_paths << Rails.root.join("extras")
21 |
22 | RailsExceptionHandler.configure do |config|
23 | config.environments = [:test]
24 | config.storage_strategies = [:active_record]
25 | end
26 | end
27 | end
28 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2 |
3 | require "bundler/setup" # Set up gems listed in the Gemfile.
4 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: test
6 |
7 | production:
8 | adapter: redis
9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10 | channel_prefix: dummy_70_production
11 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/credentials.yml.enc:
--------------------------------------------------------------------------------
1 | fAlrT7mGM03eHJZYhVjLP6Eofzi/JeSBP8hgvzfO/K/fKA2DtqVQQoBNWsE50sBTjMDsaY/wvJhB/mDpxh/fiU7CdUPCbnsO9h3bQ+h2JEe7UQie8conNa4oehG+2jMasZU39wYKpBG4Y0DIpnqpJAzvar5Q1cFPn1WRB1ZSSB8baPDtQY9h1YLNdtSyf5nl0jL0O6Q19lTPGrCcd47G73ddpecILLNGK6FuE+9ayMcnIaipgHYfELQOBnj30MyMrJL2gzNIwtXaUhLyA5CAs7jdTamNz/Gy84bWLHhwU9U5IjfPMoAYilrnaOfzI5bSOL7gW3rqtiKbeMYLUEozyZNK5hbCrPHM7sV8pxatF/c/78zyuXkq38Pyc58NFXBpEizm8ldfjwriUiwo98OdnXIxl7cZ3xSQfV5U--BrZT9G/Mm4nMbQ/D--D+zAeAIlqOTGErEALznzEw==
--------------------------------------------------------------------------------
/spec/dummy_70/config/database.yml:
--------------------------------------------------------------------------------
1 | test: &test
2 | adapter: sqlite3
3 | database: ../db/test.sqlite3
4 | pool: 5
5 | timeout: 5000
6 |
7 |
8 | exception_database:
9 | <<: *test
10 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative "application"
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = "1.0"
5 |
6 | # Add additional assets to the asset load path.
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 |
9 | # Precompile additional assets.
10 | # application.js, application.css, and all non-JS/CSS in the app/assets
11 | # folder are already added.
12 | # Rails.application.config.assets.precompile += %w( admin.js admin.css )
13 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/initializers/content_security_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide content security policy
4 | # For further information see the following documentation
5 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6 |
7 | # Rails.application.configure do
8 | # config.content_security_policy do |policy|
9 | # policy.default_src :self, :https
10 | # policy.font_src :self, :https, :data
11 | # policy.img_src :self, :https, :data
12 | # policy.object_src :none
13 | # policy.script_src :self, :https
14 | # policy.style_src :self, :https
15 | # # Specify URI for violation reports
16 | # # policy.report_uri "/csp-violation-report-endpoint"
17 | # end
18 | #
19 | # # Generate session nonces for permitted importmap and inline scripts
20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21 | # config.content_security_policy_nonce_directives = %w(script-src)
22 | #
23 | # # Report CSP violations to a specified URI. See:
24 | # # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
25 | # # config.content_security_policy_report_only = true
26 | # end
27 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of
4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
5 | # notations and behaviors.
6 | Rails.application.config.filter_parameters += [
7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
8 | ]
9 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, "\\1en"
8 | # inflect.singular /^(ox)en/i, "\\1"
9 | # inflect.irregular "person", "people"
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym "RESTful"
16 | # end
17 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/initializers/permissions_policy.rb:
--------------------------------------------------------------------------------
1 | # Define an application-wide HTTP permissions policy. For further
2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy
3 | #
4 | # Rails.application.config.permissions_policy do |f|
5 | # f.camera :none
6 | # f.gyroscope :none
7 | # f.microphone :none
8 | # f.usb :none
9 | # f.fullscreen :self
10 | # f.payment :self, "https://secure.example.com"
11 | # end
12 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t "hello"
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t("hello") %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # The following keys must be escaped otherwise they will not be retrieved by
20 | # the default I18n backend:
21 | #
22 | # true, false, on, off, yes, no
23 | #
24 | # Instead, surround them with single quotes.
25 | #
26 | # en:
27 | # "true": "foo"
28 | #
29 | # To learn more, please read the Rails Internationalization guide
30 | # available at https://guides.rubyonrails.org/i18n.html.
31 |
32 | en:
33 | hello: "Hello world"
34 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | get 'home/controller_error' => 'home#controller_error'
3 | get 'home/model_error' => 'home#model_error'
4 | get 'home/view_error' => 'home#view_error'
5 | get 'home/custom_layout' => 'home#custom_layout'
6 | get 'home/syntax_error' => 'home#syntax_error'
7 | end
8 |
--------------------------------------------------------------------------------
/spec/dummy_70/config/storage.yml:
--------------------------------------------------------------------------------
1 | test:
2 | service: Disk
3 | root: <%= Rails.root.join("tmp/storage") %>
4 |
5 | local:
6 | service: Disk
7 | root: <%= Rails.root.join("storage") %>
8 |
9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 | # amazon:
11 | # service: S3
12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 | # region: us-east-1
15 | # bucket: your_own_bucket-<%= Rails.env %>
16 |
17 | # Remember not to checkin your GCS keyfile to a repository
18 | # google:
19 | # service: GCS
20 | # project: your_project
21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22 | # bucket: your_own_bucket-<%= Rails.env %>
23 |
24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25 | # microsoft:
26 | # service: AzureStorage
27 | # storage_account_name: your_account_name
28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29 | # container: your_container_name-<%= Rails.env %>
30 |
31 | # mirror:
32 | # service: Mirror
33 | # primary: local
34 | # mirrors: [ amazon, google, microsoft ]
35 |
--------------------------------------------------------------------------------
/spec/dummy_70/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/lib/assets/.keep
--------------------------------------------------------------------------------
/spec/dummy_70/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/lib/tasks/.keep
--------------------------------------------------------------------------------
/spec/dummy_70/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/log/.keep
--------------------------------------------------------------------------------
/spec/dummy_70/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/public/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/spec/dummy_70/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/spec/dummy_70/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/public/favicon.ico
--------------------------------------------------------------------------------
/spec/dummy_70/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/spec/dummy_70/tmp/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/tmp/.keep
--------------------------------------------------------------------------------
/spec/dummy_70/tmp/pids/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/tmp/pids/.keep
--------------------------------------------------------------------------------
/spec/dummy_70/tmp/storage/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_70/tmp/storage/.keep
--------------------------------------------------------------------------------
/spec/dummy_71/.dockerignore:
--------------------------------------------------------------------------------
1 | # See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2 |
3 | # Ignore git directory.
4 | /.git/
5 |
6 | # Ignore bundler config.
7 | /.bundle
8 |
9 | # Ignore all environment files (except templates).
10 | /.env*
11 | !/.env*.erb
12 |
13 | # Ignore all default key files.
14 | /config/master.key
15 | /config/credentials/*.key
16 |
17 | # Ignore all logfiles and tempfiles.
18 | /log/*
19 | /tmp/*
20 | !/log/.keep
21 | !/tmp/.keep
22 |
23 | # Ignore pidfiles, but keep the directory.
24 | /tmp/pids/*
25 | !/tmp/pids/.keep
26 |
27 | # Ignore storage (uploaded files in development and any SQLite databases).
28 | /storage/*
29 | !/storage/.keep
30 | /tmp/storage/*
31 | !/tmp/storage/.keep
32 |
33 | # Ignore assets.
34 | /node_modules/
35 | /app/assets/builds/*
36 | !/app/assets/builds/.keep
37 | /public/assets
38 |
--------------------------------------------------------------------------------
/spec/dummy_71/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require_relative "config/application"
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/assets/config/manifest.js:
--------------------------------------------------------------------------------
1 | //= link_tree ../images
2 | //= link_directory ../stylesheets .css
3 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/app/assets/images/.keep
--------------------------------------------------------------------------------
/spec/dummy_71/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
6 | * vendor/assets/stylesheets directory can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS
10 | * files in this directory. Styles in this file should be added after the last require_* statement.
11 | * It is generally better to create a new file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/channels/application_cable/channel.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Channel < ActionCable::Channel::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/channels/application_cable/connection.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Connection < ActionCable::Connection::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 |
3 | def current_user
4 | mock = Object.new
5 | def mock.login
6 | 'matz'
7 | end
8 | return mock
9 | end
10 |
11 | def nil_user
12 | return nil
13 | end
14 |
15 | end
16 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/spec/dummy_71/app/controllers/home_controller.rb:
--------------------------------------------------------------------------------
1 | class HomeController < ApplicationController
2 |
3 | def controller_error
4 | nil.foo
5 | render(:text => 'did not fail')
6 | end
7 |
8 | def model_error
9 | s = StoredException.new
10 | s.failure
11 | render(:text => 'did not fail')
12 | end
13 |
14 | def view_error
15 | end
16 |
17 | def custom_layout
18 | render :action => 'view_error', :layout => 'custom'
19 | end
20 |
21 | def syntax_error
22 | eval("arr = [")
23 | render(:text => 'did not fail')
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | # Automatically retry jobs that encountered a deadlock
3 | # retry_on ActiveRecord::Deadlocked
4 |
5 | # Most jobs are safe to ignore if the underlying records are no longer available
6 | # discard_on ActiveJob::DeserializationError
7 | end
8 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: "from@example.com"
3 | layout "mailer"
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | primary_abstract_class
3 | end
4 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/app/models/concerns/.keep
--------------------------------------------------------------------------------
/spec/dummy_71/app/models/stored_exception.rb:
--------------------------------------------------------------------------------
1 | # Only used for testing model errors
2 | class StoredException < ApplicationRecord
3 | self.table_name = :error_messages
4 |
5 | def failure
6 | nil.foo
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/views/home/view_error.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= nil.foo %>
3 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_application_layout
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/views/layouts/custom.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_custom_layout
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/views/layouts/fallback.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_fallback_layout
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/spec/dummy_71/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/spec/dummy_71/bin/docker-entrypoint:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | # If running the rails server then create or migrate existing database
4 | if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
5 | ./bin/rails db:prepare
6 | fi
7 |
8 | exec "${@}"
9 |
--------------------------------------------------------------------------------
/spec/dummy_71/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path("../config/application", __dir__)
3 | require_relative "../config/boot"
4 | require "rails/commands"
5 |
--------------------------------------------------------------------------------
/spec/dummy_71/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative "../config/boot"
3 | require "rake"
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/spec/dummy_71/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "fileutils"
3 |
4 | # path to your application root.
5 | APP_ROOT = File.expand_path("..", __dir__)
6 |
7 | def system!(*args)
8 | system(*args, exception: true)
9 | end
10 |
11 | FileUtils.chdir APP_ROOT do
12 | # This script is a way to set up or update your development environment automatically.
13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14 | # Add necessary setup steps to this file.
15 |
16 | puts "== Installing dependencies =="
17 | system! "gem install bundler --conservative"
18 | system("bundle check") || system!("bundle install")
19 |
20 | # puts "\n== Copying sample files =="
21 | # unless File.exist?("config/database.yml")
22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml"
23 | # end
24 |
25 | puts "\n== Preparing database =="
26 | system! "bin/rails db:prepare"
27 |
28 | puts "\n== Removing old logs and tempfiles =="
29 | system! "bin/rails log:clear tmp:clear"
30 |
31 | puts "\n== Restarting application server =="
32 | system! "bin/rails restart"
33 | end
34 |
--------------------------------------------------------------------------------
/spec/dummy_71/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require_relative "config/environment"
4 |
5 | run Rails.application
6 | Rails.application.load_server
7 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/application.rb:
--------------------------------------------------------------------------------
1 | require_relative "boot"
2 |
3 | require "rails/all"
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module ExceptionHandlerTestApp
10 | class Application < Rails::Application
11 | # Initialize configuration defaults for originally generated Rails version.
12 | config.load_defaults 7.1
13 |
14 | # Please, add to the `ignore` list any other `lib` subdirectories that do
15 | # not contain `.rb` files, or that should not be reloaded or eager loaded.
16 | # Common ones are `templates`, `generators`, or `middleware`, for example.
17 | config.autoload_lib(ignore: %w(assets tasks))
18 |
19 | # Configuration for the application, engines, and railties goes here.
20 | #
21 | # These settings can be overridden in specific environments using the files
22 | # in config/environments, which are processed later.
23 | #
24 | # config.time_zone = "Central Time (US & Canada)"
25 | # config.eager_load_paths << Rails.root.join("extras")
26 |
27 | RailsExceptionHandler.configure do |config|
28 | config.environments = [:test]
29 | config.storage_strategies = [:active_record]
30 | end
31 | end
32 | end
33 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2 |
3 | require "bundler/setup" # Set up gems listed in the Gemfile.
4 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: test
6 |
7 | production:
8 | adapter: redis
9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10 | channel_prefix: dummy_71_production
11 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/credentials.yml.enc:
--------------------------------------------------------------------------------
1 | Or57A3Q9uQynRgvvpu0DTR5VZW/CXULmjIMpr1+aWA11DweeXU/oFGUqeX8FiXF/qcLoR4E8bTFqtlOR+vJobqAUdMNxMJj7ZaraiNE5yf3qwGsfKxvZFXVh4X37HinJ2gP9Ez9mX0/xzcV/M5ZaMRB5siPN7AYTKb4vpH3aIvyz/ETy1YqIUoAc5HHjqd70RwhG9RNuuHGFhgy6cO/9Ciu0CyXqvyoh1RxJ/YU6myYMUyGVJIUK8LtF04nrCeB0UHNYePq68Y9+Ctf/t37A/QX7Z6m8b2kIlSd2ZfXSJIBBWPk2foNYSTBfybf3Nams5Ojn8ucW6xsEh2YbiQFIKwqRxV36O5tqa7/quTJXv79K5oSCdN6guer5S+ieRikM7E65iW9miqQWwrS/egOVKcp5Fh4P--g/vUbhOhk7USqlel--+5fL2uO5NUAgWZb4JAw+8Q==
--------------------------------------------------------------------------------
/spec/dummy_71/config/database.yml:
--------------------------------------------------------------------------------
1 | test: &test
2 | adapter: sqlite3
3 | database: ../db/test.sqlite3
4 | pool: 5
5 | timeout: 5000
6 |
7 |
8 | exception_database:
9 | <<: *test
10 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative "application"
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = "1.0"
5 |
6 | # Add additional assets to the asset load path.
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 |
9 | # Precompile additional assets.
10 | # application.js, application.css, and all non-JS/CSS in the app/assets
11 | # folder are already added.
12 | # Rails.application.config.assets.precompile += %w( admin.js admin.css )
13 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/initializers/content_security_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide content security policy.
4 | # See the Securing Rails Applications Guide for more information:
5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header
6 |
7 | # Rails.application.configure do
8 | # config.content_security_policy do |policy|
9 | # policy.default_src :self, :https
10 | # policy.font_src :self, :https, :data
11 | # policy.img_src :self, :https, :data
12 | # policy.object_src :none
13 | # policy.script_src :self, :https
14 | # policy.style_src :self, :https
15 | # # Specify URI for violation reports
16 | # # policy.report_uri "/csp-violation-report-endpoint"
17 | # end
18 | #
19 | # # Generate session nonces for permitted importmap, inline scripts, and inline styles.
20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21 | # config.content_security_policy_nonce_directives = %w(script-src style-src)
22 | #
23 | # # Report violations without enforcing the policy.
24 | # # config.content_security_policy_report_only = true
25 | # end
26 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4 | # Use this to limit dissemination of sensitive information.
5 | # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6 | Rails.application.config.filter_parameters += [
7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
8 | ]
9 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, "\\1en"
8 | # inflect.singular /^(ox)en/i, "\\1"
9 | # inflect.irregular "person", "people"
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym "RESTful"
16 | # end
17 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/initializers/permissions_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide HTTP permissions policy. For further
4 | # information see: https://developers.google.com/web/updates/2018/06/feature-policy
5 |
6 | # Rails.application.config.permissions_policy do |policy|
7 | # policy.camera :none
8 | # policy.gyroscope :none
9 | # policy.microphone :none
10 | # policy.usb :none
11 | # policy.fullscreen :self
12 | # policy.payment :self, "https://secure.example.com"
13 | # end
14 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization and
2 | # are automatically loaded by Rails. If you want to use locales other than
3 | # English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t "hello"
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t("hello") %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more about the API, please read the Rails Internationalization guide
20 | # at https://guides.rubyonrails.org/i18n.html.
21 | #
22 | # Be aware that YAML interprets the following case-insensitive strings as
23 | # booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
24 | # must be quoted to be interpreted as strings. For example:
25 | #
26 | # en:
27 | # "yes": yup
28 | # enabled: "ON"
29 |
30 | en:
31 | hello: "Hello world"
32 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/master.key:
--------------------------------------------------------------------------------
1 | 5e1ecc679cf40eaa9c273a29115e942c
--------------------------------------------------------------------------------
/spec/dummy_71/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | get 'home/controller_error' => 'home#controller_error'
3 | get 'home/model_error' => 'home#model_error'
4 | get 'home/view_error' => 'home#view_error'
5 | get 'home/custom_layout' => 'home#custom_layout'
6 | get 'home/syntax_error' => 'home#syntax_error'
7 | end
8 |
--------------------------------------------------------------------------------
/spec/dummy_71/config/storage.yml:
--------------------------------------------------------------------------------
1 | test:
2 | service: Disk
3 | root: <%= Rails.root.join("tmp/storage") %>
4 |
5 | local:
6 | service: Disk
7 | root: <%= Rails.root.join("storage") %>
8 |
9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 | # amazon:
11 | # service: S3
12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 | # region: us-east-1
15 | # bucket: your_own_bucket-<%= Rails.env %>
16 |
17 | # Remember not to checkin your GCS keyfile to a repository
18 | # google:
19 | # service: GCS
20 | # project: your_project
21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22 | # bucket: your_own_bucket-<%= Rails.env %>
23 |
24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25 | # microsoft:
26 | # service: AzureStorage
27 | # storage_account_name: your_account_name
28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29 | # container: your_container_name-<%= Rails.env %>
30 |
31 | # mirror:
32 | # service: Mirror
33 | # primary: local
34 | # mirrors: [ amazon, google, microsoft ]
35 |
--------------------------------------------------------------------------------
/spec/dummy_71/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/lib/assets/.keep
--------------------------------------------------------------------------------
/spec/dummy_71/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/lib/tasks/.keep
--------------------------------------------------------------------------------
/spec/dummy_71/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/log/.keep
--------------------------------------------------------------------------------
/spec/dummy_71/log/test.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/log/test.log
--------------------------------------------------------------------------------
/spec/dummy_71/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/public/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/spec/dummy_71/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/spec/dummy_71/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/public/favicon.ico
--------------------------------------------------------------------------------
/spec/dummy_71/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/spec/dummy_71/tmp/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/tmp/.keep
--------------------------------------------------------------------------------
/spec/dummy_71/tmp/local_secret.txt:
--------------------------------------------------------------------------------
1 | e8192f65f22424227b70228db5289e98ab18016b803052878d3c5728002657c54d3b2823f11bea27c3e7df8efe09bfa962f1d715f6310818394568f604e8e39b
--------------------------------------------------------------------------------
/spec/dummy_71/tmp/pids/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/tmp/pids/.keep
--------------------------------------------------------------------------------
/spec/dummy_71/tmp/storage/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_71/tmp/storage/.keep
--------------------------------------------------------------------------------
/spec/dummy_80/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require_relative "config/application"
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/assets/config/manifest.js:
--------------------------------------------------------------------------------
1 | //= link_tree ../images
2 | //= link_directory ../javascripts .js
3 | //= link_directory ../stylesheets .css
4 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_80/app/assets/images/.keep
--------------------------------------------------------------------------------
/spec/dummy_80/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css.
3 | *
4 | * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
5 | * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
6 | * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
7 | * depending on specificity.
8 | *
9 | * Consider organizing styles into separate files for maintainability.
10 | */
11 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
3 | # allow_browser versions: :modern
4 |
5 | def current_user
6 | mock = Object.new
7 | def mock.login
8 | 'matz'
9 | end
10 | return mock
11 | end
12 |
13 | def nil_user
14 | return nil
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_80/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/spec/dummy_80/app/controllers/home_controller.rb:
--------------------------------------------------------------------------------
1 | class HomeController < ApplicationController
2 |
3 | def controller_error
4 | nil.foo
5 | render(:text => 'did not fail')
6 | end
7 |
8 | def model_error
9 | s = StoredException.new
10 | s.failure
11 | render(:text => 'did not fail')
12 | end
13 |
14 | def view_error
15 | end
16 |
17 | def custom_layout
18 | render :action => 'view_error', :layout => 'custom'
19 | end
20 |
21 | def syntax_error
22 | eval("arr = [")
23 | render(:text => 'did not fail')
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | # Automatically retry jobs that encountered a deadlock
3 | # retry_on ActiveRecord::Deadlocked
4 |
5 | # Most jobs are safe to ignore if the underlying records are no longer available
6 | # discard_on ActiveJob::DeserializationError
7 | end
8 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: "from@example.com"
3 | layout "mailer"
4 | end
5 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | primary_abstract_class
3 | end
4 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_80/app/models/concerns/.keep
--------------------------------------------------------------------------------
/spec/dummy_80/app/models/stored_exception.rb:
--------------------------------------------------------------------------------
1 | # Only used for testing model errors
2 | class StoredException < ApplicationRecord
3 | self.table_name = :error_messages
4 |
5 | def failure
6 | nil.foo
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/views/home/view_error.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= nil.foo %>
3 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_application_layout
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/views/layouts/custom.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_custom_layout
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/views/layouts/fallback.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ExceptionHandlerTestApp
5 | <%= csrf_meta_tags %>
6 | <%= csp_meta_tag %>
7 |
8 |
9 |
10 | this_is_the_fallback_layout
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/spec/dummy_80/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/spec/dummy_80/bin/brakeman:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "rubygems"
3 | require "bundler/setup"
4 |
5 | ARGV.unshift("--ensure-latest")
6 |
7 | load Gem.bin_path("brakeman", "brakeman")
8 |
--------------------------------------------------------------------------------
/spec/dummy_80/bin/dev:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | exec "./bin/rails", "server", *ARGV
3 |
--------------------------------------------------------------------------------
/spec/dummy_80/bin/docker-entrypoint:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | # Enable jemalloc for reduced memory usage and latency.
4 | if [ -z "${LD_PRELOAD+x}" ]; then
5 | LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit)
6 | export LD_PRELOAD
7 | fi
8 |
9 | # If running the rails server then create or migrate existing database
10 | if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
11 | ./bin/rails db:prepare
12 | fi
13 |
14 | exec "${@}"
15 |
--------------------------------------------------------------------------------
/spec/dummy_80/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path("../config/application", __dir__)
3 | require_relative "../config/boot"
4 | require "rails/commands"
5 |
--------------------------------------------------------------------------------
/spec/dummy_80/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative "../config/boot"
3 | require "rake"
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/spec/dummy_80/bin/rubocop:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "rubygems"
3 | require "bundler/setup"
4 |
5 | # explicit rubocop config increases performance slightly while avoiding config confusion.
6 | ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
7 |
8 | load Gem.bin_path("rubocop", "rubocop")
9 |
--------------------------------------------------------------------------------
/spec/dummy_80/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "fileutils"
3 |
4 | APP_ROOT = File.expand_path("..", __dir__)
5 |
6 | def system!(*args)
7 | system(*args, exception: true)
8 | end
9 |
10 | FileUtils.chdir APP_ROOT do
11 | # This script is a way to set up or update your development environment automatically.
12 | # This script is idempotent, so that you can run it at any time and get an expectable outcome.
13 | # Add necessary setup steps to this file.
14 |
15 | puts "== Installing dependencies =="
16 | system("bundle check") || system!("bundle install")
17 |
18 | # puts "\n== Copying sample files =="
19 | # unless File.exist?("config/database.yml")
20 | # FileUtils.cp "config/database.yml.sample", "config/database.yml"
21 | # end
22 |
23 | puts "\n== Preparing database =="
24 | system! "bin/rails db:prepare"
25 |
26 | puts "\n== Removing old logs and tempfiles =="
27 | system! "bin/rails log:clear tmp:clear"
28 |
29 | unless ARGV.include?("--skip-server")
30 | puts "\n== Starting development server =="
31 | STDOUT.flush # flush the output before exec(2) so that it displays
32 | exec "bin/dev"
33 | end
34 | end
35 |
--------------------------------------------------------------------------------
/spec/dummy_80/bin/thrust:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "rubygems"
3 | require "bundler/setup"
4 |
5 | load Gem.bin_path("thruster", "thrust")
6 |
--------------------------------------------------------------------------------
/spec/dummy_80/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require_relative "config/environment"
4 |
5 | run Rails.application
6 | Rails.application.load_server
7 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/application.rb:
--------------------------------------------------------------------------------
1 | require_relative "boot"
2 |
3 | require "rails/all"
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module ExceptionHandlerTestApp
10 | class Application < Rails::Application
11 | # Initialize configuration defaults for originally generated Rails version.
12 | config.load_defaults 8.0
13 |
14 | # Please, add to the `ignore` list any other `lib` subdirectories that do
15 | # not contain `.rb` files, or that should not be reloaded or eager loaded.
16 | # Common ones are `templates`, `generators`, or `middleware`, for example.
17 | config.autoload_lib(ignore: %w[assets tasks])
18 |
19 | # Configuration for the application, engines, and railties goes here.
20 | #
21 | # These settings can be overridden in specific environments using the files
22 | # in config/environments, which are processed later.
23 | #
24 | # config.time_zone = "Central Time (US & Canada)"
25 | # config.eager_load_paths << Rails.root.join("extras")
26 |
27 | RailsExceptionHandler.configure do |config|
28 | config.environments = [:test]
29 | config.storage_strategies = [:active_record]
30 | end
31 | end
32 | end
33 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2 |
3 | require "bundler/setup" # Set up gems listed in the Gemfile.
4 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: test
6 |
7 | production:
8 | adapter: redis
9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10 | channel_prefix: testapp_production
11 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/credentials.yml.enc:
--------------------------------------------------------------------------------
1 | /bWD23mnXDc+ZsglNS+Rjm1x8obFfi85cLIzOIh/1FW65cUYAabVO3LjxKcpe1ttrvAoyL9Mr+FT/X3D23FfjjSHfzTU+Qusx68xN1HAbU4Bo0PvfNvGIA7hUs1vdPf1aW5NJkirfSzYsXVVAmVd7wvawx4Jb6UpkvGyPTJWdocs/IO8fcqKd7hfG/yX034AYwsw4jOjv1KUZw9NjQ8IsNW4EpPBFcdZma6yO58WeKbWdGzhkRn4tXMqjeBSwxdmKuLn6Lw/Nz4Z+r8yAVztMLKGDNsrnKQZuEqO1vNjY4OTfrlaC7k2cn2miA9efZ9MKrYyN1wYuR3rhhH3L1bCdgoSiuUdHdt6beG1b8pN/IVJp0UcwNXt0L/Qr5Y8RcZfil5CHF+qXuHP1HvflS8ADH8pWp4GhsLg1rl9DiQ/OfbhWRzyc4aJHDjKcWtqT48g3NQdDPRwpGdlh/+AE04CQbJE9uxfxp+hyfGn9nkuNOJZfZ+Moz1xQr0G--aI6T2yz2naVLeM4u--M3UI9eKdGu7T0kHMF2oTig==
--------------------------------------------------------------------------------
/spec/dummy_80/config/database.yml:
--------------------------------------------------------------------------------
1 | test: &test
2 | adapter: sqlite3
3 | database: ../db/test.sqlite3
4 | pool: 5
5 | timeout: 5000
6 |
7 |
8 | exception_database:
9 | <<: *test
10 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative "application"
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = "1.0"
5 |
6 | # Add additional assets to the asset load path.
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/initializers/content_security_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide content security policy.
4 | # See the Securing Rails Applications Guide for more information:
5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header
6 |
7 | # Rails.application.configure do
8 | # config.content_security_policy do |policy|
9 | # policy.default_src :self, :https
10 | # policy.font_src :self, :https, :data
11 | # policy.img_src :self, :https, :data
12 | # policy.object_src :none
13 | # policy.script_src :self, :https
14 | # policy.style_src :self, :https
15 | # # Specify URI for violation reports
16 | # # policy.report_uri "/csp-violation-report-endpoint"
17 | # end
18 | #
19 | # # Generate session nonces for permitted importmap, inline scripts, and inline styles.
20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21 | # config.content_security_policy_nonce_directives = %w(script-src style-src)
22 | #
23 | # # Report violations without enforcing the policy.
24 | # # config.content_security_policy_report_only = true
25 | # end
26 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4 | # Use this to limit dissemination of sensitive information.
5 | # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6 | Rails.application.config.filter_parameters += [
7 | :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
8 | ]
9 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, "\\1en"
8 | # inflect.singular /^(ox)en/i, "\\1"
9 | # inflect.irregular "person", "people"
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym "RESTful"
16 | # end
17 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization and
2 | # are automatically loaded by Rails. If you want to use locales other than
3 | # English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t "hello"
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t("hello") %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more about the API, please read the Rails Internationalization guide
20 | # at https://guides.rubyonrails.org/i18n.html.
21 | #
22 | # Be aware that YAML interprets the following case-insensitive strings as
23 | # booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
24 | # must be quoted to be interpreted as strings. For example:
25 | #
26 | # en:
27 | # "yes": yup
28 | # enabled: "ON"
29 |
30 | en:
31 | hello: "Hello world"
32 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/master.key:
--------------------------------------------------------------------------------
1 | 4bd7d27146f8cb8d99122ddf05477458
--------------------------------------------------------------------------------
/spec/dummy_80/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | get 'home/controller_error' => 'home#controller_error'
3 | get 'home/model_error' => 'home#model_error'
4 | get 'home/view_error' => 'home#view_error'
5 | get 'home/custom_layout' => 'home#custom_layout'
6 | get 'home/syntax_error' => 'home#syntax_error'
7 | end
8 |
--------------------------------------------------------------------------------
/spec/dummy_80/config/storage.yml:
--------------------------------------------------------------------------------
1 | test:
2 | service: Disk
3 | root: <%= Rails.root.join("tmp/storage") %>
4 |
5 | local:
6 | service: Disk
7 | root: <%= Rails.root.join("storage") %>
8 |
9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 | # amazon:
11 | # service: S3
12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 | # region: us-east-1
15 | # bucket: your_own_bucket-<%= Rails.env %>
16 |
17 | # Remember not to checkin your GCS keyfile to a repository
18 | # google:
19 | # service: GCS
20 | # project: your_project
21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22 | # bucket: your_own_bucket-<%= Rails.env %>
23 |
24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25 | # microsoft:
26 | # service: AzureStorage
27 | # storage_account_name: your_account_name
28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29 | # container: your_container_name-<%= Rails.env %>
30 |
31 | # mirror:
32 | # service: Mirror
33 | # primary: local
34 | # mirrors: [ amazon, google, microsoft ]
35 |
--------------------------------------------------------------------------------
/spec/dummy_80/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_80/lib/tasks/.keep
--------------------------------------------------------------------------------
/spec/dummy_80/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_80/log/.keep
--------------------------------------------------------------------------------
/spec/dummy_80/log/test.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_80/log/test.log
--------------------------------------------------------------------------------
/spec/dummy_80/public/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_80/public/icon.png
--------------------------------------------------------------------------------
/spec/dummy_80/public/icon.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/spec/dummy_80/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/spec/dummy_80/tmp/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_80/tmp/.keep
--------------------------------------------------------------------------------
/spec/dummy_80/tmp/local_secret.txt:
--------------------------------------------------------------------------------
1 | 5d44b75106f400a29bf8bc3d12ca06b7f286864be477c7e91cf44871d7373450bc3fbb9e82ec88b6daf95ccb5690ba3972e97e6d5368e06b6c8f8ecc26e3832a
--------------------------------------------------------------------------------
/spec/dummy_80/tmp/pids/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_80/tmp/pids/.keep
--------------------------------------------------------------------------------
/spec/dummy_80/tmp/storage/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjorntrondsen/rails_exception_handler/f24faadc8b65a59955af4f46eaae8ad69b3f8491/spec/dummy_80/tmp/storage/.keep
--------------------------------------------------------------------------------
/spec/unit/catcher_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe RailsExceptionHandler do
4 | example 'catching outside of rack' do
5 | RailsExceptionHandler.catch { raise "I failed misserably" }
6 | RailsExceptionHandler::ActiveRecord::ErrorMessage.count.should == 1
7 | RailsExceptionHandler::ActiveRecord::ErrorMessage.first.message.should eq("I failed misserably")
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/unit/configuration_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe RailsExceptionHandler::Configuration do
4 | describe ".initialize" do
5 | before(:each) do
6 | @configuration = RailsExceptionHandler::Configuration.new
7 | end
8 |
9 | it "should add :production to environments" do
10 | @configuration.environments.should == [:production]
11 | end
12 |
13 | it "should set storage_strategies to []" do
14 | @configuration.storage_strategies.should == []
15 | end
16 |
17 | it "should set store_user_info to false" do
18 | @configuration.store_user_info = false
19 | end
20 |
21 | it "should set filters to [] " do
22 | @configuration.filters.should == []
23 | end
24 |
25 | it "should initialize responses to an empty hash" do
26 | @configuration.responses.should == {}
27 | end
28 |
29 | it "should set the reponse_mapping to {}" do
30 | @configuration.response_mapping.should == {}
31 | end
32 |
33 | it "should set the fallback layout to 'application'" do
34 | @configuration.fallback_layout.should == 'application'
35 | end
36 |
37 | it "should set the mongoid_store_in to nil" do
38 | @configuration.mongoid_store_in.should be_nil
39 | end
40 |
41 | it "should set the default active record configuration" do
42 | @configuration.active_record_store_in.should eq({
43 | database: 'exception_database',
44 | record_table: 'error_messages'
45 | })
46 | end
47 | end
48 |
49 | end
50 |
--------------------------------------------------------------------------------