/
Rakefile
61 lines (52 loc) · 2.06 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
begin
require 'bundler'
require 'rspec/core/rake_task'
require 'metric_fu'
Bundler.setup
rescue LoadError
puts '*** You must `gem install bundler` and `bundle install` to run rake tasks'
end
$LOAD_PATH.unshift 'lib'
load 'tasks/octave.rake'
RSpec::Core::RakeTask.new do |t|
t.rspec_opts = [ "--color" ]
end
task :default => :spec
MetricFu::Configuration.run do |config|
#define which metrics you want to use
config.metrics = [:churn, :saikuro, :flog, :flay, :reek, :roodi]
config.graphs = [:flog, :flay, :reek, :roodi]
config.flay = { :dirs_to_flay => ['app', 'lib'],
:minimum_score => 100 }
config.flog = { :dirs_to_flog => ['app', 'lib'] }
config.reek = { :dirs_to_reek => ['app', 'lib'] }
config.roodi = { :dirs_to_roodi => ['app', 'lib'] }
config.saikuro = { :output_directory => 'scratch_directory/saikuro',
:input_directory => ['app', 'lib'],
:cyclo => "",
:filter_cyclo => "0",
:warn_cyclo => "5",
:error_cyclo => "7",
:formater => "text"} #this needs to be set to "text"
config.churn = { :start_date => "1 year ago", :minimum_churn_count => 10}
config.rcov = { :environment => 'test',
:test_files => ['spec/**/*_spec.rb'],
:rcov_opts => ["--sort coverage",
"--no-html",
"--text-coverage",
"--no-color",
"--profile",
"--rails",
"--exclude /gems/,/Library/,spec"]}
config.graph_engine = :bluff
end
desc "Push a new version to Gemcutter"
task :publish do
require 'hansel/version'
sh "gem build hansel.gemspec"
sh "gem push hansel-#{HanselCore::Version}.gem"
sh "git tag v#{HanselCore::Version}"
sh "git push origin v#{HanselCore::Version}"
sh "git push origin master"
sh "git clean -fd"
end