forked from mojombo/tomdoc
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Rakefile
92 lines (71 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
require File.dirname(__FILE__) + '/lib/tomdoc/version'
require 'rake/testtask'
def command?(command)
system("type #{command} > /dev/null 2>&1")
end
#
# Manual
#
if command? :ronn
desc "Build and display the manual."
task :man => "man:build" do
exec "man man/tomdoc.5"
end
desc "Build and display the manual in your browser."
task "man:html" => "man:build" do
sh "open man/tomdoc.5.html"
end
desc "Build the manual"
task "man:build" do
sh "ronn -br5 --organization=MOJOMBO --manual='TomDoc Manual' man/*.ronn"
end
end
#
# Tests
#
task :default => :test
if command? :turn
desc "Run tests with turn"
task :turn do
suffix = "-n #{ENV['TEST']}" if ENV['TEST']
sh "turn -Ilib:. test/*.rb #{suffix}"
end
end
Rake::TestTask.new do |t|
t.libs << 'lib'
t.libs << '.'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
#
# Development
#
desc "Drop to irb."
task :console do
exec "irb -I lib -rtomdoc"
end
#
# Gems
#
desc "Build gem."
task :gem do
sh "gem build tomdoc.gemspec"
end
task :push => [:gem] do
file = Dir["*-#{TomDoc::VERSION}.gem"].first
sh "gem push #{file}"
end
desc "tag version"
task :tag do
sh "git tag v#{TomDoc::VERSION}"
sh "git push origin master --tags"
sh "git clean -fd"
end
desc "tag version and push gem to server"
task :release => [:push, :tag] do
puts "And away she goes!"
end
desc "Do nothing."
task :noop do
puts "Done nothing."
end