forked from mvidner/ruby-dbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
64 lines (55 loc) · 1.42 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
62
63
64
#! /usr/bin/env ruby
require 'rake'
require 'rake/gempackagetask'
require 'fileutils'
include FileUtils
require 'tmpdir'
require 'rake/rdoctask'
require 'rake/testtask'
desc 'Default: run tests in the proper environment'
task :default => :test
def common_test_task(t)
t.libs << "lib"
t.test_files = FileList['test/*_test.rb', 'test/t[0-9]*.rb']
t.verbose = true
end
Rake::TestTask.new("bare:test") {|t| common_test_task t }
begin
require 'rcov/rcovtask'
Rcov::RcovTask.new("bare:rcov") {|t| common_test_task t }
rescue LoadError
# no rcov, never mind
end
%w(test rcov).each do |tname|
desc "Run bare:#{tname} in the proper environment"
task tname do |t|
cd "test" do
system "./test_env rake bare:#{tname}"
end
end
end
load "ruby-dbus.gemspec"
Rake::GemPackageTask.new(GEMSPEC) do |pkg|
# no other formats needed
end
desc "Build a package from a clone of the local Git repo"
task :package_git do |t|
Dir.mktmpdir do |temp|
sh "git clone . #{temp}"
cd temp do
sh "rake package"
end
cp_r "#{temp}/pkg", "."
end
end
Rake::RDocTask.new do |rd|
rd.rdoc_dir = 'doc/rdoc'
rd.rdoc_files.include("README", "lib/**/*.rb")
# rd.options << "--diagram"
# rd.options << "--all"
end
desc "Render the tutorial in HTML"
task :tutorial => "doc/tutorial/index.html"
file "doc/tutorial/index.html" => "doc/tutorial/index.markdown" do |t|
sh "markdown #{t.prerequisites[0]} > #{t.name}"
end