simplecov-html-formatter 0.12.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.github/workflows/main.yml +33 -0
- data/.gitignore +26 -0
- data/.rubocop.yml +76 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +81 -0
- data/Gemfile +23 -0
- data/Gemfile.lock +68 -0
- data/Guardfile +14 -0
- data/LICENSE +20 -0
- data/README.md +30 -0
- data/Rakefile +46 -0
- data/assets/javascripts/application.js +122 -0
- data/assets/javascripts/libraries/jquery-3.4.1.js +10598 -0
- data/assets/javascripts/plugins/highlight.pack.js +1 -0
- data/assets/javascripts/plugins/jquery.colorbox.js +1105 -0
- data/assets/javascripts/plugins/jquery.dataTables.js +15008 -0
- data/assets/javascripts/plugins/jquery.timeago.js +232 -0
- data/assets/stylesheets/application.css +3 -0
- data/assets/stylesheets/plugins/datatables.css +462 -0
- data/assets/stylesheets/plugins/highlight.css +129 -0
- data/assets/stylesheets/plugins/jquery-ui-1.8.4.custom.css +295 -0
- data/assets/stylesheets/plugins/jquery.colorbox.css +52 -0
- data/assets/stylesheets/reset.css +103 -0
- data/assets/stylesheets/screen.css +316 -0
- data/lib/simplecov-html/version.rb +9 -0
- data/lib/simplecov-html.rb +135 -0
- data/public/DataTables-1.10.20/images/sort_asc.png +0 -0
- data/public/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
- data/public/DataTables-1.10.20/images/sort_both.png +0 -0
- data/public/DataTables-1.10.20/images/sort_desc.png +0 -0
- data/public/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
- data/public/application.css +1 -0
- data/public/application.js +7 -0
- data/public/colorbox/border.png +0 -0
- data/public/colorbox/controls.png +0 -0
- data/public/colorbox/loading.gif +0 -0
- data/public/colorbox/loading_background.png +0 -0
- data/public/favicon_green.png +0 -0
- data/public/favicon_red.png +0 -0
- data/public/favicon_yellow.png +0 -0
- data/public/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/images/ui-icons_222222_256x240.png +0 -0
- data/public/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/images/ui-icons_454545_256x240.png +0 -0
- data/public/images/ui-icons_888888_256x240.png +0 -0
- data/public/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/loading.gif +0 -0
- data/public/magnify.png +0 -0
- data/simplecov-html.gemspec +23 -0
- data/test/helper.rb +6 -0
- data/test/test_simple_cov-html.rb +10 -0
- data/views/covered_percent.erb +3 -0
- data/views/file_list.erb +78 -0
- data/views/layout.erb +41 -0
- data/views/source_file.erb +54 -0
- metadata +108 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/public/loading.gif
ADDED
|
Binary file
|
data/public/magnify.png
ADDED
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
|
|
4
|
+
require "simplecov-html/version"
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |gem|
|
|
7
|
+
gem.name = "simplecov-html-formatter"
|
|
8
|
+
gem.version = SimpleCov::Formatter::HTMLFormatter::VERSION
|
|
9
|
+
gem.platform = Gem::Platform::RUBY
|
|
10
|
+
gem.authors = ["Aashish Saini"]
|
|
11
|
+
gem.email = ["aashusaini2684@gmail.com"]
|
|
12
|
+
gem.homepage = "https://github.com/SelfcareCatalysts/simplecov-html"
|
|
13
|
+
gem.description = %(Default HTML formatter for SimpleCov code coverage tool for ruby 2.4+)
|
|
14
|
+
gem.summary = gem.description
|
|
15
|
+
gem.license = "MIT"
|
|
16
|
+
|
|
17
|
+
gem.required_ruby_version = ">= 2.4"
|
|
18
|
+
|
|
19
|
+
gem.files = `git ls-files`.split("\n")
|
|
20
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
21
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
|
22
|
+
gem.require_paths = ["lib"]
|
|
23
|
+
end
|
data/test/helper.rb
ADDED
data/views/file_list.erb
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<div class="file_list_container" id="<%= title_id %>">
|
|
2
|
+
<h2>
|
|
3
|
+
<span class="group_name"><%= title %></span>
|
|
4
|
+
(<span class="covered_percent">
|
|
5
|
+
<%= covered_percent(source_files.covered_percent) %>
|
|
6
|
+
</span>
|
|
7
|
+
covered at
|
|
8
|
+
<span class="covered_strength">
|
|
9
|
+
<span class="<%= strength_css_class(source_files.covered_strength) %>">
|
|
10
|
+
<%= source_files.covered_strength.round(2) %>
|
|
11
|
+
</span>
|
|
12
|
+
</span> hits/line
|
|
13
|
+
)
|
|
14
|
+
</h2>
|
|
15
|
+
|
|
16
|
+
<a name="<%= title_id %>"></a>
|
|
17
|
+
|
|
18
|
+
<div>
|
|
19
|
+
<b><%= source_files.length %></b> files in total.
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="t-line-summary">
|
|
23
|
+
<b><%= source_files.lines_of_code %></b> relevant lines,
|
|
24
|
+
<span class="green"><b><%= source_files.covered_lines %></b> lines covered</span> and
|
|
25
|
+
<span class="red"><b><%= source_files.missed_lines %></b> lines missed. </span>
|
|
26
|
+
(<%= covered_percent(source_files.covered_percent) %>)
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<% if branchable_result? %>
|
|
30
|
+
<div class="t-branch-summary">
|
|
31
|
+
<span><b><%= source_files.total_branches %></b> total branches, </span>
|
|
32
|
+
<span class="green"><b><%= source_files.covered_branches %></b> branches covered</span> and
|
|
33
|
+
<span class="red"><b><%= source_files.missed_branches %></b> branches missed.</span>
|
|
34
|
+
(<%= covered_percent(source_files.branch_covered_percent) %>)
|
|
35
|
+
</div>
|
|
36
|
+
<% end %>
|
|
37
|
+
|
|
38
|
+
<div class="file_list--responsive">
|
|
39
|
+
<table class="file_list">
|
|
40
|
+
<thead>
|
|
41
|
+
<tr>
|
|
42
|
+
<th>File</th>
|
|
43
|
+
<th class="cell--number">% covered</th>
|
|
44
|
+
<th class="cell--number">Lines</th>
|
|
45
|
+
<th class="cell--number">Relevant Lines</th>
|
|
46
|
+
<th class="cell--number">Lines covered</th>
|
|
47
|
+
<th class="cell--number">Lines missed</th>
|
|
48
|
+
<th class="cell--number">Avg. Hits / Line</th>
|
|
49
|
+
<% if branchable_result? %>
|
|
50
|
+
<th class="cell--number">Branch Coverage</th>
|
|
51
|
+
<th class="cell--number">Branches</th>
|
|
52
|
+
<th class="cell--number">Covered branches</th>
|
|
53
|
+
<th class="cell--number">Missed branches </th>
|
|
54
|
+
<% end %>
|
|
55
|
+
</tr>
|
|
56
|
+
</thead>
|
|
57
|
+
<tbody>
|
|
58
|
+
<% source_files.each do |source_file| %>
|
|
59
|
+
<tr class="t-file">
|
|
60
|
+
<td class="strong t-file__name"><%= link_to_source_file(source_file) %></td>
|
|
61
|
+
<td class="<%= coverage_css_class(source_file.covered_percent) %> strong cell--number t-file__coverage"><%= sprintf("%.2f", source_file.covered_percent.round(2)) %> %</td>
|
|
62
|
+
<td class="cell--number"><%= source_file.lines.count %></td>
|
|
63
|
+
<td class="cell--number"><%= source_file.covered_lines.count + source_file.missed_lines.count %></td>
|
|
64
|
+
<td class="cell--number"><%= source_file.covered_lines.count %></td>
|
|
65
|
+
<td class="cell--number"><%= source_file.missed_lines.count %></td>
|
|
66
|
+
<td class="cell--number"><%= sprintf("%.2f", source_file.covered_strength.round(2)) %></td>
|
|
67
|
+
<% if branchable_result? %>
|
|
68
|
+
<td class="<%= coverage_css_class(source_file.branches_coverage_percent) %> strong cell--number t-file__branch-coverage"><%= sprintf("%.2f", source_file.branches_coverage_percent.round(2)) %> %</td>
|
|
69
|
+
<td class="cell--number"><%= source_file.total_branches.count %></td>
|
|
70
|
+
<td class="cell--number"><%= source_file.covered_branches.count %></td>
|
|
71
|
+
<td class="cell--number"><%= source_file.missed_branches.count %></td>
|
|
72
|
+
<% end %>
|
|
73
|
+
</tr>
|
|
74
|
+
<% end %>
|
|
75
|
+
</tbody>
|
|
76
|
+
</table>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
data/views/layout.erb
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html xmlns='http://www.w3.org/1999/xhtml'>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Code coverage for <%= SimpleCov.project_name %></title>
|
|
5
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
6
|
+
<script src='<%= assets_path('application.js') %>' type='text/javascript'></script>
|
|
7
|
+
<link href='<%= assets_path('application.css') %>' media='screen, projection, print' rel='stylesheet' type='text/css' />
|
|
8
|
+
<link rel="shortcut icon" type="image/png" href="<%= assets_path("favicon_#{coverage_css_class(result.source_files.covered_percent)}.png") %>" />
|
|
9
|
+
<link rel="icon" type="image/png" href="<%= assets_path('favicon.png') %>" />
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body<%= ' data-branch-coverage=true' if branchable_result? %>>
|
|
13
|
+
<div id="loading">
|
|
14
|
+
<img src="<%= assets_path('loading.gif') %>" alt="loading"/>
|
|
15
|
+
</div>
|
|
16
|
+
<div id="wrapper" class="hide">
|
|
17
|
+
<div class="timestamp">Generated <%= timeago(Time.now) %></div>
|
|
18
|
+
<ul class="group_tabs"></ul>
|
|
19
|
+
|
|
20
|
+
<div id="content">
|
|
21
|
+
<%= formatted_file_list("All Files", result.source_files) %>
|
|
22
|
+
|
|
23
|
+
<% result.groups.each do |name, files| %>
|
|
24
|
+
<%= formatted_file_list(name, files) %>
|
|
25
|
+
<% end %>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div id="footer">
|
|
29
|
+
Generated by <a href="https://github.com/simplecov-ruby/simplecov">simplecov</a> v<%= SimpleCov::VERSION %>
|
|
30
|
+
and simplecov-html v<%= SimpleCov::Formatter::HTMLFormatter::VERSION %><br/>
|
|
31
|
+
using <%= result.command_name %>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="source_files">
|
|
35
|
+
<% result.source_files.each do |source_file| %>
|
|
36
|
+
<%= formatted_source_file(source_file) %>
|
|
37
|
+
<% end %>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</body>
|
|
41
|
+
</html>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<div class="source_table" id="<%= id source_file %>">
|
|
2
|
+
<div class="header">
|
|
3
|
+
<h3><%= shortened_filename source_file %></h3>
|
|
4
|
+
<h4>
|
|
5
|
+
<%= covered_percent(source_file.covered_percent) %>
|
|
6
|
+
lines covered
|
|
7
|
+
</h4>
|
|
8
|
+
|
|
9
|
+
<% if branchable_result? %>
|
|
10
|
+
<h4>
|
|
11
|
+
<%= covered_percent(source_file.branches_coverage_percent) %>
|
|
12
|
+
branches covered
|
|
13
|
+
</h4>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<div class="t-line-summary">
|
|
17
|
+
<b><%= source_file.lines_of_code %></b> relevant lines.
|
|
18
|
+
<span class="green"><b><%= source_file.covered_lines.count %></b> lines covered</span> and
|
|
19
|
+
<span class="red"><b><%= source_file.missed_lines.count %></b> lines missed.</span>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<% if branchable_result? %>
|
|
23
|
+
<div class="t-branch-summary">
|
|
24
|
+
<span><b><%= source_file.total_branches.count %></b> total branches, </span>
|
|
25
|
+
<span class="green"><b><%= source_file.covered_branches.count %></b> branches covered</span> and
|
|
26
|
+
<span class="red"><b><%= source_file.missed_branches.count %></b> branches missed.</span>
|
|
27
|
+
</div>
|
|
28
|
+
<% end %>
|
|
29
|
+
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<pre>
|
|
33
|
+
<ol>
|
|
34
|
+
<% source_file.lines.each do |line| %>
|
|
35
|
+
<div>
|
|
36
|
+
<li class="<%= line_status?(source_file, line) %>" data-hits="<%= line.coverage ? line.coverage : '' %>" data-linenumber="<%= line.number %>">
|
|
37
|
+
<% if line.covered? %><span class="hits"><%= line.coverage %></span><% end %>
|
|
38
|
+
<% if line.skipped? %><span class="hits">skipped</span><% end %>
|
|
39
|
+
|
|
40
|
+
<% if branchable_result? %>
|
|
41
|
+
<% source_file.branches_for_line(line.number).each do |branch_type, hit_count| %>
|
|
42
|
+
<span class="hits" title="<%= branch_type%> branch hit <%= hit_count %> times">
|
|
43
|
+
<%= branch_type %>: <%= hit_count %>
|
|
44
|
+
</span>
|
|
45
|
+
<% end %>
|
|
46
|
+
<% end %>
|
|
47
|
+
|
|
48
|
+
<code class="ruby"><%= CGI.escapeHTML(line.src.chomp) %></code>
|
|
49
|
+
</li>
|
|
50
|
+
</div>
|
|
51
|
+
<% end %>
|
|
52
|
+
</ol>
|
|
53
|
+
</pre>
|
|
54
|
+
</div>
|
metadata
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: simplecov-html-formatter
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.12.3.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Aashish Saini
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2023-04-12 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Default HTML formatter for SimpleCov code coverage tool for ruby 2.4+
|
|
14
|
+
email:
|
|
15
|
+
- aashusaini2684@gmail.com
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- ".document"
|
|
21
|
+
- ".github/workflows/main.yml"
|
|
22
|
+
- ".gitignore"
|
|
23
|
+
- ".rubocop.yml"
|
|
24
|
+
- ".tool-versions"
|
|
25
|
+
- CHANGELOG.md
|
|
26
|
+
- Gemfile
|
|
27
|
+
- Gemfile.lock
|
|
28
|
+
- Guardfile
|
|
29
|
+
- LICENSE
|
|
30
|
+
- README.md
|
|
31
|
+
- Rakefile
|
|
32
|
+
- assets/javascripts/application.js
|
|
33
|
+
- assets/javascripts/libraries/jquery-3.4.1.js
|
|
34
|
+
- assets/javascripts/plugins/highlight.pack.js
|
|
35
|
+
- assets/javascripts/plugins/jquery.colorbox.js
|
|
36
|
+
- assets/javascripts/plugins/jquery.dataTables.js
|
|
37
|
+
- assets/javascripts/plugins/jquery.timeago.js
|
|
38
|
+
- assets/stylesheets/application.css
|
|
39
|
+
- assets/stylesheets/plugins/datatables.css
|
|
40
|
+
- assets/stylesheets/plugins/highlight.css
|
|
41
|
+
- assets/stylesheets/plugins/jquery-ui-1.8.4.custom.css
|
|
42
|
+
- assets/stylesheets/plugins/jquery.colorbox.css
|
|
43
|
+
- assets/stylesheets/reset.css
|
|
44
|
+
- assets/stylesheets/screen.css
|
|
45
|
+
- lib/simplecov-html.rb
|
|
46
|
+
- lib/simplecov-html/version.rb
|
|
47
|
+
- public/DataTables-1.10.20/images/sort_asc.png
|
|
48
|
+
- public/DataTables-1.10.20/images/sort_asc_disabled.png
|
|
49
|
+
- public/DataTables-1.10.20/images/sort_both.png
|
|
50
|
+
- public/DataTables-1.10.20/images/sort_desc.png
|
|
51
|
+
- public/DataTables-1.10.20/images/sort_desc_disabled.png
|
|
52
|
+
- public/application.css
|
|
53
|
+
- public/application.js
|
|
54
|
+
- public/colorbox/border.png
|
|
55
|
+
- public/colorbox/controls.png
|
|
56
|
+
- public/colorbox/loading.gif
|
|
57
|
+
- public/colorbox/loading_background.png
|
|
58
|
+
- public/favicon_green.png
|
|
59
|
+
- public/favicon_red.png
|
|
60
|
+
- public/favicon_yellow.png
|
|
61
|
+
- public/images/ui-bg_flat_0_aaaaaa_40x100.png
|
|
62
|
+
- public/images/ui-bg_flat_75_ffffff_40x100.png
|
|
63
|
+
- public/images/ui-bg_glass_55_fbf9ee_1x400.png
|
|
64
|
+
- public/images/ui-bg_glass_65_ffffff_1x400.png
|
|
65
|
+
- public/images/ui-bg_glass_75_dadada_1x400.png
|
|
66
|
+
- public/images/ui-bg_glass_75_e6e6e6_1x400.png
|
|
67
|
+
- public/images/ui-bg_glass_95_fef1ec_1x400.png
|
|
68
|
+
- public/images/ui-bg_highlight-soft_75_cccccc_1x100.png
|
|
69
|
+
- public/images/ui-icons_222222_256x240.png
|
|
70
|
+
- public/images/ui-icons_2e83ff_256x240.png
|
|
71
|
+
- public/images/ui-icons_454545_256x240.png
|
|
72
|
+
- public/images/ui-icons_888888_256x240.png
|
|
73
|
+
- public/images/ui-icons_cd0a0a_256x240.png
|
|
74
|
+
- public/loading.gif
|
|
75
|
+
- public/magnify.png
|
|
76
|
+
- simplecov-html.gemspec
|
|
77
|
+
- test/helper.rb
|
|
78
|
+
- test/test_simple_cov-html.rb
|
|
79
|
+
- views/covered_percent.erb
|
|
80
|
+
- views/file_list.erb
|
|
81
|
+
- views/layout.erb
|
|
82
|
+
- views/source_file.erb
|
|
83
|
+
homepage: https://github.com/SelfcareCatalysts/simplecov-html
|
|
84
|
+
licenses:
|
|
85
|
+
- MIT
|
|
86
|
+
metadata: {}
|
|
87
|
+
post_install_message:
|
|
88
|
+
rdoc_options: []
|
|
89
|
+
require_paths:
|
|
90
|
+
- lib
|
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '2.4'
|
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
|
+
requirements:
|
|
98
|
+
- - ">="
|
|
99
|
+
- !ruby/object:Gem::Version
|
|
100
|
+
version: '0'
|
|
101
|
+
requirements: []
|
|
102
|
+
rubygems_version: 3.1.4
|
|
103
|
+
signing_key:
|
|
104
|
+
specification_version: 4
|
|
105
|
+
summary: Default HTML formatter for SimpleCov code coverage tool for ruby 2.4+
|
|
106
|
+
test_files:
|
|
107
|
+
- test/helper.rb
|
|
108
|
+
- test/test_simple_cov-html.rb
|