-
Notifications
You must be signed in to change notification settings - Fork 88
/
Rakefile
41 lines (32 loc) · 961 Bytes
/
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
require 'rspec/core/rake_task'
require 'bundler/gem_tasks'
desc 'Run all specs'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
namespace :docs do |ns|
require 'systemu'
docs_dir = File.join(File.dirname(File.expand_path(__FILE__)), 'docs')
Dir.chdir docs_dir do
sphinxbuild = ENV['SPHINXBUILD'] || 'sphinx-build'
status, stdout, stderr = systemu "make SPHINXBUILD=#{sphinxbuild} help"
if status != 0 and Rake.verbose
$stderr.puts '# Unable to load tasks in the `docs` namespace:'
stderr.each_line { |l| $stderr.puts "# #{l}" }
end
desc 'clean up doc builds'
task 'clean' do
Dir.chdir docs_dir do
system "make SPHINXBUILD=#{sphinxbuild} clean"
end
end
stdout.each_line.grep(/^\s+(\w+?)\s+(.*)$/) do
t, d = $1, $2
desc d
task t do
Dir.chdir docs_dir do
system "make SPHINXBUILD=#{sphinxbuild} #{t}"
end
end
end
end
end