simplecov-html 0.10.2 → 0.12.3

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.
Files changed (52) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +0 -1
  3. data/.rubocop.yml +42 -17
  4. data/.tool-versions +1 -0
  5. data/.travis.yml +15 -20
  6. data/CHANGELOG.md +72 -4
  7. data/Gemfile +10 -21
  8. data/Gemfile.lock +59 -0
  9. data/Guardfile +2 -0
  10. data/README.md +3 -3
  11. data/Rakefile +10 -5
  12. data/assets/javascripts/application.js +29 -34
  13. data/assets/javascripts/libraries/jquery-3.4.1.js +10598 -0
  14. data/assets/javascripts/plugins/jquery.colorbox.js +1101 -1086
  15. data/assets/javascripts/plugins/jquery.dataTables.js +15008 -0
  16. data/assets/javascripts/plugins/jquery.timeago.js +135 -44
  17. data/assets/stylesheets/plugins/datatables.css +462 -0
  18. data/assets/stylesheets/screen.css +316 -0
  19. data/lib/simplecov-html/version.rb +3 -1
  20. data/lib/simplecov-html.rb +28 -0
  21. data/public/DataTables-1.10.20/images/sort_asc.png +0 -0
  22. data/public/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
  23. data/public/DataTables-1.10.20/images/sort_both.png +0 -0
  24. data/public/DataTables-1.10.20/images/sort_desc.png +0 -0
  25. data/public/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
  26. data/public/application.css +1 -799
  27. data/public/application.js +7 -1707
  28. data/simplecov-html.gemspec +5 -4
  29. data/test/helper.rb +2 -0
  30. data/test/test_simple_cov-html.rb +3 -1
  31. data/views/covered_percent.erb +3 -0
  32. data/views/file_list.erb +63 -30
  33. data/views/layout.erb +8 -8
  34. data/views/source_file.erb +40 -9
  35. metadata +33 -40
  36. data/assets/javascripts/libraries/jquery-1.6.2.min.js +0 -18
  37. data/assets/javascripts/plugins/jquery.dataTables.min.js +0 -152
  38. data/assets/javascripts/plugins/jquery.url.js +0 -174
  39. data/assets/stylesheets/screen.css.sass +0 -220
  40. /data/public/{smoothness/images → images}/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  41. /data/public/{smoothness/images → images}/ui-bg_flat_75_ffffff_40x100.png +0 -0
  42. /data/public/{smoothness/images → images}/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  43. /data/public/{smoothness/images → images}/ui-bg_glass_65_ffffff_1x400.png +0 -0
  44. /data/public/{smoothness/images → images}/ui-bg_glass_75_dadada_1x400.png +0 -0
  45. /data/public/{smoothness/images → images}/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  46. /data/public/{smoothness/images → images}/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  47. /data/public/{smoothness/images → images}/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  48. /data/public/{smoothness/images → images}/ui-icons_222222_256x240.png +0 -0
  49. /data/public/{smoothness/images → images}/ui-icons_2e83ff_256x240.png +0 -0
  50. /data/public/{smoothness/images → images}/ui-icons_454545_256x240.png +0 -0
  51. /data/public/{smoothness/images → images}/ui-icons_888888_256x240.png +0 -0
  52. /data/public/{smoothness/images → images}/ui-icons_cd0a0a_256x240.png +0 -0
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  $LOAD_PATH.push File.expand_path("../lib", __FILE__)
2
4
  require "simplecov-html/version"
3
5
 
@@ -7,13 +9,12 @@ Gem::Specification.new do |gem|
7
9
  gem.platform = Gem::Platform::RUBY
8
10
  gem.authors = ["Christoph Olszowka"]
9
11
  gem.email = ["christoph at olszowka de"]
10
- gem.homepage = "https://github.com/colszowka/simplecov-html"
11
- gem.description = %(Default HTML formatter for SimpleCov code coverage tool for ruby 1.9+)
12
+ gem.homepage = "https://github.com/simplecov-ruby/simplecov-html"
13
+ gem.description = %(Default HTML formatter for SimpleCov code coverage tool for ruby 2.4+)
12
14
  gem.summary = gem.description
13
15
  gem.license = "MIT"
14
16
 
15
- gem.required_ruby_version = ">= 1.8.7"
16
- gem.add_development_dependency "bundler", "~> 1.9"
17
+ gem.required_ruby_version = ">= 2.4"
17
18
 
18
19
  gem.files = `git ls-files`.split("\n")
19
20
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
data/test/helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/setup"
2
4
  require "simplecov"
3
5
  require "simplecov-html"
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "helper"
2
4
 
3
- class TestSimpleCovHtml < MiniTest::Unit::TestCase
5
+ class TestSimpleCovHtml < Minitest::Test
4
6
  def test_defined
5
7
  assert defined?(SimpleCov::Formatter::HTMLFormatter)
6
8
  assert defined?(SimpleCov::Formatter::HTMLFormatter::VERSION)
