/
Rakefile
53 lines (41 loc) · 1.12 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
require 'bundler'
Bundler::GemHelper.install_tasks
require 'rubygems'
require 'rubygems/package_task'
require 'rdoc/task'
require 'rspec/core'
require 'rspec/core/rake_task'
spec = eval(File.read('taskrabbit.gemspec'))
Gem::PackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
desc 'Cleans out the documentation and cache'
task :clobber_doc do
rm_r '.yardoc' rescue nil
rm_r 'doc' rescue nil
end
desc 'Clear out YARD docs and generated packages'
task :clean => [:clobber_package, :clobber_doc]
begin
require 'yard'
YARD::Rake::YardocTask.new :doc
rescue LoadError => e
task :doc do
warn 'YARD is not available, to generate documentation please install yard.'
end
end
begin
require 'ci/reporter/rake/rspec'
rescue LoadError
end
task :default => :spec
desc "Run all specs in spec directory (excluding plugin specs)"
RSpec::Core::RakeTask.new(:spec)
namespace :spec do
desc "Run all specs with rcov"
RSpec::Core::RakeTask.new(:rcov) do |t|
t.rcov = true
t.pattern = "./spec/**/*_spec.rb"
t.rcov_opts = '--exclude spec/,/gems/,/Library/,/usr/,lib/tasks,.bundle,config,/lib/rspec/,/lib/rspec-'
end
end