duvet 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/duvet.gemspec +6 -4
- data/lib/duvet/cov.rb +20 -21
- data/lib/duvet/covs.rb +13 -15
- data/lib/duvet/resources/dark.sass +166 -0
- data/lib/duvet/resources/light.sass +163 -0
- data/lib/duvet/resources/main.js +41 -1
- data/lib/duvet/resources/rcov.sass +48 -48
- data/lib/duvet/templates/index.erb +11 -8
- metadata +8 -6
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -5,8 +5,8 @@ begin
|
|
5
5
|
require 'jeweler'
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = "duvet"
|
8
|
-
gem.summary = %Q{Duvet a simple code coverage tool for 1.9}
|
9
|
-
gem.description = %Q{Duvet a simple code coverage tool for 1.9}
|
8
|
+
gem.summary = %Q{Duvet a simple code coverage tool for ruby 1.9}
|
9
|
+
gem.description = %Q{Duvet a simple code coverage tool for ruby 1.9}
|
10
10
|
gem.email = "m@hawx.me"
|
11
11
|
gem.homepage = "http://github.com/hawx/duvet"
|
12
12
|
gem.authors = ["Joshua Hawxwell"]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.1.0
|
data/duvet.gemspec
CHANGED
@@ -5,13 +5,13 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{duvet}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Joshua Hawxwell"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-15}
|
13
13
|
s.default_executable = %q{duvet}
|
14
|
-
s.description = %q{Duvet a simple code coverage tool for 1.9}
|
14
|
+
s.description = %q{Duvet a simple code coverage tool for ruby 1.9}
|
15
15
|
s.email = %q{m@hawx.me}
|
16
16
|
s.executables = ["duvet"]
|
17
17
|
s.extra_rdoc_files = [
|
@@ -31,7 +31,9 @@ Gem::Specification.new do |s|
|
|
31
31
|
"lib/duvet/cov.rb",
|
32
32
|
"lib/duvet/covs.rb",
|
33
33
|
"lib/duvet/ext.rb",
|
34
|
+
"lib/duvet/resources/dark.sass",
|
34
35
|
"lib/duvet/resources/jquery.js",
|
36
|
+
"lib/duvet/resources/light.sass",
|
35
37
|
"lib/duvet/resources/main.js",
|
36
38
|
"lib/duvet/resources/plugins.js",
|
37
39
|
"lib/duvet/resources/rcov.sass",
|
@@ -47,7 +49,7 @@ Gem::Specification.new do |s|
|
|
47
49
|
s.rdoc_options = ["--charset=UTF-8"]
|
48
50
|
s.require_paths = ["lib"]
|
49
51
|
s.rubygems_version = %q{1.3.7}
|
50
|
-
s.summary = %q{Duvet a simple code coverage tool for 1.9}
|
52
|
+
s.summary = %q{Duvet a simple code coverage tool for ruby 1.9}
|
51
53
|
s.test_files = [
|
52
54
|
"test/helper.rb",
|
53
55
|
"test/test_duvet.rb"
|
data/lib/duvet/cov.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Duvet
|
2
2
|
class Cov
|
3
|
-
attr_accessor :
|
3
|
+
attr_accessor :path
|
4
4
|
|
5
5
|
def initialize(path, cov)
|
6
6
|
if path.include?(Dir.pwd)
|
@@ -13,9 +13,9 @@ module Duvet
|
|
13
13
|
write
|
14
14
|
end
|
15
15
|
|
16
|
-
# @return [
|
16
|
+
# @return [Array] lines in file
|
17
17
|
def lines
|
18
|
-
@cov
|
18
|
+
@cov
|
19
19
|
end
|
20
20
|
|
21
21
|
# @return [Array] all lines which can be executed
|
@@ -23,9 +23,9 @@ module Duvet
|
|
23
23
|
@cov.reject {|i| i.nil?}
|
24
24
|
end
|
25
25
|
|
26
|
-
# @return [
|
27
|
-
def
|
28
|
-
|
26
|
+
# @return [Array] all lines which have been ran
|
27
|
+
def ran_lines
|
28
|
+
@cov.reject {|i| i.nil? || i.zero?}
|
29
29
|
end
|
30
30
|
|
31
31
|
# Gives a fraction from 0 to 1 of how many lines of code have
|
@@ -34,22 +34,20 @@ module Duvet
|
|
34
34
|
#
|
35
35
|
# @return [Integer] lines of code executed as a fraction
|
36
36
|
def code_coverage
|
37
|
-
ran_lines
|
38
|
-
ran_lines.to_f / lines_of_code.to_f
|
37
|
+
ran_lines.size.to_f / code_lines.size.to_f
|
39
38
|
end
|
40
|
-
|
41
|
-
# @return [String] #code_coverage as ??.??%
|
42
|
-
def code_coverage_percent
|
43
|
-
"%.2f%" % (code_coverage*100)
|
44
|
-
end
|
45
|
-
|
39
|
+
|
46
40
|
# Similar to #code_coverage but counts all lines, executable
|
47
41
|
# or not.
|
48
42
|
#
|
49
43
|
# @return [Integer] lines executed as a fraction
|
50
44
|
def total_coverage
|
51
|
-
ran_lines
|
52
|
-
|
45
|
+
ran_lines.size.to_f / lines.size.to_f
|
46
|
+
end
|
47
|
+
|
48
|
+
# @return [String] #code_coverage as ??.??%
|
49
|
+
def code_coverage_percent
|
50
|
+
"%.2f%" % (code_coverage*100)
|
53
51
|
end
|
54
52
|
|
55
53
|
# @return [String] #total_coverage as ??.??%
|
@@ -76,8 +74,8 @@ module Duvet
|
|
76
74
|
# @return [String]
|
77
75
|
def report
|
78
76
|
str = "For #{@path}\n\n" << source_report << "\n"
|
79
|
-
str << "total coverage: #{
|
80
|
-
str << "code coverage: #{
|
77
|
+
str << "total coverage: #{total_coverage_percent}\n"
|
78
|
+
str << "code coverage: #{code_coverage_percent}\n"
|
81
79
|
str
|
82
80
|
end
|
83
81
|
|
@@ -88,13 +86,14 @@ module Duvet
|
|
88
86
|
"path" => @path,
|
89
87
|
"url" => @path.file_name + '.html',
|
90
88
|
"source" => @path.readlines,
|
91
|
-
"lines" => lines,
|
92
|
-
"lines_code" =>
|
89
|
+
"lines" => lines.size,
|
90
|
+
"lines_code" => code_lines.size,
|
91
|
+
"lines_ran" => ran_lines.size
|
93
92
|
},
|
94
93
|
"coverage" => {
|
95
94
|
"code" => code_coverage_percent,
|
96
95
|
"total" => total_coverage_percent,
|
97
|
-
"lines" =>
|
96
|
+
"lines" => lines
|
98
97
|
}
|
99
98
|
}
|
100
99
|
end
|
data/lib/duvet/covs.rb
CHANGED
@@ -25,26 +25,27 @@ module Duvet
|
|
25
25
|
|
26
26
|
# @return [Integer]
|
27
27
|
def total_lines
|
28
|
-
self.inject(0) {|a, e| a + e.
|
28
|
+
self.inject(0) {|a, e| a + e.lines.size }
|
29
29
|
end
|
30
30
|
|
31
31
|
# @return [Integer]
|
32
32
|
def total_code_lines
|
33
|
-
self.inject(0) {|a, e| a + e.
|
33
|
+
self.inject(0) {|a, e| a + e.code_lines.size }
|
34
34
|
end
|
35
35
|
|
36
|
-
# @return [
|
36
|
+
# @return [Integer]
|
37
|
+
def total_ran_lines
|
38
|
+
self.inject(0) {|a, e| a + e.ran_lines.size }
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [String] total lines run / total lines, as percentage
|
37
42
|
def total_total_cov
|
38
|
-
|
39
|
-
ran_lines = total_lines.reject {|i| i.nil? || i.zero?}
|
40
|
-
"%.2f%" % (ran_lines.size.to_f / total_lines.size.to_f*100)
|
43
|
+
"%.2f%" % (total_ran_lines.to_f / total_lines.to_f*100)
|
41
44
|
end
|
42
45
|
|
43
|
-
# @return [String]
|
46
|
+
# @return [String] total lines run / total lines of code, as percentage
|
44
47
|
def total_code_cov
|
45
|
-
|
46
|
-
ran_lines = total_lines.reject {|i| i.zero?}
|
47
|
-
"%.2f%" % (ran_lines.size.to_f / total_lines.size.to_f*100)
|
48
|
+
"%.2f%" % (total_ran_lines.to_f / total_code_lines.to_f*100)
|
48
49
|
end
|
49
50
|
|
50
51
|
# @endgroup
|
@@ -60,6 +61,7 @@ module Duvet
|
|
60
61
|
'total' => {
|
61
62
|
'lines' => total_lines,
|
62
63
|
'lines_code' => total_code_lines,
|
64
|
+
'lines_ran' => total_ran_lines,
|
63
65
|
'total_cov' => total_total_cov,
|
64
66
|
'code_cov' => total_code_cov
|
65
67
|
}
|
@@ -90,11 +92,7 @@ module Duvet
|
|
90
92
|
|
91
93
|
# @todo Allow you to change style used
|
92
94
|
def write_resources(dir, style)
|
93
|
-
|
94
|
-
res = {"#{__DIR__}/resources/jquery.js" => dir.to_p + 'jquery.js',
|
95
|
-
"#{__DIR__}/resources/main.js" => dir.to_p + 'main.js'}
|
96
|
-
|
97
|
-
dirs = Dir.glob("#{__DIR__}/resources/*")
|
95
|
+
dirs = Dir.glob("#{File.dirname(__FILE__)}/resources/*")
|
98
96
|
js = dirs.find_all {|i| i[-2..-1] == 'js'}
|
99
97
|
sass = dirs.find_all {|i| i[-4..-1] == 'sass'}
|
100
98
|
|
@@ -0,0 +1,166 @@
|
|
1
|
+
$text: #ddd
|
2
|
+
|
3
|
+
$black: #222
|
4
|
+
$dark-grey: #111
|
5
|
+
$light-grey: #ccc
|
6
|
+
$white: #ddd
|
7
|
+
|
8
|
+
$excluded: #bbb
|
9
|
+
$unran: #ce5256
|
10
|
+
$ran: #8dd291
|
11
|
+
|
12
|
+
// Main
|
13
|
+
body
|
14
|
+
background: $black
|
15
|
+
color: $white
|
16
|
+
font: 12px/1.3em Helvetica
|
17
|
+
text-shadow: 0 1px 0 rgba(0, 0, 0, .5)
|
18
|
+
|
19
|
+
a
|
20
|
+
text-decoration: none
|
21
|
+
|
22
|
+
|
23
|
+
// Header
|
24
|
+
header
|
25
|
+
margin: 2em .5em
|
26
|
+
|
27
|
+
h1, h1 a
|
28
|
+
color: $light-grey
|
29
|
+
font-weight: normal
|
30
|
+
|
31
|
+
h2
|
32
|
+
color: darken($light-grey, 20%)
|
33
|
+
font-size: 16px
|
34
|
+
font-weight: normal
|
35
|
+
|
36
|
+
// Filter/Search Box
|
37
|
+
#filter
|
38
|
+
position: absolute
|
39
|
+
color: $white
|
40
|
+
top: 20px
|
41
|
+
right: 8px
|
42
|
+
border: 1px solid darken($light-grey, 50%)
|
43
|
+
background: $black
|
44
|
+
-webkit-border-radius: 5px
|
45
|
+
padding: 3px
|
46
|
+
|
47
|
+
|
48
|
+
// Table
|
49
|
+
.table-wrapper
|
50
|
+
min-width: 700px
|
51
|
+
|
52
|
+
table
|
53
|
+
border: 1px solid darken($light-grey, 50%)
|
54
|
+
background: $dark-grey
|
55
|
+
border-collapse: collapse
|
56
|
+
width: 100%
|
57
|
+
margin-bottom: 1em
|
58
|
+
|
59
|
+
table.source, pre, code
|
60
|
+
font: 11px/1.2em Menlo
|
61
|
+
|
62
|
+
td pre
|
63
|
+
margin: 0
|
64
|
+
|
65
|
+
|
66
|
+
// Summary
|
67
|
+
.summary
|
68
|
+
margin-bottom: 1em
|
69
|
+
background: lighten($dark-grey, 10%)
|
70
|
+
|
71
|
+
tbody
|
72
|
+
.name, .name a
|
73
|
+
color: $text
|
74
|
+
|
75
|
+
tbody tr:hover
|
76
|
+
background: lighten($dark-grey, 15%)
|
77
|
+
|
78
|
+
thead
|
79
|
+
background: $dark-grey
|
80
|
+
color: $light-grey
|
81
|
+
border-bottom: 1px solid darken($light-grey, 50%)
|
82
|
+
|
83
|
+
tr
|
84
|
+
text-align: left
|
85
|
+
|
86
|
+
th, td
|
87
|
+
padding: .5em
|
88
|
+
|
89
|
+
.header::after
|
90
|
+
font-size: 10px
|
91
|
+
margin-left: 10px
|
92
|
+
|
93
|
+
.descending::after
|
94
|
+
content: '▼'
|
95
|
+
|
96
|
+
.ascending::after
|
97
|
+
content: '▲'
|
98
|
+
|
99
|
+
.lines, .loc, .ran, .cov, .code
|
100
|
+
width: 100px
|
101
|
+
|
102
|
+
// Totals
|
103
|
+
.totals
|
104
|
+
border-top: 1px solid darken($light-grey, 50%)
|
105
|
+
background: darken($dark-grey, 10%)
|
106
|
+
font-weight: bold
|
107
|
+
|
108
|
+
|
109
|
+
// Source
|
110
|
+
.source tr
|
111
|
+
pre
|
112
|
+
margin-left: 3px
|
113
|
+
|
114
|
+
.count
|
115
|
+
background: $black
|
116
|
+
color: $white
|
117
|
+
-webkit-border-radius: 4px
|
118
|
+
-webkit-border-top-left-radius: 0px
|
119
|
+
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2)
|
120
|
+
border: 1px solid $dark-grey
|
121
|
+
display: block
|
122
|
+
padding: 3px
|
123
|
+
position: absolute
|
124
|
+
margin-top: -10px
|
125
|
+
margin-left: -15px
|
126
|
+
opacity: 0
|
127
|
+
|
128
|
+
.no
|
129
|
+
color: $light-grey
|
130
|
+
background: $dark-grey
|
131
|
+
padding: 0 0 0 3px
|
132
|
+
width: 25px
|
133
|
+
border-right: 1px solid darken($light-grey, 50%)
|
134
|
+
|
135
|
+
&:hover
|
136
|
+
.count
|
137
|
+
opacity: 1
|
138
|
+
|
139
|
+
.no
|
140
|
+
color: $white
|
141
|
+
|
142
|
+
// line colouring
|
143
|
+
&.excluded
|
144
|
+
color: $excluded
|
145
|
+
&:hover
|
146
|
+
background: darken($excluded, 55%)
|
147
|
+
|
148
|
+
&.unran
|
149
|
+
color: $unran
|
150
|
+
&:hover
|
151
|
+
background: darken($unran, 40%)
|
152
|
+
|
153
|
+
&.ran
|
154
|
+
color: $ran
|
155
|
+
&:hover
|
156
|
+
background: darken($ran, 55%)
|
157
|
+
|
158
|
+
|
159
|
+
// Footer
|
160
|
+
footer
|
161
|
+
color: fade-out($white, .4)
|
162
|
+
|
163
|
+
a
|
164
|
+
color: $white
|
165
|
+
|
166
|
+
|
@@ -0,0 +1,163 @@
|
|
1
|
+
$text: rgb(0, 0, 0)
|
2
|
+
$blue: #4080C7
|
3
|
+
|
4
|
+
$black: #000
|
5
|
+
$dark-grey: darken($blue, 30%)
|
6
|
+
$light-grey: #fcfcfc
|
7
|
+
$white: #fff
|
8
|
+
|
9
|
+
$excluded: #666
|
10
|
+
$unran: #d20d20
|
11
|
+
$ran: $blue
|
12
|
+
|
13
|
+
// Main
|
14
|
+
body
|
15
|
+
background: #fff
|
16
|
+
font: 12px/1.3em Helvetica
|
17
|
+
color: $black
|
18
|
+
|
19
|
+
a
|
20
|
+
text-decoration: none
|
21
|
+
|
22
|
+
|
23
|
+
// Header
|
24
|
+
header
|
25
|
+
margin: 2em .5em
|
26
|
+
|
27
|
+
h1, h1 a
|
28
|
+
color: $black
|
29
|
+
|
30
|
+
h2
|
31
|
+
color: darken($blue, 20%)
|
32
|
+
font-size: 16px
|
33
|
+
|
34
|
+
// Filter/Search Box
|
35
|
+
#filter
|
36
|
+
position: absolute
|
37
|
+
top: 20px
|
38
|
+
right: 8px
|
39
|
+
border: 1px solid $dark-grey
|
40
|
+
background: $light-grey
|
41
|
+
-webkit-border-radius: 5px
|
42
|
+
padding: 3px
|
43
|
+
|
44
|
+
&:focus
|
45
|
+
border: 1px solid transparent
|
46
|
+
|
47
|
+
|
48
|
+
// Table
|
49
|
+
.table-wrapper
|
50
|
+
min-width: 700px
|
51
|
+
|
52
|
+
table
|
53
|
+
border: 1px solid $dark-grey
|
54
|
+
background: $light-grey
|
55
|
+
border-collapse: collapse
|
56
|
+
width: 100%
|
57
|
+
margin-bottom: 1em
|
58
|
+
|
59
|
+
table.source, pre, code
|
60
|
+
font: 11px/1.2em Menlo
|
61
|
+
|
62
|
+
td pre
|
63
|
+
margin: 0
|
64
|
+
|
65
|
+
|
66
|
+
// Summary
|
67
|
+
.summary
|
68
|
+
margin-bottom: 1em
|
69
|
+
background: $light-grey
|
70
|
+
|
71
|
+
tbody
|
72
|
+
.name, .name a
|
73
|
+
color: $text
|
74
|
+
font-weight: bold
|
75
|
+
|
76
|
+
tbody tr:hover
|
77
|
+
background: lighten($excluded, 55%)
|
78
|
+
|
79
|
+
thead
|
80
|
+
background: $dark-grey
|
81
|
+
color: $light-grey
|
82
|
+
|
83
|
+
tr
|
84
|
+
text-align: left
|
85
|
+
|
86
|
+
th, td
|
87
|
+
padding: .5em
|
88
|
+
|
89
|
+
.header::after
|
90
|
+
font-size: 10px
|
91
|
+
margin-left: 10px
|
92
|
+
|
93
|
+
.descending::after
|
94
|
+
content: '▼'
|
95
|
+
|
96
|
+
.ascending::after
|
97
|
+
content: '▲'
|
98
|
+
|
99
|
+
.lines, .loc, .ran, .cov, .code
|
100
|
+
width: 100px
|
101
|
+
|
102
|
+
// Totals
|
103
|
+
.totals
|
104
|
+
border-top: 1px solid black
|
105
|
+
background: $light-grey
|
106
|
+
font-weight: bold
|
107
|
+
|
108
|
+
|
109
|
+
// Source
|
110
|
+
.source tr
|
111
|
+
pre
|
112
|
+
margin-left: 3px
|
113
|
+
|
114
|
+
.count
|
115
|
+
background: $white
|
116
|
+
-webkit-border-radius: 4px
|
117
|
+
-webkit-border-top-left-radius: 0px
|
118
|
+
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2)
|
119
|
+
border: 1px solid black
|
120
|
+
display: block
|
121
|
+
padding: 3px
|
122
|
+
position: absolute
|
123
|
+
margin-top: -10px
|
124
|
+
margin-left: -15px
|
125
|
+
opacity: 0
|
126
|
+
color: $black
|
127
|
+
|
128
|
+
.no
|
129
|
+
color: $dark-grey
|
130
|
+
background: darken($light-grey, 10%)
|
131
|
+
padding: 0 0 0 3px
|
132
|
+
border-right: 1px solid $dark-grey
|
133
|
+
width: 25px
|
134
|
+
|
135
|
+
&:hover
|
136
|
+
.count
|
137
|
+
opacity: 1
|
138
|
+
|
139
|
+
// line colouring
|
140
|
+
&.excluded
|
141
|
+
color: $excluded
|
142
|
+
&:hover
|
143
|
+
background: lighten($excluded, 55%)
|
144
|
+
|
145
|
+
&.unran
|
146
|
+
color: $unran
|
147
|
+
&:hover
|
148
|
+
background: lighten($unran, 50%)
|
149
|
+
|
150
|
+
&.ran
|
151
|
+
color: $ran
|
152
|
+
&:hover
|
153
|
+
background: lighten($ran, 40%)
|
154
|
+
|
155
|
+
|
156
|
+
// Footer
|
157
|
+
footer
|
158
|
+
color: rgba(0, 0, 0, .6)
|
159
|
+
|
160
|
+
a
|
161
|
+
color: rgb(0, 0, 0)
|
162
|
+
|
163
|
+
|
data/lib/duvet/resources/main.js
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
$(document).ready(function() {
|
2
2
|
|
3
|
-
t = $('table');
|
3
|
+
t = $('table.sort');
|
4
4
|
|
5
5
|
$('#filter').keyup(function() {
|
6
6
|
$.uiTableFilter(t, this.value);
|
7
|
+
calculate_totals();
|
7
8
|
});
|
8
9
|
|
9
10
|
$('table.sort').tablesorter({
|
@@ -12,5 +13,44 @@ $(document).ready(function() {
|
|
12
13
|
cssDesc: 'descending',
|
13
14
|
widthFixed: true
|
14
15
|
});
|
16
|
+
|
17
|
+
|
18
|
+
// Need to get the cov and code totals to be weighted, if possible, to
|
19
|
+
// the number of lines as in the ruby.
|
20
|
+
function calculate_totals(col) {
|
21
|
+
var sum = 0;
|
22
|
+
var rows = [];
|
23
|
+
|
24
|
+
var lines = 0;
|
25
|
+
var loc = 0;
|
26
|
+
var ran = 0;
|
27
|
+
$('table.sort tbody tr').each(function(i) {
|
28
|
+
if ($(this).css("display") != "none") {
|
29
|
+
rows += $(this);
|
30
|
+
|
31
|
+
$(this).children('td.lines').each(function(j) {
|
32
|
+
lines += parseFloat($(this).text());
|
33
|
+
});
|
34
|
+
$(this).children('td.loc').each(function(j) {
|
35
|
+
loc += parseFloat($(this).text());
|
36
|
+
});
|
37
|
+
$(this).children('td.ran').each(function(j) {
|
38
|
+
ran += parseFloat($(this).text());
|
39
|
+
});
|
40
|
+
}
|
41
|
+
});
|
42
|
+
var count = rows.length/15; // gets actual number of rows
|
43
|
+
|
44
|
+
$('table.sort tfoot td.lines').text(lines);
|
45
|
+
$('table.sort tfoot td.loc').text(loc);
|
46
|
+
$('table.sort tfoot td.ran').text(ran);
|
47
|
+
if (lines > 0) {
|
48
|
+
$('table.sort tfoot td.cov').text((ran/lines*100).toFixed(2) + '%');
|
49
|
+
$('table.sort tfoot td.code').text((ran/loc*100).toFixed(2) + '%');
|
50
|
+
} else {
|
51
|
+
$('table.sort tfoot td.cov').text('0.00%');
|
52
|
+
$('table.sort tfoot td.code').text('0.00%');
|
53
|
+
}
|
54
|
+
}
|
15
55
|
|
16
56
|
});
|
@@ -93,10 +93,8 @@ td pre
|
|
93
93
|
.ascending::after
|
94
94
|
content: '▲'
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
.lines, .loc, .cov, .code
|
99
|
-
width: 110px
|
96
|
+
.lines, .loc, .ran, .cov, .code
|
97
|
+
width: 100px
|
100
98
|
|
101
99
|
// Totals
|
102
100
|
.totals
|
@@ -105,50 +103,52 @@ td pre
|
|
105
103
|
font-weight: bold
|
106
104
|
|
107
105
|
|
108
|
-
// Source
|
109
|
-
.
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
background:
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
background:
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
background:
|
106
|
+
// Source
|
107
|
+
.source tr
|
108
|
+
pre
|
109
|
+
margin-left: 3px
|
110
|
+
|
111
|
+
.count
|
112
|
+
background: $white
|
113
|
+
-webkit-border-radius: 4px
|
114
|
+
-webkit-border-top-left-radius: 0px
|
115
|
+
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2)
|
116
|
+
border: 1px solid black
|
117
|
+
display: block
|
118
|
+
padding: 3px
|
119
|
+
position: absolute
|
120
|
+
margin-top: -10px
|
121
|
+
margin-left: -15px
|
122
|
+
opacity: 0
|
123
|
+
|
124
|
+
.no
|
125
|
+
color: $light-grey
|
126
|
+
background: $dark-grey
|
127
|
+
padding: 0 0 0 3px
|
128
|
+
width: 25px
|
129
|
+
|
130
|
+
&:hover
|
131
|
+
.count
|
132
|
+
opacity: 1
|
133
|
+
|
134
|
+
.no
|
135
|
+
color: $white
|
136
|
+
|
137
|
+
// line colouring
|
138
|
+
&.excluded
|
139
|
+
background: $excluded
|
140
|
+
&:hover
|
141
|
+
background: darken($excluded, 10%)
|
142
|
+
|
143
|
+
&.unran
|
144
|
+
background: $unran
|
145
|
+
&:hover
|
146
|
+
background: darken($unran, 10%)
|
147
|
+
|
148
|
+
&.ran
|
149
|
+
background: $ran
|
150
|
+
&:hover
|
151
|
+
background: darken($ran, 10%)
|
152
152
|
|
153
153
|
|
154
154
|
// Footer
|
@@ -23,6 +23,7 @@
|
|
23
23
|
<th class="name">Name</th>
|
24
24
|
<th class="lines">Total Lines</th>
|
25
25
|
<th class="loc">Lines of Code</th>
|
26
|
+
<th class="ran">Lines Ran</td>
|
26
27
|
<th class="cov">Total Coverage</th>
|
27
28
|
<th class="code">Code Coverage</th>
|
28
29
|
</tr>
|
@@ -30,20 +31,22 @@
|
|
30
31
|
<tfoot>
|
31
32
|
<tr class="totals">
|
32
33
|
<td>Total</td>
|
33
|
-
<td><%= total['lines'] %></td>
|
34
|
-
<td><%= total['lines_code'] %></td>
|
35
|
-
<td><%= total['
|
36
|
-
<td><%= total['
|
34
|
+
<td class="lines"><%= total['lines'] %></td>
|
35
|
+
<td class="loc"><%= total['lines_code'] %></td>
|
36
|
+
<td class="ran"><%= total['lines_ran'] %></td>
|
37
|
+
<td class="cov"><%= total['total_cov'] %></td>
|
38
|
+
<td class="code"><%= total['code_cov'] %></td>
|
37
39
|
</tr>
|
38
40
|
</tfoot>
|
39
41
|
<tbody>
|
40
42
|
<% files.each do |f| %>
|
41
43
|
<tr>
|
42
44
|
<td class="name"><a href="<%= f['file']['url'] %>"><%= f['file']['path'] %></a></td>
|
43
|
-
<td><%= f['file']['lines'] %></td>
|
44
|
-
<td><%= f['file']['lines_code'] %></td>
|
45
|
-
<td><%= f['
|
46
|
-
<td><%= f['coverage']['
|
45
|
+
<td class="lines"><%= f['file']['lines'] %></td>
|
46
|
+
<td class="loc"><%= f['file']['lines_code'] %></td>
|
47
|
+
<td class="ran"><%= f['file']['lines_ran'] %></td>
|
48
|
+
<td class="cov"><%= f['coverage']['total'] %></td>
|
49
|
+
<td class="code"><%= f['coverage']['code'] %></td>
|
47
50
|
</tr>
|
48
51
|
<% end %>
|
49
52
|
</tbody>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duvet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.0
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joshua Hawxwell
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-15 00:00:00 +01:00
|
19
19
|
default_executable: duvet
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
version: "0"
|
47
47
|
type: :development
|
48
48
|
version_requirements: *id002
|
49
|
-
description: Duvet a simple code coverage tool for 1.9
|
49
|
+
description: Duvet a simple code coverage tool for ruby 1.9
|
50
50
|
email: m@hawx.me
|
51
51
|
executables:
|
52
52
|
- duvet
|
@@ -68,7 +68,9 @@ files:
|
|
68
68
|
- lib/duvet/cov.rb
|
69
69
|
- lib/duvet/covs.rb
|
70
70
|
- lib/duvet/ext.rb
|
71
|
+
- lib/duvet/resources/dark.sass
|
71
72
|
- lib/duvet/resources/jquery.js
|
73
|
+
- lib/duvet/resources/light.sass
|
72
74
|
- lib/duvet/resources/main.js
|
73
75
|
- lib/duvet/resources/plugins.js
|
74
76
|
- lib/duvet/resources/rcov.sass
|
@@ -112,7 +114,7 @@ rubyforge_project:
|
|
112
114
|
rubygems_version: 1.3.7
|
113
115
|
signing_key:
|
114
116
|
specification_version: 3
|
115
|
-
summary: Duvet a simple code coverage tool for 1.9
|
117
|
+
summary: Duvet a simple code coverage tool for ruby 1.9
|
116
118
|
test_files:
|
117
119
|
- test/helper.rb
|
118
120
|
- test/test_duvet.rb
|