summaryrefslogtreecommitdiff
path: root/lib/rack/show_exceptions.rb
Commit message (Collapse)AuthorAgeFilesLines
* Replace OpenStruct with Struct (#2004)YOSHIDA Katsuhiko2023-01-081-1/+6
| | | To improve performance and specify fields explicitly.
* Use Exception#detailed_message if availableYusuke Endoh2022-07-091-1/+10
| | | | | | | | | | | | | | Ruby 3.2 will provide `Exception#detailed_message` which returns more informative message including hints for debugging. https://bugs.ruby-lang.org/issues/18564 The did_you_mean gem and error_highlight gem is planned to use the method to add their hints in Ruby 3.2. So using `Exception#message` will not include did_you_mean and error_highlight hints. This changeset uses `Exception#detailed_message` if available to show exceptions.
* Use "white-space: pre-wrap" instead of "pre"Yusuke Endoh2022-07-091-1/+1
| | | | ... to allow automatic line wrapping for very long lines.
* Use "pre" format and monospace font for exception messagesYusuke Endoh2022-07-091-1/+1
| | | | | | | Ruby 3.1's error_highlight feature prints a code snippet with a underline. To make it readable, an exception message should be rendered by a monospace font and in "pre" format, i.e., whitespaces are preserved and newlines are respected.
* Enable directly requiring Rack componentsJeremy Evans2022-02-031-0/+4
| | | | | | | | | | | | | | | | | | | | | Add test:separate task to test run each test file separately. This is to test that directly requiring a rack component will work. With test:separate, the test helper will not require rack, and each test file should call separate_testing with a block that uses require_relative to only require that component being tested. Add the appropriate relative requires to get all tests passing when run separately. Note that this isn't foolproof. In many cases, the tests use Rack components that are not under test (such as lint and mock), and both of those other other rack components, so it's possible the tests are loading hidden dependencies. I attempted to check each component to try to find the hidden dependencies, but it is certainly possible I missed something. Implements #1621.
* Double assignment is still needed to prevent an "unused variable" warningRyuta Kamizono2020-02-111-2/+6
| | | | That warning is still raised on latest Ruby.
* Cleanups since master is 2.2+Vipul A M2020-02-101-6/+2
| | | | | - Use safe navigation operator - Cleanup old "unused variable" comments and hack, this doesn't seem to warn on 2.3 onwards
* Use require_relative and rely on autoload instead of using requireJeremy Evans2020-01-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | This does a better job of testing the autoloads work, and ensures files are loaded from the current rack directory. Some files required rack.rb, and in those cases I didn't remove the require, just replaced it with require_relative, since the intent is to make sure all of rack is loaded if a file under rack is loaded. This has the potential to break code that does: require 'rack/content_type' Rack::ContentType.new(app) If the rack library itself is never required. This is because the autoloads that rack.rb sets up would not be loaded. I'm not sure if we want to support that, but if so we would want to keep the requires and convert them to require_relative. For core_ext/regexp, move the requires into the if < 2.4 block, so that the file isn't loaded unless it is necessary.
* Make Rack::ShowExceptions handle invalid POST dataJeremy Evans2020-01-161-2/+2
| | | | | | Otherwise you get an exception trying to render the exception page. Fixes #991
* ShowExceptions: fix issue when Rack env has binary dataAkshay Joshi2018-12-181-1/+1
|
* Call the correct accepts_html? method for prefer_plaintextTomer Elmalem2018-09-051-1/+1
|
* Update LICENSE (#1261)yhirano552018-04-171-2/+2
| | | | | | * Renamed COPYING to MIT-LICENSE since that's used by most gems. * Updated README and add a license section instead of copyright. * Updated author url. * Updated copyright years.
* RuboCop: enable Layout/Space* cops (#1259)yhirano552018-04-171-4/+4
|
* Merge branch 'patch-1' of https://github.com/jkowens/rack into jkowens-patch-1Aaron Patterson2018-04-141-1/+5
|\ | | | | | | | | | | * 'patch-1' of https://github.com/jkowens/rack: Override template using #template method Allow subclasses to override TEMPLATE constant
| * Override template using #template methodJordan Owens2018-01-151-1/+1
| |
| * Allow subclasses to override TEMPLATE constantJordan Owens2018-01-051-1/+5
| |
* | Add frozen_string_literal: true to remaining filesDillon Welch2018-04-131-0/+2
| | | | | | | | See https://github.com/rack/rack/issues/1243 for history of this task
* | Updates for frozen string literal compatibility.Pat Allan2017-06-211-1/+1
|/
* Merge remote-tracking branch 'origin/master' into ↵Max Cantor2015-08-041-271/+270
| | | | showexceptions-lazy-erb-template
* Rename files to follow ruby naming conventionsTeo Ljungberg2015-06-241-0/+387
If a class is named NullLogger, it’s file would be named null_logger.rb