duvet 0.0.0
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.
- data/.document +5 -0
- data/.gitignore +24 -0
- data/LICENSE +20 -0
- data/README.md +31 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/bin/duvet +46 -0
- data/duvet.gemspec +72 -0
- data/lib/duvet.rb +86 -0
- data/lib/duvet/cov.rb +118 -0
- data/lib/duvet/covs.rb +118 -0
- data/lib/duvet/ext.rb +28 -0
- data/lib/duvet/resources/jquery.js +154 -0
- data/lib/duvet/resources/main.js +16 -0
- data/lib/duvet/resources/plugins.js +98 -0
- data/lib/duvet/resources/rcov.sass +161 -0
- data/lib/duvet/templates/file.erb +64 -0
- data/lib/duvet/templates/index.erb +58 -0
- data/test/helper.rb +10 -0
- data/test/test_duvet.rb +5 -0
- data/test_duvet/lib/klass.rb +25 -0
- data/test_duvet/lib/run.rb +21 -0
- data/test_duvet/test/test_all.rb +59 -0
- metadata +118 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<title><%= file['path'] %></title>
|
6
|
+
<link rel="stylesheet" href="styles.css" type="text/css" />
|
7
|
+
<script type="text/javascript" src="jquery.js"></script>
|
8
|
+
<script type="text/javascript" src="plugins.js"></script>
|
9
|
+
<script type="text/javascript" src="main.js"></script>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
|
13
|
+
<header>
|
14
|
+
<h1><a href="index.html">Coverage</a></h1>
|
15
|
+
<h2><%= file['path'] %></h2>
|
16
|
+
</header>
|
17
|
+
|
18
|
+
<div class="table-wrapper">
|
19
|
+
<table class="summary" border="none">
|
20
|
+
<thead>
|
21
|
+
<tr>
|
22
|
+
<th>Name</th>
|
23
|
+
<th>Total Lines</th>
|
24
|
+
<th>Lines of Code</th>
|
25
|
+
<th>Total Coverage</th>
|
26
|
+
<th>Code Coverage</th>
|
27
|
+
</tr>
|
28
|
+
</thead>
|
29
|
+
<tbody>
|
30
|
+
<tr>
|
31
|
+
<td class="name"><%= file['path'] %></td>
|
32
|
+
<td><%= file['lines'] %></td>
|
33
|
+
<td><%= file['lines_code'] %></td>
|
34
|
+
<td><%= coverage['total'] %></td>
|
35
|
+
<td><%= coverage['code'] %></td>
|
36
|
+
</tr>
|
37
|
+
</tbody>
|
38
|
+
</table>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div class="table-wrapper">
|
42
|
+
<table class="source" border="none">
|
43
|
+
<% file["source"].zip(coverage["lines"]).each_with_index do |(line, count), i| %>
|
44
|
+
<% if count.nil? %>
|
45
|
+
<tr class="excluded">
|
46
|
+
<% elsif count.zero? %>
|
47
|
+
<tr class="unran">
|
48
|
+
<% else %>
|
49
|
+
<tr class="ran">
|
50
|
+
<% end %>
|
51
|
+
<td class="no"><%= i %></td>
|
52
|
+
<td><pre><code><%= line.gsub("\n", "") %></code></pre></td>
|
53
|
+
<td><% if count %><span class="count"><%= count %></span><% end %></td>
|
54
|
+
</tr>
|
55
|
+
<% end %>
|
56
|
+
</table>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<footer>
|
60
|
+
<span>Generated on <%= time %> with </span><a href="http://github.com/hawx/duvet"><%= name %> <%= version %></a>
|
61
|
+
</footer>
|
62
|
+
|
63
|
+
</body>
|
64
|
+
</html>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<title>Coverage</title>
|
6
|
+
<link rel="stylesheet" href="styles.css" type="text/css" />
|
7
|
+
<script type="text/javascript" src="jquery.js"></script>
|
8
|
+
<script type="text/javascript" src="plugins.js"></script>
|
9
|
+
<script type="text/javascript" src="main.js"></script>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
|
13
|
+
<header>
|
14
|
+
<h1>Coverage</h1>
|
15
|
+
</header>
|
16
|
+
|
17
|
+
<input id="filter" name="filter" type="text" placeholder="Filter">
|
18
|
+
|
19
|
+
<div class="table-wrapper">
|
20
|
+
<table class="summary sort" border="none">
|
21
|
+
<thead>
|
22
|
+
<tr>
|
23
|
+
<th class="name">Name</th>
|
24
|
+
<th class="lines">Total Lines</th>
|
25
|
+
<th class="loc">Lines of Code</th>
|
26
|
+
<th class="cov">Total Coverage</th>
|
27
|
+
<th class="code">Code Coverage</th>
|
28
|
+
</tr>
|
29
|
+
</thead>
|
30
|
+
<tfoot>
|
31
|
+
<tr class="totals">
|
32
|
+
<td>Total</td>
|
33
|
+
<td><%= total['lines'] %></td>
|
34
|
+
<td><%= total['lines_code'] %></td>
|
35
|
+
<td><%= total['total_cov'] %></td>
|
36
|
+
<td><%= total['code_cov'] %></td>
|
37
|
+
</tr>
|
38
|
+
</tfoot>
|
39
|
+
<tbody>
|
40
|
+
<% files.each do |f| %>
|
41
|
+
<tr>
|
42
|
+
<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['coverage']['total'] %></td>
|
46
|
+
<td><%= f['coverage']['code'] %></td>
|
47
|
+
</tr>
|
48
|
+
<% end %>
|
49
|
+
</tbody>
|
50
|
+
</table>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
<footer>
|
54
|
+
<span>Generated on <%= time %> with </span><a href="http://github.com/hawx/duvet"><%= name %> <%= version %></a>
|
55
|
+
</footer>
|
56
|
+
|
57
|
+
</body>
|
58
|
+
</html>
|
data/test/helper.rb
ADDED
data/test/test_duvet.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
class Klass
|
2
|
+
|
3
|
+
attr_accessor :help
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@help = false
|
7
|
+
end
|
8
|
+
|
9
|
+
def alert!
|
10
|
+
@help = true
|
11
|
+
end
|
12
|
+
|
13
|
+
def shout!
|
14
|
+
if help?
|
15
|
+
"I NEED HELP!"
|
16
|
+
else
|
17
|
+
"EVERYTHING IS OK!"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def help?
|
22
|
+
@help
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
|
2
|
+
require 'duvet'
|
3
|
+
Duvet.start({:dir => 'test_duvet/cov', :filter => 'test_duvet/lib/'})
|
4
|
+
|
5
|
+
|
6
|
+
require 'rubygems'
|
7
|
+
require 'test/unit'
|
8
|
+
require 'shoulda'
|
9
|
+
|
10
|
+
|
11
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
12
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
13
|
+
require 'klass'
|
14
|
+
require 'run'
|
15
|
+
|
16
|
+
class Test::Unit::TestCase
|
17
|
+
end
|
18
|
+
|
19
|
+
# This should run every line
|
20
|
+
class TestKlass < Test::Unit::TestCase
|
21
|
+
|
22
|
+
should "start out ok" do
|
23
|
+
k = Klass.new
|
24
|
+
assert_equal "EVERYTHING IS OK!", k.shout!
|
25
|
+
end
|
26
|
+
|
27
|
+
should "need help when alerted" do
|
28
|
+
k = Klass.new
|
29
|
+
k.alert!
|
30
|
+
assert_equal true, k.help?
|
31
|
+
end
|
32
|
+
|
33
|
+
should "now shout for help" do
|
34
|
+
k = Klass.new
|
35
|
+
k.alert!
|
36
|
+
assert_equal "I NEED HELP!", k.shout!
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
# This one should not run every line
|
42
|
+
class TestRun < Test::Unit::TestCase
|
43
|
+
|
44
|
+
# should "run it" do
|
45
|
+
# me = Run.new
|
46
|
+
# assert_equal "run it", me.run_it
|
47
|
+
# end
|
48
|
+
|
49
|
+
# should "run here" do
|
50
|
+
# me = Run.new
|
51
|
+
# assert_equal "run here", me.run_here
|
52
|
+
# end
|
53
|
+
|
54
|
+
should "run there" do
|
55
|
+
me = Run.new
|
56
|
+
assert_equal "run there", me.run_there
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: duvet
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 0.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Joshua Hawxwell
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-09-01 00:00:00 +01:00
|
19
|
+
default_executable: duvet
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: thoughtbot-shoulda
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: yard
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id002
|
49
|
+
description: Duvet a simple code coverage tool for 1.9
|
50
|
+
email: m@hawx.me
|
51
|
+
executables:
|
52
|
+
- duvet
|
53
|
+
extensions: []
|
54
|
+
|
55
|
+
extra_rdoc_files:
|
56
|
+
- LICENSE
|
57
|
+
- README.md
|
58
|
+
files:
|
59
|
+
- .document
|
60
|
+
- .gitignore
|
61
|
+
- LICENSE
|
62
|
+
- README.md
|
63
|
+
- Rakefile
|
64
|
+
- VERSION
|
65
|
+
- bin/duvet
|
66
|
+
- duvet.gemspec
|
67
|
+
- lib/duvet.rb
|
68
|
+
- lib/duvet/cov.rb
|
69
|
+
- lib/duvet/covs.rb
|
70
|
+
- lib/duvet/ext.rb
|
71
|
+
- lib/duvet/resources/jquery.js
|
72
|
+
- lib/duvet/resources/main.js
|
73
|
+
- lib/duvet/resources/plugins.js
|
74
|
+
- lib/duvet/resources/rcov.sass
|
75
|
+
- lib/duvet/templates/file.erb
|
76
|
+
- lib/duvet/templates/index.erb
|
77
|
+
- test/helper.rb
|
78
|
+
- test/test_duvet.rb
|
79
|
+
- test_duvet/lib/klass.rb
|
80
|
+
- test_duvet/lib/run.rb
|
81
|
+
- test_duvet/test/test_all.rb
|
82
|
+
has_rdoc: true
|
83
|
+
homepage: http://github.com/hawx/duvet
|
84
|
+
licenses: []
|
85
|
+
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options:
|
88
|
+
- --charset=UTF-8
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
hash: 3
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
version: "0"
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
109
|
+
requirements: []
|
110
|
+
|
111
|
+
rubyforge_project:
|
112
|
+
rubygems_version: 1.3.7
|
113
|
+
signing_key:
|
114
|
+
specification_version: 3
|
115
|
+
summary: Duvet a simple code coverage tool for 1.9
|
116
|
+
test_files:
|
117
|
+
- test/helper.rb
|
118
|
+
- test/test_duvet.rb
|