p8-metric_fu 0.8.2 → 0.8.3
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/lib/metric_fu/base.rb +1 -0
- data/lib/tasks/coverage.rake +47 -35
- metadata +3 -2
data/lib/metric_fu/base.rb
CHANGED
data/lib/tasks/coverage.rake
CHANGED
@@ -1,40 +1,52 @@
|
|
1
1
|
require 'fileutils'
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'rcov'
|
5
|
+
require 'rcov/rcovtask'
|
6
|
+
require 'spec/rake/spectask'
|
7
|
+
|
8
|
+
namespace :metrics do
|
9
|
+
|
10
|
+
COVERAGE_DIR = File.join(MetricFu::BASE_DIRECTORY, 'coverage')
|
11
|
+
COVERAGE_DATA_FILE = File.join(MetricFu::BASE_DIRECTORY, 'coverage.data')
|
12
|
+
SPEC_HTML_FILE = File.join(MetricFu::BASE_DIRECTORY, 'specs.html')
|
13
|
+
|
14
|
+
namespace :coverage do
|
15
|
+
rcov_output = COVERAGE_DIR
|
16
|
+
|
17
|
+
desc "Delete aggregate coverage data."
|
18
|
+
task(:clean) { rm_f("rcov_tmp", :verbose => false) }
|
19
|
+
|
20
|
+
desc "RCov task to generate report"
|
21
|
+
Rcov::RcovTask.new(:do => :clean) do |t|
|
22
|
+
FileUtils.mkdir_p(MetricFu::BASE_DIRECTORY) unless File.directory?(MetricFu::BASE_DIRECTORY)
|
23
|
+
t.test_files = FileList['test/**/*_test.rb', 'spec/**/*_spec.rb']
|
24
|
+
t.rcov_opts = ["--sort coverage", "--html", "--rails", "--exclude /gems/,/Library/"]
|
25
|
+
t.output_dir = COVERAGE_DIR
|
26
|
+
end
|
27
|
+
# TODO not sure what this improves but it requires the diff-lcs gem
|
28
|
+
# http://github.com/indirect/metric_fu/commit/b9c1cf75f09d5b531b388cd01661eb16b5126968#diff-1
|
29
|
+
# Spec::Rake::SpecTask.new(:do => :clean) do |t|
|
30
|
+
# FileUtils.mkdir_p(MetricFu::BASE_DIRECTORY) unless File.directory?(MetricFu::BASE_DIRECTORY)
|
31
|
+
# t.ruby_opts = ['-rtest/unit']
|
32
|
+
# t.spec_files = FileList['test/**/*_test.rb', 'spec/**/*spec.rb']
|
33
|
+
# t.spec_opts = ["--format", "html:#{SPEC_HTML_FILE}", "--diff"]
|
34
|
+
# t.rcov = true
|
35
|
+
# t.rcov_opts = ["--sort coverage", "--html", "--rails", "--exclude /gems/,/Library/"]
|
36
|
+
# t.rcov_dir = COVERAGE_DIR
|
37
|
+
# end
|
26
38
|
end
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
39
|
+
|
40
|
+
desc "Generate and open coverage report"
|
41
|
+
task :coverage => ['coverage:do'] do
|
42
|
+
system("open #{COVERAGE_DIR}/index.html") if PLATFORM['darwin']
|
31
43
|
end
|
32
44
|
end
|
33
|
-
|
45
|
+
rescue LoadError
|
46
|
+
if RUBY_PLATFORM =~ /java/
|
47
|
+
puts 'running in jruby - rcov tasks not available'
|
48
|
+
else
|
49
|
+
puts 'sudo gem install rcov # if you want the rcov tasks'
|
50
|
+
|
34
51
|
end
|
35
|
-
|
36
|
-
desc "Generate and open coverage report"
|
37
|
-
task :coverage => ['coverage:do'] do
|
38
|
-
system("open #{COVERAGE_DIR}/index.html") if PLATFORM['darwin']
|
39
|
-
end
|
40
|
-
end
|
52
|
+
end
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: p8-metric_fu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Scruggs
|
8
8
|
- Sean Soper
|
9
9
|
- Andre Arko
|
10
|
+
- Petrik de Heus
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
14
|
|
14
|
-
date: 2008-
|
15
|
+
date: 2008-12-22 00:00:00 -08:00
|
15
16
|
default_executable:
|
16
17
|
dependencies:
|
17
18
|
- !ruby/object:Gem::Dependency
|