lib/raven/backtrace.rb in sentry-raven-0.7.1 vs lib/raven/backtrace.rb in sentry-raven-0.8.0
- old
+ new
@@ -35,11 +35,12 @@
self.number = number.to_i
self.method = method
end
def in_app
- @in_app_pattern ||= Regexp.new("^(#{project_root}/)?#{APP_DIRS_PATTERN}")
+ app_dirs = Raven.configuration.app_dirs_pattern || APP_DIRS_PATTERN
+ @in_app_pattern ||= Regexp.new("^(#{project_root}/)?#{app_dirs}")
if self.file =~ @in_app_pattern
true
else
false
@@ -74,16 +75,16 @@
def self.parse(ruby_backtrace, opts = {})
ruby_lines = split_multiline_backtrace(ruby_backtrace)
filters = opts[:filters] || []
filtered_lines = ruby_lines.to_a.map do |line|
- filters.inject(line) do |line, proc|
+ filters.reduce(line) do |line, proc|
proc.call(line)
end
end.compact
- lines = filtered_lines.collect do |unparsed_line|
+ lines = filtered_lines.map do |unparsed_line|
Line.parse(unparsed_line)
end
instance = new(lines)
end
@@ -91,10 +92,10 @@
def initialize(lines)
self.lines = lines
end
def inspect
- "<Backtrace: " + lines.collect { |line| line.inspect }.join(", ") + ">"
+ "<Backtrace: " + lines.map { |line| line.inspect }.join(", ") + ">"
end
def to_s
content = []
lines.each do |line|