Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marks .bundle/ files out of project #420

Merged
merged 2 commits into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/bugsnag/stacktrace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Stacktrace
JAVA_BACKTRACE_REGEX = /^(.*)\((.*)(?::([0-9]+))?\)$/

# Path to vendored code. Used to mark file paths as out of project.
VENDOR_PATH = 'vendor/'
VENDOR_PATH = /^(vendor\/|\.bundle\/)/

def initialize(backtrace, configuration)
@configuration = configuration
Expand Down Expand Up @@ -44,7 +44,7 @@ def initialize(backtrace, configuration)
if defined?(@configuration.project_root) && @configuration.project_root.to_s != ''
trace_hash[:inProject] = true if file.start_with?(@configuration.project_root.to_s)
file.sub!(/#{@configuration.project_root}\//, "")
trace_hash.delete(:inProject) if file.start_with?(VENDOR_PATH)
trace_hash.delete(:inProject) if file.match(VENDOR_PATH)
end


Expand Down
10 changes: 9 additions & 1 deletion spec/report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@ def gloops
File.join(project_root, "lib/helpers/string.rb:32:in `splice'"),
File.join(project_root, "lib/vendor/lib/article.rb:158:in `initialize'"),
File.join(project_root, "lib/prog.rb:158:in `read_articles'"),
File.join(project_root, ".bundle/strutils/lib.string.rb:508:in `splice'"),
File.join(project_root, "abundle/article.rb:158:in `initialize'"),
File.join(project_root, ".bundles/strutils/lib.string.rb:508:in `splice'"),
File.join(project_root, "lib/.bundle/article.rb:158:in `initialize'"),
"app.rb:10:in `main'",
"(pry):3:in `__pry__'"
]}
Expand All @@ -549,7 +553,11 @@ def gloops
expect(exception["stacktrace"][3]["inProject"]).to be true
expect(exception["stacktrace"][4]["inProject"]).to be true
expect(exception["stacktrace"][5]["inProject"]).to be_nil
expect(exception["stacktrace"][6]["inProject"]).to be_nil
expect(exception["stacktrace"][6]["inProject"]).to be true
expect(exception["stacktrace"][7]["inProject"]).to be true
expect(exception["stacktrace"][8]["inProject"]).to be true
expect(exception["stacktrace"][9]["inProject"]).to be_nil
expect(exception["stacktrace"][10]["inProject"]).to be_nil
}
end

Expand Down