forked from samvera-deprecated/jettywrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
58 lines (48 loc) · 1.58 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
require 'rake'
require 'bundler'
require 'rspec/core/rake_task'
require 'yard'
Bundler::GemHelper.install_tasks
Dir.glob('tasks/*.rake').each { |r| import r }
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
RSpec::Core::RakeTask.new(:spec => 'jetty:clean') do |spec|
# spec.libs << 'lib' << 'spec'
# spec.spec_files = FileList['spec/**/*_spec.rb']
end
RSpec::Core::RakeTask.new(:coverage) do |spec|
ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
ENV['COVERAGE'] = 'true' unless ruby_engine == 'jruby'
if ENV['COVERAGE'] and RUBY_VERSION =~ /^1.8/
spec.rcov = true
spec.rcov_opts = %w{--exclude spec\/*,gems\/*,ruby\/* --aggregate coverage.data}
end
end
task :clean do
puts 'Cleaning old coverage.data'
FileUtils.rm('coverage.data') if(File.exists? 'coverage.data')
end
# Use yard to build docs
begin
require 'yard'
require 'yard/rake/yardoc_task'
project_root = File.expand_path(File.dirname(__FILE__))
doc_destination = File.join(project_root, 'doc')
YARD::Rake::YardocTask.new(:doc) do |yt|
yt.files = Dir.glob(File.join(project_root, 'lib', '**', '*.rb')) +
[ File.join(project_root, 'README.textile') ]
yt.options = ['--output-dir', doc_destination, '--readme', 'README.textile']
end
rescue LoadError
desc "Generate YARD Documentation"
task :doc do
abort "Please install the YARD gem to generate rdoc."
end
end
#task :default => [:coverage, :doc]
task :default => [:spec]