simplecov-html 0.10.2 → 0.11.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7b390927b4068494470bc6dab12d889374683b2c
4
- data.tar.gz: a489f2db591a59851a07b12895730339c9537f54
2
+ SHA256:
3
+ metadata.gz: 9739b1c1b636276583372c62e709b89efe4312ce6495f37df3fef5d6b70d297b
4
+ data.tar.gz: d2df67e60673a9be60ae1252addfea3ffeff56e323a79015fa1cd986f5fbfd6c
5
5
  SHA512:
6
- metadata.gz: a717a3f32fb55f02ae13694389bc7c85bd8f1e6bcab853176cbdbc97e9d87ead21b06610b1f1d20a6b0b97a61e430eb189af20f4f5dadff54ce37bfacaaa4e5c
7
- data.tar.gz: '08d47a31edd879fb6551a1e316ea3729ca49f8f3f9eb3ef2523086e134af2178c013316ec33df4e5c59d0b013d937198419c85e0f0fa12fa376847bd9cce06d0'
6
+ metadata.gz: cd6bfbaa06863385d1e98bcf6693067594c247565676bb41a609e164c25ac06be9a3475beb6bf3e71b655d95b910e90b1bf270d2a0e52d8ffdd2e9e902840794
7
+ data.tar.gz: 3043020012fb6b0e3d16c821c162d011e63c12494c9b9d094a2cd4ef261baac3dd5f07433b441b518d2fb515f27756966da7b995427f1c82255671f0f590c0cf
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  .rvmrc
2
2
  .bundle
3
- Gemfile.lock
4
3
 
5
4
  ## MAC OS
6
5
  .DS_Store
@@ -1,7 +1,23 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+ DisplayCopNames: true
4
+
5
+ Bundler/DuplicatedGem:
6
+ Enabled: false
7
+
8
+ Gemspec/RequiredRubyVersion:
9
+ Enabled: false
10
+
11
+ Layout/AccessModifierIndentation:
12
+ EnforcedStyle: outdent
13
+
14
+ Layout/SpaceInsideHashLiteralBraces:
15
+ EnforcedStyle: no_space
16
+
1
17
  Metrics/BlockNesting:
2
18
  Max: 2
3
19
 
4
- Metrics/LineLength:
20
+ Layout/LineLength:
5
21
  AllowURI: true
6
22
  Enabled: false
7
23
 
@@ -13,15 +29,17 @@ Metrics/ParameterLists:
13
29
  Max: 4
14
30
  CountKeywordArgs: true
15
31
 
16
- Style/AccessModifierIndentation:
17
- EnforcedStyle: outdent
32
+ Naming/FileName:
33
+ Exclude:
34
+ - "lib/simplecov-html.rb"
35
+ - "test/test_simple_cov-html.rb"
18
36
 
19
37
  Style/CollectionMethods:
20
38
  PreferredMethods:
21
- map: 'collect'
22
- reduce: 'inject'
23
- find: 'detect'
24
- find_all: 'select'
39
+ map: "collect"
40
+ reduce: "inject"
41
+ find: "detect"
42
+ find_all: "select"
25
43
 
26
44
  Style/Documentation:
27
45
  Enabled: false
@@ -29,26 +47,33 @@ Style/Documentation:
29
47
  Style/DoubleNegation:
30
48
  Enabled: false
31
49
 
32
- Style/FileName:
33
- Exclude:
34
- - 'lib/simplecov-html.rb'
35
- - 'test/test_simple_cov-html.rb'
50
+ Style/ExpandPathArguments:
51
+ Enabled: false
52
+
53
+ Style/FrozenStringLiteralComment:
54
+ Enabled: true
36
55
 
37
56
  Style/HashSyntax:
38
57
  EnforcedStyle: hash_rockets
39
58
 
40
59
  Style/MutableConstant:
41
60
  Exclude:
42
- - 'lib/simplecov-html/version.rb'
61
+ - "lib/simplecov-html/version.rb"
43
62
 
44
- Style/RegexpLiteral:
63
+ Style/NumericPredicate:
45
64
  Enabled: false
