This repository has been archived by the owner on Mar 2, 2022. It is now read-only.
forked from danmayer/churn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
97 lines (86 loc) · 3.14 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
require 'rubygems'
require 'rake'
require 'lib/tasks/churn_tasks'
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "churn"
gem.summary = %Q{Providing additional churn metrics over the original metric_fu churn}
gem.description = %Q{High method and class churn has been shown to have increased bug and error rates. This gem helps you know what is changing a lot so you can do additional testing, code review, or refactoring to try to tame the volatile code. }
gem.email = "[email protected]"
gem.homepage = "http://github.com/danmayer/churn"
gem.authors = ["Dan Mayer"]
gem.add_development_dependency "shoulda"
gem.add_development_dependency "test-construct"
gem.add_development_dependency "mocha", '~> 0.9.5'
gem.add_dependency "main"
gem.add_dependency "json_pure"
gem.add_dependency "chronic", '~> 0.2.3'
gem.add_dependency "sexp_processor", '~> 3.0.3'
gem.add_dependency "ruby_parser", '~> 2.0.4'
gem.add_dependency 'hirb'
gem.executables = ['churn']
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end
begin
#for additional metrics, mostly Rcov which caliper doesn't do
require 'metric_fu'
MetricFu::Configuration.run do |config|
config.metrics = [:churn, :saikuro, :roodi, :flog, :flay, :reek, :roodi, :rcov]
config.graphs = [:roodi, :flog, :flay, :reek, :roodi, :rcov]
config.flay = { :dirs_to_flay => ['lib'] }
config.flog = { :dirs_to_flog => ['lib'] }
config.reek = { :dirs_to_reek => ['lib'] }
config.roodi = { :dirs_to_roodi => ['lib'] }
config.saikuro = { :output_directory => 'tmp/tmp_saikuro',
:input_directory => ['lib'],
:cyclo => "",
:filter_cyclo => "0",
:warn_cyclo => "5",
:error_cyclo => "7",
:formater => "text"} #this needs to be set to "text"
config.churn = { :start_date => "3 months ago", :minimum_churn_count => 10}
config.rcov = { :test_files => ['test/unit/**/*_test.rb'],
:rcov_opts => ["--sort coverage",
"--no-html",
"--text-coverage",
"--no-color",
"--profile",
"--exclude /gems/,spec"]}
end
end
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
test.libs << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
rescue LoadError
task :rcov do
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
end
end
task :test => :check_dependencies
task :default => :test
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
if File.exist?('VERSION')
version = File.read('VERSION')
else
version = ""
end
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "churn #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end