Skip to content

Commit

Permalink
Don’t compile-in SRC_PATH unless debug flag is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Feb 28, 2017
1 parent 0d989c9 commit c8fe045
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/raven/configuration.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require "json"
module Raven
class Configuration
{% begin %}
SRC_PATH = {{ `pwd`.strip.stringify }}
SRC_PATH = {{ flag?(:debug) ? `pwd`.strip.stringify : nil }}
{% end %}

# Array of exception classes that should never be sent.
Expand Down
3 changes: 2 additions & 1 deletion src/raven/interfaces/stacktrace.cr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module Raven
property? in_app : Bool?

def under_src_path?
abs_path.try &.starts_with?(Configuration::SRC_PATH)
return unless src_path = Configuration::SRC_PATH
abs_path.try &.starts_with?(src_path)
end

def filename
Expand Down

0 comments on commit c8fe045

Please sign in to comment.