simplecov-rcov 0.1.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,88 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
5
+ <title><%= "#{project_name} C0 Coverage Information - SimpleCov - RCov style" %></title>
6
+ <link href="<%= assets_path('screen.css')%>" media="all" rel="stylesheet" type="text/css" />
7
+ <link href="<%= assets_path('print.css')%>" media="print" rel="stylesheet" type="text/css" />
8
+ <script type="text/javascript" src="<%= assets_path('jquery-1.3.2.min.js')%>"></script>
9
+ <script type="text/javascript" src="<%= assets_path('jquery.tablesorter.min.js')%>"></script>
10
+ <script type="text/javascript" src="<%= assets_path('rcov.js')%>"></script>
11
+ </head>
12
+ <body>
13
+ <h1><%= "#{project_name} C0 Coverage Information - SimpleCov - RCov style" %></h1>
14
+
15
+ <noscript><style type="text/css">.if_js { display:none; }</style></noscript>
16
+
17
+ <div class="filters if_js">
18
+ <fieldset>
19
+ <label>File Filter:</label>
20
+ <select id="file_filter" class="filter">
21
+ <option value="all_files">Show All</option>
22
+ <% @files.map{|f| shortened_filename(f).split('/')[0..-2]}.flatten.uniq.sort.each do |f| %><option value="<%= f %>"><%= f %>/</option><% end %>
23
+ </select>
24
+ </fieldset>
25
+ <fieldset>
26
+ <label>Code Coverage Threshold:</label>
27
+ <select id="coverage_filter" class="filter">
28
+ <option value="all_coverage">Show All</option>
29
+ <% (1..10).each do |i| %><option value="<%= i * 10 %>">&lt; <%= i * 10 %>% Coverage</option><% end %>
30
+ <option value="110">= 100% Coverage</option>
31
+ </select>
32
+ </fieldset>
33
+ </div>
34
+
35
+ <div class="report_table_wrapper">
36
+ <table class='report' id='report_table'>
37
+ <thead>
38
+ <tr>
39
+ <th class="left_align">Name</th>
40
+ <th class="right_align">Total Lines</th>
41
+ <th class="right_align">Lines of Code</th>
42
+ <th class="left_align">Total Coverage</th>
43
+ <th class="left_align">Code Coverage</th>
44
+ </tr>
45
+ </thead>
46
+ <tfoot>
47
+ <tr>
48
+ <td class="left_align">TOTAL</td>
49
+ <td class='right_align'><tt><%= @total_lines %></tt></td>
50
+ <td class='right_align'><tt><%= @total_lines_code %></tt></td>
51
+ <td class="left_align"><%= code_coverage_html(@total_coverage) %></td>
52
+ <td class="left_align"><%= code_coverage_html(@total_coverage_code, true) %></td>
53
+ </tr>
54
+ </tfoot>
55
+ <tbody>
56
+ <% @files.each_with_index do |file,i| %>
57
+ <tr class="all_files all_coverage <%= coverage_threshold_classes(file.covered_percent) %> <%= file_filter_classes(shortened_filename(file)) %> <%= i.odd? ? 'odd' : 'even' %>">
58
+ <td class="left_align"><a href="<%= CGI::escapeHTML(relative_filename(shortened_filename(file))) %>"><%= CGI::escapeHTML(shortened_filename(file)) %></a></td>
59
+ <td class='right_align'><tt><%= file.lines.count %></tt></td>
60
+ <td class='right_align'><tt><%= file.covered_lines.count + file.missed_lines.count %></tt></td>
61
+ <td class="left_align"><%= code_coverage_html(total_coverage_for_report(file)) %></td>
62
+ <td class="left_align"><%= code_coverage_html(file.covered_percent) %></td>
63
+ </tr>
64
+ <% end %>
65
+ </tbody>
66
+ </table>
67
+ </div>
68
+
69
+ <p>Generated on <%= generated_on %> with <a href="<%= SimpleCov::Formatter::RcovFormatter::UPSTREAM_URL %>">SimpleCov-RCov <%= SimpleCov::Formatter::RcovFormatter::VERSION %></a></p>
70
+
71
+ <script type="text/javascript">
72
+ $(document).ready(function(){$("#report_table").tablesorter({widgets: ['zebra'], textExtraction: 'complex'});});
73
+ $('.filter').change(function(){
74
+ ff = $('#file_filter').val();
75
+ cf = $('#coverage_filter').val();
76
+ $('table#report_table tbody tr').each(function(i){
77
+ if ((this.className.split(" ").indexOf(ff) > -1) && (this.className.split(" ").indexOf(cf) > -1)) {
78
+ this.style.display = "";
79
+ } else {
80
+ this.style.display = "none";
81
+ };
82
+ restripe();
83
+ })
84
+ })
85
+ </script>
86
+
87
+ </body>
88
+ </html>
metadata CHANGED
@@ -1,79 +1,95 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: simplecov-rcov
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 4
9
- version: 0.1.4
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
10
5
  platform: ruby
