-
Notifications
You must be signed in to change notification settings - Fork 80
/
Rakefile
54 lines (42 loc) · 1.16 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
require 'rubygems'
require 'bundler'
# Turn on verbose warnings for tests
ENV['RUBYOPT'] = '-w'
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
require 'rake/clean'
require 'rspec/core/rake_task'
require 'yard'
require 'coveralls/rake/task'
CLEAN.replace %w(pkg doc .yardoc coverage)
Bundler::GemHelper.install_tasks
desc "Run RSpec"
RSpec::Core::RakeTask.new(:core_spec) do |t|
t.verbose = false
t.rspec_opts = '--color -f nested --tty'
end
task :nokogiri_spec do
ENV['HTML_PARSER'] = 'nokogiri'
Rake::Task[:core_spec].reenable
Rake::Task[:core_spec].invoke
end
task :rexml_spec do
ENV['HTML_PARSER'] = 'rexml'
Rake::Task[:core_spec].reenable
Rake::Task[:core_spec].invoke
end
task :spec => [:rexml_spec, :nokogiri_spec]
task :default => :spec
task :test => :spec
YARD::Rake::YardocTask.new do |t|
t.files = FileList["lib/maruku.rb", "lib/maruku/*.rb", "lib/maruku/ext/*.rb",
"lib/maruku/ext/math/*.rb"]
end
Coveralls::RakeTask.new
# Travis runs this task
task :test_with_coveralls => [:spec, 'coveralls:push']