simplecov-hypertext 0.0.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.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/.ruby-version +1 -0
  4. data/CHANGELOG.md +5 -0
  5. data/LICENSE +21 -0
  6. data/README.md +15 -0
  7. data/Rakefile +55 -0
  8. data/lib/simplecov_hypertext/version.rb +9 -0
  9. data/lib/simplecov_hypertext.rb +174 -0
  10. data/public/DataTables-1.10.20/images/sort_asc.png +0 -0
  11. data/public/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
  12. data/public/DataTables-1.10.20/images/sort_both.png +0 -0
  13. data/public/DataTables-1.10.20/images/sort_desc.png +0 -0
  14. data/public/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
  15. data/public/application.css +1 -0
  16. data/public/application.js +7 -0
  17. data/public/colorbox/border.png +0 -0
  18. data/public/colorbox/controls.png +0 -0
  19. data/public/colorbox/loading.gif +0 -0
  20. data/public/colorbox/loading_background.png +0 -0
  21. data/public/favicon_green.png +0 -0
  22. data/public/favicon_red.png +0 -0
  23. data/public/favicon_yellow.png +0 -0
  24. data/public/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  25. data/public/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  26. data/public/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  27. data/public/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  28. data/public/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  29. data/public/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  30. data/public/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  31. data/public/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  32. data/public/images/ui-icons_222222_256x240.png +0 -0
  33. data/public/images/ui-icons_2e83ff_256x240.png +0 -0
  34. data/public/images/ui-icons_454545_256x240.png +0 -0
  35. data/public/images/ui-icons_888888_256x240.png +0 -0
  36. data/public/images/ui-icons_cd0a0a_256x240.png +0 -0
  37. data/public/loading.gif +0 -0
  38. data/public/magnify.png +0 -0
  39. data/views/covered_percent.erb +3 -0
  40. data/views/file_list.erb +78 -0
  41. data/views/layout.erb +34 -0
  42. data/views/source_file.erb +70 -0
  43. metadata +86 -0
