15
16
17
18
19
20
21
22
23
24
|
# File 'lib/sinatra/sugar.rb', line 15
def ignore_caller(pattern = nil)
case pattern
when String then Dir.glob(pattern) { |file| ignore_caller File.expand_path(file).to_sym }
when Symbol then ignore_caller Regexp.new(Regexp.escape(pattern.to_s))
when Regexp then callers_to_ignore << pattern
when nil then ignore_caller caller.first[/^[^:]*/].to_sym
when Array then pattern.each { |p| ignore_caller p }
else raise ArgumentError, "cannot handle #{pattern.inspect}"
end
end
|