From e1002819a460a9fdc0026e14f149f9987569c244 Mon Sep 17 00:00:00 2001 From: Rafael Gibim <9031589+Drowze@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:04:48 -0300 Subject: [PATCH] Bring back gem tracking To use gem tracking, simply add the gems root to root_paths --- lib/coverband/collectors/delta.rb | 3 ++- lib/coverband/configuration.rb | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/coverband/collectors/delta.rb b/lib/coverband/collectors/delta.rb index 0b957b55..ca088df6 100644 --- a/lib/coverband/collectors/delta.rb +++ b/lib/coverband/collectors/delta.rb @@ -40,6 +40,7 @@ def results def self.reset @@previous_coverage = {} @@project_directory = File.expand_path(Coverband.configuration.root) + @@project_directories = Coverband.configuration.all_root_paths.map { |path| File.expand_path(path) } @@ignore_patterns = Coverband.configuration.ignore end @@ -55,7 +56,7 @@ def generate # would slow down the performance. ### next unless @@ignore_patterns.none? { |pattern| file.match(pattern) } && - file.start_with?(@@project_directory) + @@project_directories.any? { |path| file.start_with?(path) } # This handles Coverage branch support, setup by default in # simplecov 0.18.x diff --git a/lib/coverband/configuration.rb b/lib/coverband/configuration.rb index 5b8cae01..4c602f4b 100644 --- a/lib/coverband/configuration.rb +++ b/lib/coverband/configuration.rb @@ -222,8 +222,8 @@ def current_root def all_root_paths return @all_root_paths if @all_root_paths - @all_root_paths = Coverband.configuration.root_paths.dup - @all_root_paths << "#{Coverband.configuration.current_root}/" + @all_root_paths = ["#{Coverband.configuration.current_root}/"] + @all_root_paths += Coverband.configuration.root_paths @all_root_paths end