Binary file
Binary file
@@ -0,0 +1,3 @@
1
+ <span class="<%= coverage_css_class(percent) %>">
2
+ <%= percent.round(2) %>%
3
+ </span>
@@ -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,34 @@
1
+ <!DOCTYPE html>
2
+ <html>
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="icon" type="image/png" href="<%= assets_path("favicon_#{coverage_css_class(result.source_files.covered_percent)}.png") %>" />
9
+ </head>
10
+
11
+ <body<%= ' data-branch-coverage=true' if branchable_result? %>>
12
+ <div id="loading">
13
+ <img src="<%= assets_path('loading.gif') %>" alt="loading"/>
14
+ </div>
15
+ <div id="wrapper" class="hide">
16
+ <div class="timestamp">Generated <%= timeago(Time.now) %></div>
17
+ <ul class="group_tabs"></ul>
18
+
19
+ <div id="content">
20
+ <%= formatted_file_list("All Files", result.source_files) %>
21
+
22
+ <% result.groups.each do |name, files| %>
23
+ <%= formatted_file_list(name, files) %>
24
+ <% end %>
25
+ </div>
26
+
27
+ <div id="footer">
28
+ Generated by <a href="https://github.com/simplecov-ruby/simplecov">simplecov</a> v<%= SimpleCov::VERSION %>
29
+ and simplecov-hypertext v<%= SimpleCov::Formatter::HypertextFormatter::VERSION %><br/>
30
+ using <%= result.command_name %>
31
+ </div>
32
+ </div>
33
+ </body>
34
+ </html>
@@ -0,0 +1,70 @@
1
+ <html>
2
+ <head>
3
+ <title>Code coverage for <%= shortened_filename(source_file) %></title>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
+ <script src='<%= assets_path('source.js') %>' type='text/javascript'></script>
6
+ <link href='../<%= assets_path('application.css') %>' media='screen, projection, print' rel='stylesheet' type='text/css' />
7
+ <link rel="icon" type="image/png" href="<%= assets_path("favicon_#{coverage_css_class(result.source_files.covered_percent)}.png") %>" />
8
+ </head>
9
+ <body>
10
+ <div class="source_table" id="source_table">
11
+ <div id="content">
12
+ <div class="header">
13
+ <h3><%= shortened_filename(source_file) %></h3>
14
+ <h4>
15
+ <%= covered_percent(source_file.covered_percent) %>
16
+ lines covered
17
+ </h4>
18
+
19
+ <% if branchable_result? %>
20
+ <h4>
21
+ <%= covered_percent(source_file.branches_coverage_percent) %>
22
+ branches covered
23
+ </h4>
24
+ <% end %>
25
+
26
+ <div class="t-line-summary">
27
+ <b><%= source_file.lines_of_code %></b> relevant lines.
28
+ <span class="green"><b><%= source_file.covered_lines.count %></b> lines covered</span> and
29
+ <span class="red"><b><%= source_file.missed_lines.count %></b> lines missed.</span>
30
+ </div>
31
+
32
+ <% if branchable_result? %>
33
+ <div class="t-branch-summary">
34
+ <span><b><%= source_file.total_branches.count %></b> total branches, </span>
35
+ <span class="green"><b><%= source_file.covered_branches.count %></b> branches covered</span> and
36
+ <span class="red"><b><%= source_file.missed_branches.count %></b> branches missed.</span>
37
+ </div>
38
+ <% end %>
39
+ </div>
40
+
41
+ <pre>
42
+ <ol>
43
+ <% source_file.lines.each do |line| %>
44
+ <div>
45
+ <li class="<%= line_status?(source_file, line) %>" data-hits="<%= line.coverage ? line.coverage : '' %>" data-linenumber="<%= line.number %>">
46
+ <% if line.covered? %>
47
+ <span class="hits"><%= line.coverage %></span>
48
+ <% elsif line.skipped? %>
49
+ <span class="hits">skipped</span>
50
+ <% end %>
51
+
52
+ <% if branchable_result? %>
53
+ <% source_file.branches_for_line(line.number).each do |branch_type, hit_count| %>
54
+ <span class="hits" title="<%= branch_type%> branch hit <%= hit_count %> times">
55
+ <%= branch_type %>: <%= hit_count %>
56
+ </span>
57
+ <% end %>
58
+ <% end %>
59
+
60
+ <code class="ruby"><%= ERB::Util.html_escape(line.src.chomp) %></code>
61
+ </li>
62
+ </div>
63
+ <% end %>
64
+ </ol>
65
+ </pre>
66
+ </div>
67
+ </div>
68
+ </body>
69
+ </html>
70
+
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: simplecov-hypertext
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Christoph Olszowka
8
+ - Alan Ridlehoover
9
+ - Fito von Zastrow
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 1980-01-02 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Hypertext formatter for SimpleCov code coverage tool that supports large
15
+ codebases.
16
+ email:
17
+ - admin@firsttry.software
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ".document"
23
+ - ".ruby-version"
24
+ - CHANGELOG.md
25
+ - LICENSE
26
+ - README.md
27
+ - Rakefile
28
+ - lib/simplecov_hypertext.rb
29
+ - lib/simplecov_hypertext/version.rb
30
+ - public/DataTables-1.10.20/images/sort_asc.png
31
+ - public/DataTables-1.10.20/images/sort_asc_disabled.png
32
+ - public/DataTables-1.10.20/images/sort_both.png
33
+ - public/DataTables-1.10.20/images/sort_desc.png
34
+ - public/DataTables-1.10.20/images/sort_desc_disabled.png
35
+ - public/application.css
36
+ - public/application.js
37
+ - public/colorbox/border.png
38
+ - public/colorbox/controls.png
39
+ - public/colorbox/loading.gif
40
+ - public/colorbox/loading_background.png
41
+ - public/favicon_green.png
42
+ - public/favicon_red.png
43
+ - public/favicon_yellow.png
44
+ - public/images/ui-bg_flat_0_aaaaaa_40x100.png
45
+ - public/images/ui-bg_flat_75_ffffff_40x100.png
46
+ - public/images/ui-bg_glass_55_fbf9ee_1x400.png
47
+ - public/images/ui-bg_glass_65_ffffff_1x400.png
48
+ - public/images/ui-bg_glass_75_dadada_1x400.png
49
+ - public/images/ui-bg_glass_75_e6e6e6_1x400.png
50
+ - public/images/ui-bg_glass_95_fef1ec_1x400.png
51
+ - public/images/ui-bg_highlight-soft_75_cccccc_1x100.png
52
+ - public/images/ui-icons_222222_256x240.png
53
+ - public/images/ui-icons_2e83ff_256x240.png
54
+ - public/images/ui-icons_454545_256x240.png
55
+ - public/images/ui-icons_888888_256x240.png
56
+ - public/images/ui-icons_cd0a0a_256x240.png
57
+ - public/loading.gif
58
+ - public/magnify.png
59
+ - views/covered_percent.erb
60
+ - views/file_list.erb
61
+ - views/layout.erb
62
+ - views/source_file.erb
63
+ homepage: https://github.com/first-try-software/simplecov-hypertext
64
+ licenses:
65
+ - MIT
66
+ metadata:
67
+ rubygems_mfa_required: 'true'
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '2.4'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubygems_version: 3.6.7
83
+ specification_version: 4
84
+ summary: Hypertext formatter for SimpleCov code coverage tool that supports large
85
+ codebases.
86
+ test_files: []