46
65
 
47
- Style/SpaceInsideHashLiteralBraces:
48
- EnforcedStyle: no_space
66
+ Style/RegexpLiteral:
67
+ Enabled: false
49
68
 
50
69
  Style/StringLiterals:
51
70
  EnforcedStyle: double_quotes
52
71
 
53
- Style/TrailingCommaInLiteral:
54
- EnforcedStyleForMultiline: 'comma'
72
+ Style/SymbolArray:
73
+ Enabled: false
74
+
75
+ Style/TrailingCommaInHashLiteral:
76
+ EnforcedStyleForMultiline: "comma"
77
+
78
+ Style/TrailingCommaInArrayLiteral:
79
+ EnforcedStyleForMultiline: "comma"
@@ -0,0 +1 @@
1
+ ruby 2.6.5
@@ -1,29 +1,25 @@
1
1
  language: ruby
2
2
 
3
3
  before_install:
4
- - gem install bundler
4
+ - gem i bundler
5
5
 
6
- bundler_args: --without development --jobs=3 --retry=3
7
-
8
- cache: bundler
9
-
10
- sudo: false
11
-
12
- rvm:
13
- - 1.8.7
14
- - 1.9.3
15
- - 2.0.0
16
- - 2.1
17
- - 2.2
18
- - 2.3.1
19
- - ruby-head
20
- - jruby
21
- - rbx-2
22
- - jruby-9.1.12.0
6
+ bundler_args: --without benchmark --jobs=3 --retry=3
23
7
 
24
8
  matrix:
9
+ include:
10
+ - rvm: 2.4.9
11
+ - rvm: 2.5.7
12
+ - rvm: 2.6.5
13
+ - rvm: 2.7.0
14
+ - rvm: jruby-9.2.9.0
15
+ env: JRUBY_OPTS=--debug
16
+ jdk: openjdk8
17
+ - rvm: ruby-head
18
+ - rvm: jruby-head
19
+ env: JRUBY_OPTS=--debug
20
+ jdk: openjdk8
25
21
  allow_failures:
26
22
  - rvm: ruby-head
27
- - rvm: jruby
28
- - rvm: rbx-2
23
+ - rvm: jruby-head
24
+ env: JRUBY_OPTS=--debug
29
25
  fast_finish: true
@@ -1,11 +1,23 @@
1
- 0.10.2 2017-08-14
1
+ 0.11.0.beta1 (2020-01-05)
2
+ ========
3
+
4
+ Changes ruby support to 2.4+, adds branch coverage support. Meant to be used with simplecov 0.18
5
+
6
+ ## Breaking Changes
7
+ * Drops support for EOL'ed ruby versions, new support is ~> 2.4
8
+
9
+ ## Enhancements
10
+ * Support/display of branch coverage from simplecov 0.18.0.beta1, little badges saying `hit_count, positive_or_negative` will appear next to lines if branch coverage is activated. `0, +` means positive branch was never hit, `2, -` means negative branch was hit twice
11
+ * Encoding compatibility errors are now caught and printed out
12
+
13
+ 0.10.2 (2017-08-14)
2
14
  ========
3
15
 
4
16
  ## Bugfixes
5
17
 