@@ -0,0 +1,3 @@
1
+ <span class="<%= coverage_css_class(percent) %>">
2
+ <%= percent.round(2) %>%
3
+ </span>
data/views/file_list.erb CHANGED
@@ -1,45 +1,78 @@
1
1
  <div class="file_list_container" id="<%= title_id %>">
2
2
  <h2>
3
3
  <span class="group_name"><%= title %></span>
4
- (<span class="covered_percent"><span class="<%= coverage_css_class(source_files.covered_percent) %>"><%= source_files.covered_percent.round(2) %>%</span></span>
4
+ (<span class="covered_percent">
5
+ <%= covered_percent(source_files.covered_percent) %>
6
+ </span>
5
7
  covered at
6
8
  <span class="covered_strength">
7
9
  <span class="<%= strength_css_class(source_files.covered_strength) %>">
8
10
  <%= source_files.covered_strength.round(2) %>
9
11
  </span>
10
- </span> hits/line)
12
+ </span> hits/line
13
+ )
11
14
  </h2>
15
+
12
16
  <a name="<%= title_id %>"></a>
17
+
13
18
  <div>
14
19
  <b><%= source_files.length %></b> files in total.
15
- <b><%= source_files.lines_of_code %></b> relevant lines.
20
+ </div>
21
+
22
+ <div class="t-line-summary">
23
+ <b><%= source_files.lines_of_code %></b> relevant lines,
16
24
  <span class="green"><b><%= source_files.covered_lines %></b> lines covered</span> and
17
- <span class="red"><b><%= source_files.missed_lines %></b> lines missed </span>
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>
18
77
  </div>
19
- <table class="file_list">
20
- <thead>
21
- <tr>
22
- <th>File</th>
23
- <th>% covered</th>
24
- <th>Lines</th>
25
- <th>Relevant Lines</th>
26
- <th>Lines covered</th>
27
- <th>Lines missed</th>
28
- <th>Avg. Hits / Line</th>
29
- </tr>
30
- </thead>
31
- <tbody>
32
- <% source_files.each do |source_file| %>
33
- <tr>
34
- <td class="strong"><%= link_to_source_file(source_file) %></td>
35
- <td class="<%= coverage_css_class(source_file.covered_percent) %> strong"><%= source_file.covered_percent.round(2).to_s %> %</td>
36
- <td><%= source_file.lines.count %></td>
37
- <td><%= source_file.covered_lines.count + source_file.missed_lines.count %></td>
38
- <td><%= source_file.covered_lines.count %></td>
39
- <td><%= source_file.missed_lines.count %></td>
40
- <td><%= source_file.covered_strength %></td>
41
- </tr>
42
- <% end %>
43
- </tbody>
44
- </table>
45
78
  </div>
data/views/layout.erb CHANGED
@@ -3,17 +3,17 @@
3
3
  <head>
4
4
  <title>Code coverage for <%= SimpleCov.project_name %></title>
5
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'>
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
8
  <link rel="shortcut icon" type="image/png" href="<%= assets_path("favicon_#{coverage_css_class(result.source_files.covered_percent)}.png") %>" />
9
9
  <link rel="icon" type="image/png" href="<%= assets_path('favicon.png') %>" />
10
10
  </head>
11
-
12
- <body>
11
+
12
+ <body<%= ' data-branch-coverage=true' if branchable_result? %>>
13
13
  <div id="loading">
14
14
  <img src="<%= assets_path('loading.gif') %>" alt="loading"/>
15
15
  </div>
16
- <div id="wrapper" style="display:none;">
16
+ <div id="wrapper" class="hide">
17
17
  <div class="timestamp">Generated <%= timeago(Time.now) %></div>
18
18
  <ul class="group_tabs"></ul>
19
19
 
@@ -24,13 +24,13 @@
24
24
  <%= formatted_file_list(name, files) %>
25
25
  <% end %>
26
26
  </div>
27
-
27
+
28
28
  <div id="footer">
29
- Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v<%= SimpleCov::VERSION %>
29
+ Generated by <a href="https://github.com/simplecov-ruby/simplecov">simplecov</a> v<%= SimpleCov::VERSION %>
30
30
  and simplecov-html v<%= SimpleCov::Formatter::HTMLFormatter::VERSION %><br/>
31
31
  using <%= result.command_name %>
32
32
  </div>
33
-
33
+
34
34
  <div class="source_files">
35
35
  <% result.source_files.each do |source_file| %>
36
36
  <%= formatted_source_file(source_file) %>
@@ -1,22 +1,53 @@
1
1
  <div class="source_table" id="<%= id source_file %>">
2
2
  <div class="header">
3
3
  <h3><%= shortened_filename source_file %></h3>
4
- <h4><span class="<%= coverage_css_class(source_file.covered_percent) %>"><%= source_file.covered_percent.round(2).to_s %> %</span> covered</h4>
5
- <div>
6
- <b><%= source_file.lines_of_code %></b> relevant lines.
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.
7
18
  <span class="green"><b><%= source_file.covered_lines.count %></b> lines covered</span> and
