/
config.rb
106 lines (94 loc) · 3.43 KB
/
config.rb
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
require 'configuration'
require 'rake'
require 'tasks/utils'
#-----------------------------------------------------------------------
# General project configuration
#-----------------------------------------------------------------------
Configuration.for('project') {
name "FIXME: NAME"
version "FIXME: 0.0.0"
author "FIXME: The Author"
email "FIXME: author@example.com"
homepage "FIXME: http://project.example.com"
description Utils.section_of("README", "description")
summary description.split(".").first
history "HISTORY"
license FileList["LICENSE"]
readme "README"
}
#-----------------------------------------------------------------------
# Packaging
#-----------------------------------------------------------------------
Configuration.for('packaging') {
# files in the project
proj_conf = Configuration.for('project')
files {
bin FileList["bin/*"]
ext FileList["ext/**/*"]
lib FileList["lib/**/*.rb"]
test FileList["spec/**/*.rb", "test/**/*.rb"]
data FileList["data/**/*"]
tasks FileList["tasks/**/*.r{ake,b}"]
rdoc FileList[proj_conf.readme, proj_conf.history,
proj_conf.license] + lib
all bin + lib + test + data + rdoc + tasks
}
# ways to package the results
formats {
tgz true
zip true
gem Configuration::Table.has_key?('gem')
}
}
#-----------------------------------------------------------------------
# Gem packaging
#-----------------------------------------------------------------------
Configuration.for("gem") {
spec "gemspec.rb"
Configuration.for('packaging').files.all << spec
}
#-----------------------------------------------------------------------
# Testing
# - change mode to 'testunit' to use unit testing
#-----------------------------------------------------------------------
Configuration.for('test') {
mode "spec"
files Configuration.for("packaging").files.test
options %w[ --format specdoc --color ]
ruby_opts %w[ ]
}
#-----------------------------------------------------------------------
# Rcov
#-----------------------------------------------------------------------
Configuration.for('rcov') {
output_dir "coverage"
libs %w[ lib ]
rcov_opts %w[ --html ]
ruby_opts %w[ ]
test_files Configuration.for('packaging').files.test
}
#-----------------------------------------------------------------------
# Rdoc
#-----------------------------------------------------------------------
Configuration.for('rdoc') {
files Configuration.for('packaging').files.rdoc
main_page files.first
title Configuration.for('project').name
options %w[ --line-numbers --inline-source ]
output_dir "doc"
}
#-----------------------------------------------------------------------
# Extensions
#-----------------------------------------------------------------------
Configuration.for('extension') {
configs Configuration.for('packaging').files.ext.find_all { |x| %w[ mkrf_conf.rb extconf.rb ].include?(File.basename(x)) }
}
#-----------------------------------------------------------------------
# Rubyforge
#-----------------------------------------------------------------------
Configuration.for('rubyforge') {
project "FIXME: rubyforge project"
user "FIXME: username"
host "rubyforge.org"
rdoc_location "#{user}@#{host}:/var/www/gforge-projects/#{project}"
}