diff --git a/lib/simplecov-tailwindcss.rb b/lib/simplecov-tailwindcss.rb index f9ef561..0ef57b0 100644 --- a/lib/simplecov-tailwindcss.rb +++ b/lib/simplecov-tailwindcss.rb @@ -4,6 +4,7 @@ require "cgi" require "fileutils" require "digest/sha1" +require "pry" # Ensure we are using a compatible version of SimpleCov major, minor, patch = SimpleCov::VERSION.scan(/\d+/).first(3).map(&:to_i) @@ -37,9 +38,6 @@ def output_message(result) end def branchable_result? - # cached in initialize because we truly look it up a whole bunch of times - # and it's easier to cache here then in SimpleCov because there we might - # still enable/disable branch coverage criterion @branchable_result end @@ -87,6 +85,14 @@ def generate_dialog(file) "can't handle non ASCII characters in filenames. Error: " \ "#{e.message}." end + + def generate_stat_card(title, stat, color) + template("stat_card").result(binding) + end + + def generate_table_column_head(name) + template("table_column_head").result(binding) + end # rubocop:disable Lint/SelfAssignment, Style/RedundantRegexpEscape def generate_group_page(title, files) @@ -109,21 +115,21 @@ def format_number(number) def coverage_class(covered_percent) if covered_percent > 90 - "green" + "text-green-500" elsif covered_percent > 80 - "yellow" + "text-yellow-500" else - "red" + "text-red-500" end end def strength_class(covered_strength) if covered_strength > 1 - "green" + "text-green-500" elsif covered_strength == 1 - "yellow" + "text-yellow-500" else - "red" + "text-red-500" end end @@ -137,9 +143,9 @@ def shortened_filename(file) def hide_show(title) if title == "AllFiles" - "display: '';" + "" else - "display: none;" + "hidden" end end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 0786ff2..bcc5e97 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -5,6 +5,7 @@ SimpleCov.start do enable_coverage :branch add_filter "/test/" + add_group "Library", "/lib" end SimpleCov.formatters = [