11
- authors:
12
- - Fernando Guillen http://fernandoguillen.info, Wes Morgan http://github.com/cap10morgan
13
- autorequire:
6
+ authors:
7
+ - Fernando Guillen http://fernandoguillen.info
8
+ - Wes Morgan http://github.com/cap10morgan
9
+ - Wandenberg Peixoto http://github.com/wandenberg
10
+ autorequire:
14
11
  bindir: bin
15
12
  cert_chain: []
16
-
17
- date: 2011-02-10 00:00:00 +01:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
13
+ date: 2022-05-01 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
21
16
  name: simplecov
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
26
19
  - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- version: "0"
20
+ - !ruby/object:Gem::Version
21
+ version: 0.4.1
31
22
  type: :runtime
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: echoe
35
23
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- none: false
38
- requirements:
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 0.4.1
29
+ - !ruby/object:Gem::Dependency
30
+ name: bundler
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
39
33
  - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
- version: "0"
34
+ - !ruby/object:Gem::Version
35
+ version: 1.0.0.rc.6
44
36
  type: :development
45
- version_requirements: *id002
46
- - !ruby/object:Gem::Dependency
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.0.0.rc.6
43
+ - !ruby/object:Gem::Dependency
47
44
  name: mocha
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :development
48
51
  prerelease: false
49
- requirement: &id003 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: rake
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
52
61
  - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- version: "0"
62
+ - !ruby/object:Gem::Version
63
+ version: 12.3.3
57
64
  type: :development
58
- version_requirements: *id003
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 12.3.3
59
71
  description: Rcov style formatter for SimpleCov
60
- email:
72
+ email:
61
73
  - fguillen.mail@gmail.com
62
74
  - cap10morgan@gmail.com
63
75
  executables: []
64
-
65
76
  extensions: []
66
-
67
- extra_rdoc_files:
68
- - README.md
69
- - lib/simplecov-rcov.rb
70
- files:
77
+ extra_rdoc_files: []
78
+ files:
79
+ - ".gitignore"
80
+ - ".travis.yml"
71
81
  - Gemfile
72
82
  - Gemfile.lock
73
- - Manifest
74
83
  - README.md
75
84
  - Rakefile
85
+ - assets/jquery-1.3.2.min.js
86
+ - assets/jquery.tablesorter.min.js
87
+ - assets/print.css
88
+ - assets/rcov.js
89
+ - assets/screen.css
90
+ - etc/simplecov_rcov_logo.gif
76
91
  - lib/simplecov-rcov.rb
92
+ - lib/simplecov-rcov/version.rb
77
93
  - simplecov-rcov.gemspec
78
94
  - test/fixtures/app/controllers/sample.rb
79
95
  - test/fixtures/app/models/airplane.rb
@@ -81,49 +97,46 @@ files:
81
97
  - test/fixtures/app/models/house.rb
82
98
  - test/fixtures/app/models/robot.rb
83
99
  - test/fixtures/app/models/user.rb
100
+ - test/fixtures/detail_trs.html
84
101
  - test/fixtures/file_tr.html
85
102
  - test/fixtures/sample.rb
86
103
  - test/fixtures/totals_tr.html
87
104
  - test/helper.rb
88
- - test/simplecov-rcov_test.rb
89
- - views/index.erb.html
90
- has_rdoc: true
105
+ - test/test_simplecov-rcov.rb
106
+ - views/detail.html.erb
107
+ - views/index.html.erb
91
108
  homepage: http://github.com/fguillen/simplecov-rcov
92
109
  licenses: []
93
-
94
- post_install_message:
95
- rdoc_options:
96
- - --line-numbers
97
- - --inline-source
98
- - --title
99
- - Simplecov-rcov
100
- - --main
101
- - README.md
102
- require_paths:
110
+ metadata: {}
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
103
114
  - lib
104
- required_ruby_version: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
107
117
  - - ">="
108
- - !ruby/object:Gem::Version
109
- segments:
110
- - 0
111
- version: "0"
112
- required_rubygems_version: !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
115
122
  - - ">="
116
- - !ruby/object:Gem::Version
117
- segments:
118
- - 1
119
- - 2
120
- version: "1.2"
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
121
125
  requirements: []
122
-
123
- rubyforge_project: simplecov-rcov
124
- rubygems_version: 1.3.7
125
- signing_key:
126
- specification_version: 3
126
+ rubygems_version: 3.2.22
127
+ signing_key:
128
+ specification_version: 4
127
129
  summary: Rcov style formatter for SimpleCov
