forked from sam/harbor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
61 lines (52 loc) · 1.51 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
require "rubygems"
require "pathname"
require "rake"
require "rake/rdoctask"
require "rake/testtask"
def gemspec
@gemspec ||= begin
file = File.expand_path('../harbor.gemspec', __FILE__)
eval(File.read(file), binding, file)
end
end
# Tests
task :default => [:test]
require 'ci/reporter/rake/test_unit'
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList["test/**/*_test.rb"]
t.verbose = true
end
# rdoc
# desc "Generate RDoc documentation"
# Rake::RDocTask.new(:rdoc) do |rdoc|
# rdoc.options << '--line-numbers' << '--inline-source' <<
# '--main' << 'README' <<
# '--title' << 'Harbor Documentation' <<
# '--charset' << 'utf-8' << "--exclude" << "lib/harbor/generator/"
# rdoc.rdoc_dir = "doc"
# rdoc.rdoc_files.include 'README'
# rdoc.
# rdoc.rdoc_files.include('lib/rack.rb')
# rdoc.rdoc_files.include('lib/rack/*.rb')
# rdoc.rdoc_files.include('lib/rack/*/*.rb')
# end
task :rdoc do
sh <<-EOS.strip
rdoc -T harbor#{" --op " + ENV["OUTPUT_DIRECTORY"] if ENV["OUTPUT_DIRECTORY"]} --line-numbers --main README --title "Harbor Documentation" --exclude "lib/harbor/generator/*" lib/harbor.rb lib/harbor README
EOS
end
# Performance
task :perf => :performance
task :performance do
puts `ruby #{Pathname(__FILE__).dirname + "script/performance.rb"}`
end
# Gem
require "rake/gempackagetask"
Rake::GemPackageTask.new(gemspec) do |pkg|
pkg.gem_spec = gemspec
end
desc "Install Harbor as a gem"
task :install => [:repackage] do
sh %{gem install pkg/#{gemspec.full_name}}
end