forked from jscruggs/metric_fu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
46 lines (40 loc) · 1.35 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'rake'
require 'rake/rdoctask'
require 'spec/rake/spectask'
require 'lib/metric_fu'
desc "Run all specs in spec directory"
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.rcov = true
t.rcov_opts = ['--exclude', 'spec,config,Library,usr/lib/ruby']
t.rcov_dir = File.join(File.dirname(__FILE__), "tmp")
end
MetricFu::Configuration.run do |config|
end
namespace :metrics do
desc "Generate all reports"
task :all do
MetricFu.metrics.each {|metric| MetricFu.report.add(metric) }
MetricFu.report.save_output(MetricFu.report.to_yaml,
MetricFu.base_directory,
'report.yml')
MetricFu.report.save_templatized_report
if MetricFu.report.open_in_browser?
MetricFu.report.show_in_browser(MetricFu.output_directory)
end
end
MetricFu.metrics.each do |metric|
desc "Generate report for #{metric}"
task metric do
MetricFu.report.add(metric)
MetricFu.report.save_output(MetricFu.report.to_yaml,
MetricFu.base_directory,
'report.yml')
MetricFu.report.save_templatized_report
if MetricFu.report.open_in_browser?
MetricFu.report.show_in_browser(MetricFu.output_directory)
end
end
end
end
task :default => [:"metrics:all"]