128
- test_files:
129
- - test/simplecov-rcov_test.rb
130
+ test_files:
131
+ - test/fixtures/app/controllers/sample.rb
132
+ - test/fixtures/app/models/airplane.rb
133
+ - test/fixtures/app/models/dog.rb
134
+ - test/fixtures/app/models/house.rb
135
+ - test/fixtures/app/models/robot.rb
136
+ - test/fixtures/app/models/user.rb
137
+ - test/fixtures/detail_trs.html
138
+ - test/fixtures/file_tr.html
139
+ - test/fixtures/sample.rb
140
+ - test/fixtures/totals_tr.html
141
+ - test/helper.rb
142
+ - test/test_simplecov-rcov.rb
data/Manifest DELETED
@@ -1,19 +0,0 @@
1
- Gemfile
2
- Gemfile.lock
3
- Manifest
4
- README.md
5
- Rakefile
6
- lib/simplecov-rcov.rb
7
- simplecov-rcov.gemspec
8
- test/fixtures/app/controllers/sample.rb
9
- test/fixtures/app/models/airplane.rb
10
- test/fixtures/app/models/dog.rb
11
- test/fixtures/app/models/house.rb
12
- test/fixtures/app/models/robot.rb
13
- test/fixtures/app/models/user.rb
14
- test/fixtures/file_tr.html
15
- test/fixtures/sample.rb
16
- test/fixtures/totals_tr.html
17
- test/helper.rb
18
- test/simplecov-rcov_test.rb
19
- views/index.erb.html
@@ -1,31 +0,0 @@
1
- require "#{File.expand_path(File.dirname(__FILE__))}/helper"
2
-
3
- class SimplecovRcovFormatterTest < Test::Unit::TestCase
4
- def test_format
5
- SimpleCov::Formatter::RcovFormatter.stubs( :path_result ).returns( '/tmp/rcov/coverage_test_index.html' )
6
- if File.exists?( SimpleCov::Formatter::RcovFormatter.path_result )
7
- File.delete( SimpleCov::Formatter::RcovFormatter.path_result )
8
- end
9
-
10
- @original_result = {
11
- source_fixture( 'sample.rb' ) => [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil],
12
- source_fixture( 'app/models/user.rb' ) => [nil, 1, 1, 1, 1, 0, 1, 0, nil, nil],
13
- source_fixture( 'app/models/robot.rb' ) => [1, 1, 1, 1, nil, nil, 1, 0, nil, nil],
14
- source_fixture( 'app/models/house.rb' ) => [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil],
15
- source_fixture( 'app/models/airplane.rb' ) => [0, 0, 0, 0, 0],
16
- source_fixture( 'app/models/dog.rb' ) => [1, 1, 1, 1, 1],
17
- source_fixture( 'app/controllers/sample.rb' ) => [nil, 1, 1, 1, nil, nil, 0, 0, nil, nil]
18
- }
19
-
20
- @result = SimpleCov::Result.new( @original_result )
21
- rcov_result = SimpleCov::Formatter::RcovFormatter.new().format( @result )
22
-
23
- assert_match( File.read( "#{File.dirname(__FILE__)}/fixtures/totals_tr.html"), rcov_result )
24
- assert_match( File.read( "#{File.dirname(__FILE__)}/fixtures/file_tr.html"), rcov_result )
25
- assert( File.exists?( SimpleCov::Formatter::RcovFormatter.path_result ) )
26
- end
27
-
28
- def source_fixture( filename )
29
- File.expand_path( File.join( File.dirname( __FILE__ ), 'fixtures', filename ) )
30
- end
31
- end
data/views/index.erb.html DELETED
@@ -1,45 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
- <head>
4
- <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
5
- <title>SimpleCov - RCov style</title>
6
- </head>
7
- <body>
8
- <h1>SimpleCov - RCov style</h1>
9
-
10
- <div class="report_table_wrapper">
11
- <table class='report' id='report_table'>
12
- <thead>
13
- <tr>
14
- <th class="left_align">Name</th>
15
- <th class="right_align">Total Lines</th>
16
- <th class="right_align">Lines of Code</th>
17
- <th class="left_align">Total Coverage</th>
18
- <th class="left_align">Code Coverage</th>
19
- </tr>
20
- </thead>
21
- <tfoot>
22
- <tr>
23
- <td class="left_align">TOTAL</td>
24
- <td class='right_align'><tt><%= @total_lines %></tt></td>
25
- <td class='right_align'><tt><%= @total_lines_code %></tt></td>
26
- <td class="left_align"><tt class=''><%= '%.2f' % @total_coverage %>%</tt></td>
27
- <td class="left_align"><tt class='coverage_total'><%= '%.2f' % @total_coverage %>%</tt></td>
28
- </tr>
29
- </tfoot>
30
- <tbody>
31
- <% @files.each do |file| %>
32
- <tr class="all_files">
33
- <td class="left_align"><a href="#<%= file.filename.gsub(SimpleCov.root, '.') %>"><%= file.filename.gsub(SimpleCov.root, '.') %></a></td>
34
- <td class='right_align'><tt><%= file.lines.count %></tt></td>
35
- <td class='right_align'><tt><%= file.covered_lines.count + file.missed_lines.count %></tt></td>
36
- <td class="left_align"><tt class=''><%= '%.2f' % file.covered_percent %>%</tt></td>
37
- <td class="left_align"><tt class=''><%= '%.2f' % file.covered_percent %>%</tt></td>
38
- </tr>
39
- <% end %>
40
- </tbody>
41
- </table>
42
- </div>
43
-
44
- </body>
45
- </html>