8
19
  <span class="red"><b><%= source_file.missed_lines.count %></b> lines missed.</span>
9
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
+
10
30
  </div>
11
-
31
+
12
32
  <pre>
13
33
  <ol>
14
34
  <% source_file.lines.each do |line| %>
15
- <li class="<%= line.status %>" data-hits="<%= line.coverage ? line.coverage : '' %>" data-linenumber="<%= line.number %>">
16
- <% if line.covered? %><span class="hits"><%= line.coverage %></span><% end %>
17
- <% if line.skipped? %><span class="hits">skipped</span><% end %>
18
- <code class="ruby"><%= CGI.escapeHTML(line.src.chomp) %></code>
19
- </li>
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>
20
51
  <% end %>
21
52
  </ol>
22
53
  </pre>
metadata CHANGED
@@ -1,30 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christoph Olszowka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-14 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.9'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.9'
27
- description: Default HTML formatter for SimpleCov code coverage tool for ruby 1.9+
11
+ date: 2020-09-23 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Default HTML formatter for SimpleCov code coverage tool for ruby 2.4+
28
14
  email:
29
15
  - christoph at olszowka de
30
16
  executables: []
@@ -34,28 +20,35 @@ files:
34
20
  - ".document"
35
21
  - ".gitignore"
36
22
  - ".rubocop.yml"
23
+ - ".tool-versions"
37
24
  - ".travis.yml"
38
25
  - CHANGELOG.md
39
26
  - Gemfile
27
+ - Gemfile.lock
40
28
  - Guardfile
41
29
  - LICENSE
42
30
  - README.md
43
31
  - Rakefile
44
32
  - assets/javascripts/application.js
45
- - assets/javascripts/libraries/jquery-1.6.2.min.js
33
+ - assets/javascripts/libraries/jquery-3.4.1.js
46
34
  - assets/javascripts/plugins/highlight.pack.js
47
35
  - assets/javascripts/plugins/jquery.colorbox.js
48
- - assets/javascripts/plugins/jquery.dataTables.min.js
36
+ - assets/javascripts/plugins/jquery.dataTables.js
49
37
  - assets/javascripts/plugins/jquery.timeago.js
50
- - assets/javascripts/plugins/jquery.url.js
51
38
  - assets/stylesheets/application.css
39
+ - assets/stylesheets/plugins/datatables.css
52
40
  - assets/stylesheets/plugins/highlight.css
53
41
  - assets/stylesheets/plugins/jquery-ui-1.8.4.custom.css
54
42
  - assets/stylesheets/plugins/jquery.colorbox.css
55
43
  - assets/stylesheets/reset.css
56
- - assets/stylesheets/screen.css.sass
44
+ - assets/stylesheets/screen.css
57
45
  - lib/simplecov-html.rb
58
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
59
52
  - public/application.css
60
53
  - public/application.js
61
54
  - public/colorbox/border.png
@@ -65,28 +58,29 @@ files:
65
58
  - public/favicon_green.png
66
59
  - public/favicon_red.png
67
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
68
74
  - public/loading.gif
69
75
  - public/magnify.png
70
- - public/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
71
- - public/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
72
- - public/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
73
- - public/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
74
- - public/smoothness/images/ui-bg_glass_75_dadada_1x400.png
75
- - public/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
76
- - public/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
77
- - public/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
78
- - public/smoothness/images/ui-icons_222222_256x240.png
79
- - public/smoothness/images/ui-icons_2e83ff_256x240.png
80
- - public/smoothness/images/ui-icons_454545_256x240.png
81
- - public/smoothness/images/ui-icons_888888_256x240.png
82
- - public/smoothness/images/ui-icons_cd0a0a_256x240.png
83
76
  - simplecov-html.gemspec
84
77
  - test/helper.rb
85
78
  - test/test_simple_cov-html.rb
79
+ - views/covered_percent.erb
86
80
  - views/file_list.erb
87
81
  - views/layout.erb
88
82
  - views/source_file.erb
89
- homepage: https://github.com/colszowka/simplecov-html
83
+ homepage: https://github.com/simplecov-ruby/simplecov-html
90
84
  licenses:
91
85
  - MIT
92
86
  metadata: {}
@@ -98,16 +92,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
92
  requirements:
99
93
  - - ">="
100
94
  - !ruby/object:Gem::Version
101
- version: 1.8.7
95
+ version: '2.4'
102
96
  required_rubygems_version: !ruby/object:Gem::Requirement
103
97
  requirements:
104
98
  - - ">="
105
99
  - !ruby/object:Gem::Version
106
100
  version: '0'
107
101
  requirements: []
108
- rubyforge_project:
109
- rubygems_version: 2.6.10
102
+ rubygems_version: 3.1.2
110
103
  signing_key:
111
104
  specification_version: 4
112
- summary: Default HTML formatter for SimpleCov code coverage tool for ruby 1.9+
105
+ summary: Default HTML formatter for SimpleCov code coverage tool for ruby 2.4+
113
106
  test_files: []