mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Allow CALLERS_TO_IGNORE to be overridden
This commit is contained in:
parent
c135ceb94e
commit
5788f4683f
1 changed files with 5 additions and 1 deletions
|
@ -1237,6 +1237,10 @@ module Sinatra
|
|||
|
||||
attr_reader :routes, :filters, :templates, :errors
|
||||
|
||||
def callers_to_ignore
|
||||
CALLERS_TO_IGNORE
|
||||
end
|
||||
|
||||
# Removes all routes, filters, middleware and extension hooks from the
|
||||
# current class (not routes/filters/... defined by its superclass).
|
||||
def reset!
|
||||
|
@ -1786,7 +1790,7 @@ module Sinatra
|
|||
def cleaned_caller(keep = 3)
|
||||
caller(1).
|
||||
map! { |line| line.split(/:(?=\d|in )/, 3)[0,keep] }.
|
||||
reject { |file, *_| CALLERS_TO_IGNORE.any? { |pattern| file =~ pattern } }
|
||||
reject { |file, *_| callers_to_ignore.any? { |pattern| file =~ pattern } }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue