-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
65 lines (53 loc) · 1.74 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
require "rake/testtask"
require "rake/clean"
require "rake/rdoctask"
require "rake/gempackagetask"
PROJECT_VERSION = '0.0.6'
# Ruby library code.
LIB_FILES = FileList["lib/**/*.rb"]
# Options common to RDocTask AND Gem::Specification.
# The --main argument specifies which file appears on the index.html page
GENERAL_RDOC_OPTS = {
"--title" => "SNMP Agent for Ruby"
}
# Output directory for the rdoc html files.
RDOC_HTML_DIR = "doc"
# Filelist with Test::Unit test cases.
TEST_FILES = FileList["test/**/*_test.rb"]
# Executables
BIN_FILES = FileList["bin/*"]
# Files included in distribution
DIST_FILES = FileList["**/*.rb", "**/*.rdoc"]
DIST_FILES.include("Rakefile", "TODO")
DIST_FILES.include(BIN_FILES)
# Don't package files which are autogenerated by RDocTask
DIST_FILES.exclude(/^(\.\/)?#{RDOC_HTML_DIR}(\/|$)/)
# Run the tests if rake is invoked without arguments.
task "default" => ["test"]
Rake::TestTask.new do |t|
t.test_files = TEST_FILES
t.libs = ["lib"]
end
GEM_SPEC = Gem::Specification.new do |s|
s.name = 'ruby-snmpd'
s.version = PROJECT_VERSION
s.summary = 'A Ruby implementation of an SNMP agent'
s.homepage = "http://theshed.hezmatt.org/rubysnmpd"
s.author = 'Matthew Palmer'
s.email = '[email protected]'
s.files = DIST_FILES
s.test_files = TEST_FILES
s.executables = BIN_FILES.map { |fn| File.basename(fn) }
s.has_rdoc = true
s.rdoc_options = GENERAL_RDOC_OPTS.to_a.flatten
end
Rake::GemPackageTask.new(GEM_SPEC) do |pkg|
pkg.need_tar_gz = true
pkg.package_dir = File.dirname(File.dirname(File.expand_path(__FILE__))) + '/builds'
end
Rake::RDocTask.new("rdoc") do |t|
t.rdoc_files = LIB_FILES
t.title = GENERAL_RDOC_OPTS["--title"]
t.main = GENERAL_RDOC_OPTS["--main"]
t.rdoc_dir = RDOC_HTML_DIR
end