From c8fe045391d981f6ae0ca7fdbbb3c9a5881db03b Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Tue, 28 Feb 2017 12:47:26 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20compile-in=20SRC=5FPATH=20unles?= =?UTF-8?q?s=20debug=20flag=20is=20enabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/raven/configuration.cr | 2 +- src/raven/interfaces/stacktrace.cr | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/raven/configuration.cr b/src/raven/configuration.cr index 48d37f0..a25ef35 100644 --- a/src/raven/configuration.cr +++ b/src/raven/configuration.cr @@ -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. diff --git a/src/raven/interfaces/stacktrace.cr b/src/raven/interfaces/stacktrace.cr index 874f31f..6bae105 100644 --- a/src/raven/interfaces/stacktrace.cr +++ b/src/raven/interfaces/stacktrace.cr @@ -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