-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
62 lines (53 loc) · 1.53 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
require 'rubygems/package_task'
require 'rdoc/task'
$: << "#{File.dirname(__FILE__)}/lib"
spec = Gem::Specification.new { |s|
s.platform = Gem::Platform::RUBY
s.author = "Pete Elmore"
s.email = "[email protected]"
s.files = Dir["{lib,doc,bin,ext}/**/*"].delete_if {|f|
/\/rdoc(\/|$)/i.match f
} + %w(Rakefile)
s.require_path = 'lib'
s.extra_rdoc_files = Dir['doc/*'].select(&File.method(:file?))
s.extensions << 'ext/extconf.rb' if File.exist? 'ext/extconf.rb'
Dir['bin/*'].map(&File.method(:basename)).map(&s.executables.method(:<<))
s.name = 'watts'
s.license = 'MIT'
s.summary =
"Resource-oriented, Rack-based, minimalist web framework."
s.homepage = "http://github.com/pete/watts"
%w(rack).each &s.method(:add_dependency)
s.version = '1.0.6'
}
Rake::RDocTask.new(:doc) { |t|
t.main = 'doc/README'
t.rdoc_files.include 'lib/**/*.rb', 'doc/*', 'bin/*', 'ext/**/*.c',
'ext/**/*.rb'
t.options << '-S' << '-N'
t.rdoc_dir = 'doc/rdoc'
}
Gem::PackageTask.new(spec) { |pkg|
pkg.need_tar_bz2 = true
}
desc "Cleans out the packaged files."
task(:clean) {
FileUtils.rm_rf 'pkg'
}
desc "Builds and installs the gem for #{spec.name}"
task(:install => :package) {
g = "pkg/#{spec.name}-#{spec.version}.gem"
system "gem install -l #{g}"
}
desc "Runs IRB, automatically require()ing #{spec.name}."
task(:irb) {
exec "irb -Ilib -r#{spec.name}"
}
desc "Runs tests."
task(:test) {
tests = Dir['test/*_test.rb'].map { |t| "-r#{t}" }
if ENV['COVERAGE']
tests.unshift "-rtest/coverage"
end
system 'ruby', '-Ilib', '-I.', *tests, '-e', ''
}