Module: Rake::Backtrace

Defined in:
lib/rake/backtrace.rb

Constant Summary collapse

SUPPRESSED_PATHS =
RbConfig::CONFIG.values_at(*RbConfig::CONFIG.
                           keys.grep(/(prefix|libdir)/)).uniq + [
  File.join(File.dirname(__FILE__), ".."),
].map { |f| Regexp.quote(File.expand_path(f)) }
SUPPRESS_PATTERN =
%r!(\A#{SUPPRESSED_PATHS.join('|')}|bin/rake:\d+)!i

Class Method Summary collapse

Class Method Details

.collapse(backtrace) ⇒ Object



12
13
14
15
16
# File 'lib/rake/backtrace.rb', line 12

def self.collapse(backtrace)
  pattern = Rake.application.options.suppress_backtrace_pattern ||
            SUPPRESS_PATTERN
  backtrace.reject { |elem| elem =~ pattern }
end