-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
70 lines (58 loc) · 1.63 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
require 'rake'
require 'spec/rake/spectask'
require 'rake/clean'
require 'rake/rdoctask'
require 'rubygems/specification'
desc "Run all specs"
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_opts = ["-cfs"]
t.spec_files = FileList['spec/**/*_spec.rb']
t.libs = ['lib']
end
desc "Print specdocs"
Spec::Rake::SpecTask.new(:doc) do |t|
t.spec_opts = ["--format", "specdoc", "--dry-run"]
t.spec_files = FileList['spec/*_spec.rb']
end
desc "Generate RCov code coverage report"
Spec::Rake::SpecTask.new('rcov') do |t|
t.spec_files = FileList['spec/*_spec.rb']
t.rcov = true
t.rcov_opts = ['--exclude', 'examples']
end
def gemspec
@gemspec ||= begin
file = File.expand_path('../hookout.gemspec', __FILE__)
eval(File.read(file), binding, file)
end
end
begin
require 'rake/gempackagetask'
rescue LoadError
task(:gem) { $stderr.puts '`gem install rake` to package gems' }
else
Rake::GemPackageTask.new(gemspec) do |pkg|
pkg.gem_spec = gemspec
end
task :gem => :gemspec
end
desc "install the gem locally"
task :install => :package do
sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
end
desc "validate the gemspec"
task :gemspec do
gemspec.validate
end
task :package => :gemspec
Rake::RDocTask.new do |t|
t.rdoc_dir = 'rdoc'
t.title = "Hookout"
t.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
t.options << '--charset' << 'utf-8'
t.rdoc_files.include('README.rdoc')
t.rdoc_files.include('lib/hookout/*.rb')
end
CLEAN.include [ 'build/*', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log', 'pkg', 'lib/*.bundle', '*.gem', '.config' ]
task :test => [ :spec ]
task :default => :spec