6
18
  * Allow usage with frozen-string-literal-enabled. See [#56](https://github.com/colszowka/simplecov-html/pull/56) (thanks @pat)
7
19
 
8
- 0.10.1 2017-05-17
20
+ 0.10.1 (2017-05-17)
9
21
  ========
10
22
 
11
23
  ## Bugfixes
data/Gemfile CHANGED
@@ -1,26 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
5
  gemspec
4
6
 
5
- if RUBY_VERSION == "1.8.7"
6
- gem "rake", "~> 10.5"
7
- else
8
- gem "rake", ">= 11"
9
- end
7
+ gem "rake", ">= 11"
10
8
 
11
9
  # Use local copy of simplecov in development when checked out, fetch from git otherwise
12
10
  if File.directory?(File.dirname(__FILE__) + "/../simplecov")
13
11
  gem "simplecov", :path => File.dirname(__FILE__) + "/../simplecov"
14
12
  else
15
- gem "simplecov", :git => "https://github.com/colszowka/simplecov"
16
- end
17
-
18
- platforms :ruby_18, :ruby_19 do
19
- gem "json", "~> 1.8"
20
- end
21
-
22
- platforms :ruby_18, :ruby_19, :ruby_20, :ruby_21 do
23
- gem "rack", "~> 1.6"
13
+ gem "simplecov", :github => "colszowka/simplecov"
24
14
  end
25
15
 
26
16
  group :test do
@@ -30,5 +20,6 @@ end
30
20
  group :development do
31
21
  gem "rubocop"
32
22
  gem "sass"
33
- gem "sprockets"
23
+ # sprockets 4.0 requires ruby 2.5+
24
+ gem "sprockets", "~> 3.7"
34
25
  end
@@ -0,0 +1,62 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ simplecov-html (0.11.0.beta1)
5
+
6
+ PATH
7
+ remote: /home/tobi/github/simplecov
8
+ specs:
9
+ simplecov (0.18.0.beta1)
10
+ docile (~> 1.1)
11
+ simplecov-html (~> 0.11.0.beta1)
12
+
13
+ GEM
14
+ remote: https://rubygems.org/
15
+ specs:
16
+ ast (2.4.0)
17
+ concurrent-ruby (1.1.5)
18
+ docile (1.3.2)
19
+ ffi (1.11.3)
20
+ jaro_winkler (1.5.4)
21
+ minitest (5.13.0)
22
+ parallel (1.19.1)
23
+ parser (2.7.0.1)
24
+ ast (~> 2.4.0)
25
+ rack (2.0.7)
26
+ rainbow (3.0.0)
27
+ rake (13.0.1)
28
+ rb-fsevent (0.10.3)
29
+ rb-inotify (0.10.0)
30
+ ffi (~> 1.0)
31
+ rubocop (0.78.0)
32
+ jaro_winkler (~> 1.5.1)
33
+ parallel (~> 1.10)
34
+ parser (>= 2.6)
35
+ rainbow (>= 2.2.2, < 4.0)
36
+ ruby-progressbar (~> 1.7)
37
+ unicode-display_width (>= 1.4.0, < 1.7)
38
+ ruby-progressbar (1.10.1)
39
+ sass (3.7.4)
40
+ sass-listen (~> 4.0.0)
41
+ sass-listen (4.0.0)
42
+ rb-fsevent (~> 0.9, >= 0.9.4)
43
+ rb-inotify (~> 0.9, >= 0.9.7)
44
+ sprockets (3.7.2)
45
+ concurrent-ruby (~> 1.0)
46
+ rack (> 1, < 3)
47
+ unicode-display_width (1.6.0)
48
+
49
+ PLATFORMS
50
+ ruby
51
+
52
+ DEPENDENCIES
53
+ minitest
54
+ rake (>= 11)
55
+ rubocop
56
+ sass
57
+ simplecov!
58
+ simplecov-html!
59
+ sprockets (~> 3.7)
60
+
61
+ BUNDLED WITH
62
+ 2.0.2
data/Guardfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # A sample Guardfile
2
4
  # More info at https://github.com/guard/guard#readme
3
5
 
data/README.md CHANGED
@@ -3,7 +3,7 @@ Default HTML formatter for SimpleCov
3
3
 
4
4
  ***Note: To learn more about SimpleCov, check out the main repo at https://github.com/colszowka/simplecov***
5
5
 
6
- Generates a nice HTML report of your SimpleCov ruby code coverage results on Ruby 1.9 using client-side Javascript
6
+ Generates a nice HTML report of your SimpleCov ruby code coverage results on Ruby 2.4+ using client-side Javascript
7
7
  quite extensively.
8
8
 
9
9
 
@@ -17,7 +17,7 @@ modify the formatter, please make sure the simplecov test suites still pass by d
17
17
  * `cd` there, run `bundle`
18
18
  * You should end up with all dev dependencies installed and simplecov-html being used from your disk
19
19
  * Run the tests (units and features)
20
-
20
+
21
21
  Please remember to add tests if you add functionality.
22
22
 
23
23
  **Important:** If you modify the JS/CSS assets, you'll have to precompile them using `rake assets:compile` - otherwise,
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler"
2
4
  Bundler::GemHelper.install_tasks
3
5
 
@@ -21,7 +23,7 @@ begin
21
23
  RuboCop::RakeTask.new
22
24
  rescue LoadError
23
25
  task :rubocop do
24
- $stderr.puts "Rubocop is disabled"
26
+ warn "Rubocop is disabled"
25
27
  end
26
28
  end
27
29
 
@@ -7,16 +7,7 @@ $(document).ready(function() {
7
7
  $('.file_list').dataTable({
8
8
  "aaSorting": [[ 1, "asc" ]],
9
9
  "bPaginate": false,
10
- "bJQueryUI": true,
11
- "aoColumns": [
12
- null,
13
- { "sType": "percent" },
14
- null,
15
- null,
16
- null,
17
- null,
18
- null
19
- ]
10
+ "bJQueryUI": true
20
11
  });
21
12
 
22
13
  // Syntax highlight all files up front - deactivated
@@ -124,4 +115,5 @@ $(document).ready(function() {
124
115
  $("abbr.timeago").timeago();
125
116
  $('#loading').fadeOut();
126
117
  $('#wrapper').show();
118
+ $('.dataTables_filter input').focus()
127
119
  });
@@ -188,6 +188,8 @@ td
188
188
 
189
189
  .yellow
190
190
  color: #da0
191
+ .blue
192
+ color: blue
191
193
 
192
194
  .source_table
193
195
  .covered
@@ -198,6 +200,8 @@ td
198
200
  border-color: black
199
201
  .skipped
200
202
  border-color: #fc0
203
+ .missed-branch
204
+ border-color: #bf0000
201
205
  .covered
202
206
  &:nth-child(odd)
203
207
  background-color: #CDF2CD
@@ -217,4 +221,9 @@ td
217
221
  &:nth-child(odd)
218
222
  background-color: #FBF0C0
219
223
  &:nth-child(even)
220
- background-color: #FBFfCf
224
+ background-color: #FBFfCf
225
+ .missed-branch
226
+ &:nth-child(odd)
227
+ background-color: #cc8e8e
228
+ &:nth-child(even)
229
+ background-color: #cc6e6e
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "erb"
2
4
  require "cgi"
3
5
  require "fileutils"
@@ -29,6 +31,20 @@ module SimpleCov
29
31
  "Coverage report generated for #{result.command_name} to #{output_path}. #{result.covered_lines} / #{result.total_lines} LOC (#{result.covered_percent.round(2)}%) covered."
30
32
  end
31
33
 
34
+ # Check if branchable results supported or not
35
+ # Try used here to escape exceptions
36
+ def branchable_result?
37
+ SimpleCov.branch_coverage?
38
+ end
39
+
40
+ def line_status?(source_file, line)
41
+ if branchable_result? && source_file.line_with_missed_branch?(line.number)
42
+ "missed-branch"
43
+ else
44
+ line.status
45
+ end
46
+ end
47
+
32
48
  private
33
49
 
34
50
  # Returns the an erb instance for the template of given name
@@ -42,6 +58,7 @@ module SimpleCov
42
58
 
43
59
  def asset_output_path
44
60
  return @asset_output_path if defined?(@asset_output_path) && @asset_output_path
61
+
45
62
  @asset_output_path = File.join(output_path, "assets", SimpleCov::Formatter::HTMLFormatter::VERSION)
46
63
  FileUtils.mkdir_p(@asset_output_path)
47
64
  @asset_output_path
@@ -54,6 +71,8 @@ module SimpleCov
54
71
  # Returns the html for the given source_file
55
72
  def formatted_source_file(source_file)
56
73
  template("source_file").result(binding)
74
+ rescue Encoding::CompatibilityError => e
75
+ puts "Encoding problems with file #{source_file.filename}. Simplecov/ERB can't handle non ASCII characters in filenames. Error: #{e.message}."
57
76
  end
58
77
 
59
78
  # Returns a table containing the given source files
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SimpleCov
2
4
  module Formatter
3
5
  class HTMLFormatter
4
- VERSION = "0.10.2".freeze
6
+ VERSION = "0.11.0.beta1"
5
7
  end
6
8
  end
7
9
  end
@@ -532,6 +532,7 @@ pre .tex .formula {
532
532
  ColorBox Core Style:
533
533
  The following CSS is consistent between example themes and should not be altered.
534
534
  */
535
+
535
536
  #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
536
537
  #cboxOverlay{position:fixed; width:100%; height:100%;}
537
538
  #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
@@ -586,19 +587,19 @@ pre .tex .formula {
586
587
  top: 50%; }
587
588
 
588
589
  a {
589
- color: #333333;
590
+ color: #333;
590
591
  text-decoration: none; }
591
592
  a:hover {
592
- color: black;
593
+ color: #000;
593
594
  text-decoration: underline; }
594
595
 
595
596
  body {
596
597
  font-family: "Lucida Grande", Helvetica, "Helvetica Neue", Arial, sans-serif;
597
598
  padding: 12px;
598
- background-color: #333333; }
599
+ background-color: #333; }
599
600
 
600
601
  h1, h2, h3, h4 {
601
- color: #1c2324;
602
+ color: #1C2324;
602
603
  margin: 0;
603
604
  padding: 0;
604
605
  margin-bottom: 12px; }
@@ -609,8 +610,8 @@ table {
609
610
  #content {
610
611
  clear: left;
611
612
  background-color: white;
612
- border: 2px solid #dddddd;
613
- border-top: 8px solid #dddddd;
613
+ border: 2px solid #ddd;
614
+ border-top: 8px solid #ddd;
614
615
  padding: 18px;
615
616
  -webkit-border-bottom-left-radius: 5px;
616
617
  -webkit-border-bottom-right-radius: 5px;
@@ -632,7 +633,7 @@ abbr.timeago {
632
633
 
633
634
  .timestamp {
634
635
  float: right;
635
- color: #dddddd; }
636
+ color: #ddd; }
636
637
 
637
638
  .group_tabs {
638
639
  list-style: none;
@@ -648,13 +649,13 @@ abbr.timeago {
648
649
  float: left;
649
650
  text-decoration: none;
650
651
  padding: 4px 8px;
651
- background-color: #aaaaaa;
652
+ background-color: #aaa;
652
653
  background: -webkit-gradient(linear, 0 0, 0 bottom, from(#dddddd), to(#aaaaaa));
653
654
  background: -moz-linear-gradient(#dddddd, #aaaaaa);
654
655
  background: linear-gradient(#dddddd, #aaaaaa);
655
656
  text-shadow: #e5e5e5 1px 1px 0px;
656
657
  border-bottom: none;
657
- color: #333333;
658
+ color: #333;
658
659
  font-weight: bold;
659
660
  margin-right: 8px;
660
661
  border-top: 1px solid #efefef;
@@ -665,7 +666,7 @@ abbr.timeago {
665
666
  border-top-left-radius: 2px;
666
667
  border-top-right-radius: 2px; }
667
668
  .group_tabs li a:hover {
668
- background-color: #cccccc;
669
+ background-color: #ccc;
669
670
  background: -webkit-gradient(linear, 0 0, 0 bottom, from(#eeeeee), to(#aaaaaa));
670
671
  background: -moz-linear-gradient(#eeeeee, #aaaaaa);
671
672
  background: linear-gradient(#eeeeee, #aaaaaa); }
@@ -674,8 +675,8 @@ abbr.timeago {
674
675
  padding-bottom: 3px; }
675
676
  .group_tabs li.active a {
676
677
  color: black;
677
- text-shadow: white 1px 1px 0px;
678
- background-color: #dddddd;
678
+ text-shadow: #fff 1px 1px 0px;
679
+ background-color: #ddd;
679
680
  background: -webkit-gradient(linear, 0 0, 0 bottom, from(white), to(#dddddd));
680
681
  background: -moz-linear-gradient(white, #dddddd);
681
682
  background: linear-gradient(white, #dddddd); }
@@ -713,13 +714,13 @@ td {
713
714
  margin: 0;
714
715
  padding: 0;
715
716
  white-space: normal;
716
- color: black;
717
+ color: #000;
717
718
  font-family: "Monaco", "Inconsolata", "Consolas", monospace; }
718
719
  .source_table code {
719
- color: black;
720
+ color: #000;
720
721
  font-family: "Monaco", "Inconsolata", "Consolas", monospace; }
721
722
  .source_table pre {
722
- background-color: #333333; }
723
+ background-color: #333; }
723
724
  .source_table pre ol {
724
725
  margin: 0px;
725
726
  padding: 0px;
@@ -737,7 +738,7 @@ td {
737
738
  float: right;
738
739
  margin-left: 10px;
739
740
  padding: 2px 4px;
740
- background-color: #444444;
741
+ background-color: #444;
741
742
  background: -webkit-gradient(linear, 0 0, 0 bottom, from(#222222), to(#666666));
742
743
  background: -moz-linear-gradient(#222222, #666666);
743
744
  background: linear-gradient(#222222, #666666);
@@ -749,51 +750,60 @@ td {
749
750
  border-radius: 6px; }
750
751
 
751
752
  #footer {
752
- color: #dddddd;
753
+ color: #ddd;
753
754
  font-size: 12px;
754
755
  font-weight: bold;
755
756
  margin-top: 12px;
756
757
  text-align: right; }
757
758
  #footer a {
758
- color: #eeeeee;
759
+ color: #eee;
759
760
  text-decoration: underline; }
760
761
  #footer a:hover {
761
- color: white;
762
+ color: #fff;
762
763
  text-decoration: none; }
763
764
 
764
765
  .green {
765
- color: #009900; }
766
+ color: #090; }
766
767
 
767
768
  .red {
768
- color: #990000; }
769
+ color: #900; }
769
770
 
770
771
  .yellow {
771
- color: #ddaa00; }
772
+ color: #da0; }
773
+
774
+ .blue {
775
+ color: blue; }
772
776
 
773
777
  .source_table .covered {
774
- border-color: #009900; }
778
+ border-color: #090; }
775
779
  .source_table .missed {
776
- border-color: #990000; }
780
+ border-color: #900; }
777
781
  .source_table .never {
778
782
  border-color: black; }
779
783
  .source_table .skipped {
780
- border-color: #ffcc00; }
784
+ border-color: #fc0; }
785
+ .source_table .missed-branch {
786
+ border-color: #bf0000; }
781
787
  .source_table .covered:nth-child(odd) {
782
- background-color: #cdf2cd; }
788
+ background-color: #CDF2CD; }
783
789
  .source_table .covered:nth-child(even) {
784
- background-color: #dbf2db; }
790
+ background-color: #DBF2DB; }
785
791
  .source_table .missed:nth-child(odd) {
786
- background-color: #f7c0c0; }
792
+ background-color: #F7C0C0; }
787
793
  .source_table .missed:nth-child(even) {
788
- background-color: #f7cfcf; }
794
+ background-color: #F7CFCF; }
789
795
  .source_table .never:nth-child(odd) {
790
796
  background-color: #efefef; }
791
797
  .source_table .never:nth-child(even) {
792
798
  background-color: #f4f4f4; }
793
799
  .source_table .skipped:nth-child(odd) {
794
- background-color: #fbf0c0; }
800
+ background-color: #FBF0C0; }
795
801
  .source_table .skipped:nth-child(even) {
796
- background-color: #fbffcf; }
802
+ background-color: #FBFfCf; }
803
+ .source_table .missed-branch:nth-child(odd) {
804
+ background-color: #cc8e8e; }
805
+ .source_table .missed-branch:nth-child(even) {
806
+ background-color: #cc6e6e; }
797
807
 
798
808
 
799
809
 
@@ -1587,16 +1587,7 @@ $(document).ready(function() {
1587
1587
  $('.file_list').dataTable({
1588
1588
  "aaSorting": [[ 1, "asc" ]],
1589
1589
  "bPaginate": false,
1590
- "bJQueryUI": true,
1591
- "aoColumns": [
1592
- null,
1593
- { "sType": "percent" },
1594
- null,
1595
- null,
1596
- null,
1597
- null,
1598
- null
1599
- ]
1590
+ "bJQueryUI": true
1600
1591
  });
1601
1592
 
1602
1593
  // Syntax highlight all files up front - deactivated
@@ -1704,4 +1695,5 @@ $(document).ready(function() {
1704
1695
  $("abbr.timeago").timeago();
1705
1696
  $('#loading').fadeOut();
1706
1697
  $('#wrapper').show();
1698
+ $('.dataTables_filter input').focus()
1707
1699
  });
@@ -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
 
@@ -8,12 +10,11 @@ Gem::Specification.new do |gem|
8
10
  gem.authors = ["Christoph Olszowka"]
9
11
  gem.email = ["christoph at olszowka de"]
10
12
  gem.homepage = "https://github.com/colszowka/simplecov-html"
11
- gem.description = %(Default HTML formatter for SimpleCov code coverage tool for ruby 1.9+)
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")
@@ -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)
@@ -1,21 +1,40 @@
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
+ <span class="<%= coverage_css_class(source_files.covered_percent) %>">
6
+ <%= source_files.covered_percent.round(2) %>%
7
+ </span>
8
+ </span>
5
9
  covered at
6
10
  <span class="covered_strength">
7
11
  <span class="<%= strength_css_class(source_files.covered_strength) %>">
8
12
  <%= source_files.covered_strength.round(2) %>
9
13
  </span>
10
- </span> hits/line)
14
+ </span> hits/line
15
+ )
11
16
  </h2>
17
+
12
18
  <a name="<%= title_id %>"></a>
19
+
13
20
  <div>
14
21
  <b><%= source_files.length %></b> files in total.
15
- <b><%= source_files.lines_of_code %></b> relevant lines.
22
+ </div>
23
+
24
+ <div class="t-line-summary">
25
+ <b><%= source_files.lines_of_code %></b> relevant lines,
16
26
  <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>
27
+ <span class="red"><b><%= source_files.missed_lines %></b> lines missed. </span>
18
28
  </div>
29
+
30
+ <% if branchable_result? %>
31
+ <div class="t-branch-summary">
32
+ <span><b><%= source_files.total_branches %></b> total branches, </span>
33
+ <span class="green"><b><%= source_files.covered_branches %></b> branches covered</span> and
34
+ <span class="red"><b><%= source_files.missed_branches %></b> branches missed.</span>
35
+ </div>
36
+ <% end %>
37
+
19
38
  <table class="file_list">
20
39
  <thead>
21
40
  <tr>
@@ -26,19 +45,31 @@
26
45
  <th>Lines covered</th>
27
46
  <th>Lines missed</th>
28
47
  <th>Avg. Hits / Line</th>
48
+ <% if branchable_result? %>
49
+ <th>Branch Coverage</th>
50
+ <th>Branches</th>
51
+ <th>Covered branches</th>
52
+ <th>Missed branches </th>
53
+ <% end %>
29
54
  </tr>
30
55
  </thead>
31
56
  <tbody>
32
57
  <% 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>
58
+ <tr class="t-file">
59
+ <td class="strong t-file__name"><%= link_to_source_file(source_file) %></td>
60
+ <td class="<%= coverage_css_class(source_file.covered_percent) %> strong t-file__coverage"><%= source_file.covered_percent.round(2).to_s %> %</td>
61
+ <td><%= source_file.lines.count %></td>
62
+ <td><%= source_file.covered_lines.count + source_file.missed_lines.count %></td>
63
+ <td><%= source_file.covered_lines.count %></td>
64
+ <td><%= source_file.missed_lines.count %></td>
65
+ <td><%= source_file.covered_strength %></td>
66
+ <% if branchable_result? %>
67
+ <td class="<%= coverage_css_class(source_file.branches_coverage_percent) %> strong t-file__branch-coverage"><%= source_file.branches_coverage_percent.round(2).to_s %> %</td>
68
+ <td><%= source_file.total_branches.count %></td>
69
+ <td><%= source_file.covered_branches.count %></td>
70
+ <td><%= source_file.missed_branches.count %></td>
71
+ <% end %>
72
+ </tr>
42
73
  <% end %>
43
74
  </tbody>
44
75
  </table>
@@ -1,22 +1,58 @@
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
+ <span class="<%= coverage_css_class(source_file.covered_percent) %>">
6
+ <%= source_file.covered_percent.round(2).to_s %> %
7
+ </span>
8
+ lines covered
9
+ </h4>
10
+
11
+ <% if branchable_result? %>
12
+ <h4>
13
+ <span class="<%= coverage_css_class(source_file.branches_coverage_percent) %>">
14
+ <%= source_file.branches_coverage_percent.round(2).to_s %> %
15
+ </span>
16
+ branches covered
17
+ </h4>
18
+ <% end %>
19
+
20
+ <div class="t-line-summary">
21
+ <b><%= source_file.lines_of_code %></b> relevant lines.
7
22
  <span class="green"><b><%= source_file.covered_lines.count %></b> lines covered</span> and
8
23
  <span class="red"><b><%= source_file.missed_lines.count %></b> lines missed.</span>
9
24
  </div>
25
+
26
+ <% if branchable_result? %>
27
+ <div class="t-branch-summary">
28
+ <span><b><%= source_file.total_branches.count %></b> total branches, </span>
29
+ <span class="green"><b><%= source_file.covered_branches.count %></b> branches covered</span> and
30
+ <span class="red"><b><%= source_file.missed_branches.count %></b> branches missed.</span>
31
+ </div>
32
+ <% end %>
33
+
10
34
  </div>
11
-
35
+
12
36
  <pre>
13
37
  <ol>
14
38
  <% 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>
39
+ <div>
40
+ <li class="<%= line_status?(source_file, line) %>" data-hits="<%= line.coverage ? line.coverage : '' %>" data-linenumber="<%= line.number %>">
41
+ <% if line.covered? %><span class="hits"><%= line.coverage %></span><% end %>
42
+ <% if line.skipped? %><span class="hits">skipped</span><% end %>
43
+
44
+ <% if branchable_result? %>
45
+ <% source_file.branches_for_line(line.number).each do |hit_count, indicator| %>
46
+ <% positive_or_negative = indicator == "+" ? "positive" : "negative" %>
47
+ <span class="hits" title="<%= positive_or_negative%> branch hit <%= hit_count %> times">
48
+ <%= hit_count %>, <%= indicator %>
49
+ </span>
50
+ <% end %>
51
+ <% end %>
52
+
53
+ <code class="ruby"><%= CGI.escapeHTML(line.src.chomp) %></code>
54
+ </li>
55
+ </div>
20
56
  <% end %>
21
57
  </ol>
22
58
  </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.11.0.beta1
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-01-05 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,9 +20,11 @@ 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
@@ -96,18 +84,17 @@ require_paths:
96
84
  - lib
97
85
  required_ruby_version: !ruby/object:Gem::Requirement
98
86
  requirements:
99
- - - ">="
87
+ - - "~>"
100
88
  - !ruby/object:Gem::Version
101
- version: 1.8.7
89
+ version: '2.4'
102
90
  required_rubygems_version: !ruby/object:Gem::Requirement
103
91
  requirements:
104
- - - ">="
92
+ - - ">"
105
93
  - !ruby/object:Gem::Version
106
- version: '0'
94
+ version: 1.3.1
107
95
  requirements: []
108
- rubyforge_project:
109
- rubygems_version: 2.6.10
96
+ rubygems_version: 3.0.3
110
97
  signing_key:
111
98
  specification_version: 4
112
- summary: Default HTML formatter for SimpleCov code coverage tool for ruby 1.9+
99
+ summary: Default HTML formatter for SimpleCov code coverage tool for ruby 2.4+
113
100
  test_files: []