From 54879bd1080865cf8013bcda12e0c03ac687d7a9 Mon Sep 17 00:00:00 2001 From: Yuri Smirnov Date: Mon, 25 Dec 2023 19:28:17 +0300 Subject: [PATCH] fix warning --- lib/simplecov-html.rb | 5 ++++- views/file_list.erb | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/simplecov-html.rb b/lib/simplecov-html.rb index 8adf765..b1cac39 100644 --- a/lib/simplecov-html.rb +++ b/lib/simplecov-html.rb @@ -95,6 +95,10 @@ def assets_path(name) File.join("./assets", SimpleCov::Formatter::HTMLFormatter::VERSION, name) end + def to_id(value) + value.gsub(/^[^a-zA-Z]+/, "").gsub(/[^a-zA-Z0-9\-_]/, "") + end + def asset_inline(name) path = File.join(@public_assets_dir, name) @@ -119,7 +123,6 @@ def formatted_source_file(source_file) # Returns a table containing the given source files def formatted_file_list(title, source_files) - title_id = title.gsub(/^[^a-zA-Z]+/, "").gsub(/[^a-zA-Z0-9\-_]/, "") template("file_list").result(binding) end diff --git a/views/file_list.erb b/views/file_list.erb index c63a303..e8f362f 100644 --- a/views/file_list.erb +++ b/views/file_list.erb @@ -1,4 +1,4 @@ -
+

<%= title %> ( @@ -13,7 +13,7 @@ )

- +
<%= source_files.length %> files in total.