-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
83 lines (72 loc) · 1.79 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
require 'rake/clean'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/contrib/rubyforgepublisher'
require 'rake/gempackagetask'
require 'rubygems'
$VERSION = "0.4"
task :package => [:version, :clean]
desc "Library version"
task :version do
file = "lib/net/dns/dns.rb"
str = IO.readlines(file).to_s
offset = (str =~ /VERSION = "(.*)"/)
unless $1 == $VERSION
str.gsub!($1,$VERSION)
File.open(file,"w") do |out|
out << str
end
end
end
desc "Run the tests"
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/net/dns/**/test*.rb']
t.verbose = true
end
desc "Install the library"
task :install do
sh("sudo ruby setup.rb")
end
desc "Build documentation"
Rake::RDocTask.new do |rd|
rd.rdoc_files.include("lib/net/dns/**/*.rb")
rd.options << "-S"
end
#
# Gem specifications
#
SPEC = Gem::Specification.new do |s|
s.name = "net-dns"
s.version = "#$VERSION"
s.author = "Marco Ceresa"
s.email = "[email protected]"
s.homepage = "http://net-dns.rubyforge.org/"
s.platform = Gem::Platform::RUBY
s.summary = "Pure Ruby DNS library"
candidates = Dir.glob("**/*")
s.files = candidates.delete_if do |item|
item.include?("CVS") || item.include?("rdoc") || item.include?("pkg") || item.include?(".svn")
end
s.has_rdoc = true
s.extra_rdoc_files = ["README","AUTHORS","INSTALL", "THANKS"]
s.description = <<EOF
A pure Ruby DNS library, similar to the Perl Net::DNS library
EOF
end
#
# Build packages
#
desc "Build packages"
Rake::GemPackageTask.new(SPEC) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
#
# RubyForge publisher
#
desc "Upload project on RubyForge"
task :upload do
rubyforge = Rake::RubyForgePublisher.new("net-dns","bluemonk")
rubyforge.upload
end