lib/honeybadger/config.rb in honeybadger-2.0.5 vs lib/honeybadger/config.rb in honeybadger-2.0.6
- old
+ new
@@ -273,10 +273,23 @@
else
"Ruby #{RUBY_VERSION}"
end
end
+ # Internal: Match the project root.
+ #
+ # Returns Regexp matching the project root in a file string.
+ def root_regexp
+ return @root_regexp if @root_regexp
+ return nil if @no_root
+
+ root = get(:root).to_s
+ @no_root = true and return nil unless root =~ NOT_BLANK
+
+ @root_regexp = Regexp.new("^#{ Regexp.escape(root) }")
+ end
+
private
def ping_payload
{
version: VERSION,
@@ -303,14 +316,14 @@
nil
end
end
def locate_absolute_path(path, root)
- path = Pathname.new(path)
+ path = Pathname.new(path.to_s)
if path.absolute?
path
else
- Pathname.new(root).join(path)
+ Pathname.new(root.to_s).join(path.to_s)
end
end
def build_logger(default = nil)
if path = log_path