rant 0.3.4 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS +13 -0
- data/README +1 -1
- data/Rantfile +24 -16
- data/doc/advanced.rdoc +188 -0
- data/doc/examples/directedrule/Rantfile +23 -0
- data/doc/examples/directedrule/src_a/a_1.c +0 -0
- data/doc/examples/directedrule/src_a/a_2.c +5 -0
- data/doc/examples/directedrule/src_b/b_1.c +0 -0
- data/doc/jamis.rb +590 -0
- data/doc/rantfile.rdoc +29 -9
- data/lib/rant/import.rb +19 -9
- data/lib/rant/import/autoclean.rb +65 -0
- data/lib/rant/import/clean.rb +45 -0
- data/lib/rant/import/directedrule.rb +122 -0
- data/lib/rant/import/package.rb +258 -0
- data/lib/rant/import/rubydoc.rb +5 -0
- data/lib/rant/import/rubypackage.rb +1 -1
- data/lib/rant/import/truth.rb +24 -0
- data/lib/rant/plugin/configure.rb +1 -0
- data/lib/rant/rantfile.rb +77 -26
- data/lib/rant/rantlib.rb +116 -21
- data/lib/rant/rantsys.rb +92 -4
- data/lib/rant/rantvar.rb +252 -11
- data/rantmethods.rb +2 -2
- data/test/Rantfile +35 -1
- data/test/import/directedrule/Rantfile +27 -0
- data/test/import/directedrule/test_directedrule.rb +31 -0
- data/test/import/truth/Rantfile +16 -0
- data/test/import/truth/test_truth.rb +23 -0
- data/test/rant-import/Rantfile +15 -0
- data/test/rant-import/test_rant-import.rb +65 -0
- data/test/test_clean.rb +134 -0
- data/test/test_examples.rb +47 -0
- data/test/test_filelist.rb +58 -0
- data/test/test_rac.rb +59 -0
- data/test/test_rantfile_api.rb +47 -0
- data/test/test_var.rb +176 -0
- data/test/tutil.rb +18 -2
- data/test/var.rf +23 -0
- metadata +29 -2
data/NEWS
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
|
2
2
|
= Rant NEWS
|
3
3
|
|
4
|
+
== Rant 0.3.6
|
5
|
+
|
6
|
+
This version should be fully backwards compatible to 0.3.4.
|
7
|
+
|
8
|
+
New features:
|
9
|
+
* Automatic cleanup of generated files
|
10
|
+
* Directed rules
|
11
|
+
* Constraining variables
|
12
|
+
* rant-import searches $LOAD_PATH
|
13
|
+
* Immediately build targets with <tt>rac.build "target"</tt>
|
14
|
+
Read doc/rantfile.rdoc[link:files/doc/rantfile_rdoc.html] and
|
15
|
+
doc/advanced.rdoc[link:files/doc/advanced_rdoc.html] for docu.
|
16
|
+
|
4
17
|
== Rant 0.3.4
|
5
18
|
|
6
19
|
Incompatible changes:
|
data/README
CHANGED
@@ -36,7 +36,7 @@ Running rant in the directory of this file:
|
|
36
36
|
will ensure that the "data" file in the "backup" directory is up to
|
37
37
|
date.
|
38
38
|
|
39
|
-
This document was written for version 0.3.
|
39
|
+
This document was written for version 0.3.6 of Rant. Most things
|
40
40
|
described here will work for older/newer versions of Rant, but look at
|
41
41
|
the README file in the Rant distribution you've installed for exact
|
42
42
|
documentation of your Rant version.
|
data/Rantfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
# Rantfile for Rant :)
|
3
3
|
|
4
|
-
import %w(rubytest rubydoc rubypackage)
|
4
|
+
import %w(rubytest rubydoc rubypackage autoclean)
|
5
5
|
|
6
6
|
task :default => :test
|
7
7
|
|
@@ -9,6 +9,7 @@ lib_files = sys["lib/**/*.rb"]
|
|
9
9
|
dist_files = sys["{bin,lib,test,doc}/**/*"].shun("html", "coverage") +
|
10
10
|
sys["*"].no_dir.exclude("InstalledFiles", "Session.vim")
|
11
11
|
bin_files = sys["bin/*"]
|
12
|
+
rdoc_opts = %w(-S -c UTF-8 --title Rant --main README)
|
12
13
|
|
13
14
|
gen RubyPackage, "rant" do |t|
|
14
15
|
t.version = `#{Env::RUBY} run_rant --version`.split[1]
|
@@ -19,18 +20,20 @@ gen RubyPackage, "rant" do |t|
|
|
19
20
|
t.author = "Stefan Lang"
|
20
21
|
t.email = "langstefan@gmx.at"
|
21
22
|
t.rubyforge_project = "make"
|
22
|
-
t.gem_extra_rdoc_files = sys["**/README", "NEWS"].no_dir("pkg").no_dir("test") + sys["doc/**/*.rdoc"]
|
23
23
|
t.homepage = "http://make.rubyforge.org"
|
24
|
+
t.gem_extra_rdoc_files = sys["**/README", "NEWS"].no_dir("pkg").no_dir("test") + sys["doc/**/*.rdoc"]
|
25
|
+
t.gem_rdoc_options = rdoc_opts
|
24
26
|
desc "Create packages for distribution."
|
25
27
|
t.package_task
|
26
28
|
end
|
27
29
|
|
28
30
|
desc "Generate documentation."
|
29
31
|
gen RubyDoc do |g|
|
32
|
+
g.verbose = true
|
30
33
|
g.dir = "doc/html"
|
31
|
-
g.files.concat
|
32
|
-
g.files.concat
|
33
|
-
g.opts = %w(-
|
34
|
+
g.files.concat sys["NEWS", "**/README"].no_dir("pkg").no_dir("test")
|
35
|
+
g.files.concat sys["doc/**/*.rdoc"]
|
36
|
+
g.opts = rdoc_opts + %w(-T doc/jamis.rb)
|
34
37
|
end
|
35
38
|
|
36
39
|
desc "Run basic tests."
|
@@ -77,6 +80,18 @@ gen RubyTest, :tsubdirs do |t|
|
|
77
80
|
t.test_files = sys["test/subdirs/test_*.rb"]
|
78
81
|
end
|
79
82
|
|
83
|
+
desc "Test rant-import command."
|
84
|
+
gen RubyTest, :trimport do |t|
|
85
|
+
t.libs << "test"
|
86
|
+
t.test_files = sys["test/rant-import/test_*.rb"]
|
87
|
+
end
|
88
|
+
|
89
|
+
desc "Test import/ libraries."
|
90
|
+
gen RubyTest, :timport do |t|
|
91
|
+
t.libs << "test"
|
92
|
+
t.test_files = sys["test/import/**/test_*.rb"]
|
93
|
+
end
|
94
|
+
|
80
95
|
desc "Run all tests."
|
81
96
|
gen RubyTest, :tall do |g|
|
82
97
|
g.libs << "test"
|
@@ -85,11 +100,10 @@ end
|
|
85
100
|
task :testall => %w(test testp1 testp2 testrb1 testplugins)
|
86
101
|
|
87
102
|
desc "Remove autogenerated files."
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
end
|
103
|
+
gen AutoClean, :clean
|
104
|
+
var[:clean].include %w(
|
105
|
+
InstalledFiles .config bench-rant bench-depsearch test/coverage
|
106
|
+
)
|
93
107
|
|
94
108
|
desc "Publish html docs on make.rubyfore.org.",
|
95
109
|
"Note: scp will prompt for rubyforge password."
|
@@ -132,10 +146,4 @@ if Env.on_windows?
|
|
132
146
|
}
|
133
147
|
end
|
134
148
|
|
135
|
-
# for quich rant testing
|
136
|
-
#plugin :Configure
|
137
|
-
|
138
|
-
# mainly for rant testing
|
139
|
-
#source 'rantmethods.rb'
|
140
|
-
|
141
149
|
# vim:ft=ruby:
|
data/doc/advanced.rdoc
CHANGED
@@ -47,6 +47,194 @@ any directory/file named "CVS" or ending in ~. Examples would be:
|
|
47
47
|
xy~
|
48
48
|
src/util.c~
|
49
49
|
|
50
|
+
=== More on selecting files with the glob operator
|
51
|
+
|
52
|
+
The sys[] operator actually returns a _filelist_ object, which behaves
|
53
|
+
similar to an array. There are many methods for filelist objects, here
|
54
|
+
is a brief overview:
|
55
|
+
|
56
|
+
# create a filelist containing all files in the current directory
|
57
|
+
# and in the src directory
|
58
|
+
fl = sys["*", "src/*"]
|
59
|
+
|
60
|
+
# remove all files from the list which end in .bak
|
61
|
+
fl.exclude "*.bak"
|
62
|
+
|
63
|
+
# add all .rb files in directories lib and test
|
64
|
+
fl.include "lib/*.rb", "test/*.rb"
|
65
|
+
|
66
|
+
# remove all files from the list which contain the path element
|
67
|
+
# "coverage" (e.g.: test/coverage/ lib/coverage/main.c)
|
68
|
+
fl.exclude_all "coverage"
|
69
|
+
|
70
|
+
# add a single file to the list
|
71
|
+
fl << "doc/README"
|
72
|
+
|
73
|
+
# get a new filelist containing only directories, fl isn't
|
74
|
+
# modified:
|
75
|
+
dirs = fl.select { |f| File.directory? f }
|
76
|
+
|
77
|
+
# create a manifest file
|
78
|
+
open("MANIFEST", "w") { |f| f.puts fl }
|
79
|
+
|
80
|
+
Additionally, you can use all methods available for an array. Lookup
|
81
|
+
docs with ri for array methods:
|
82
|
+
% ri Array
|
83
|
+
|
84
|
+
=== Cleaning up generated files
|
85
|
+
|
86
|
+
Use the +Clean+ generator in your Rantfiles:
|
87
|
+
import "clean"
|
88
|
+
|
89
|
+
file "junk" do
|
90
|
+
# create junk
|
91
|
+
end
|
92
|
+
|
93
|
+
# create a task called clean
|
94
|
+
desc "cleanup generated files"
|
95
|
+
gen Clean
|
96
|
+
|
97
|
+
# var[:clean] is a filelist object now
|
98
|
+
var[:clean] << "junk"
|
99
|
+
var[:clean].include "**/*.bak", "**/*.obj"
|
100
|
+
|
101
|
+
=== Let Rant cleanup for you
|
102
|
+
|
103
|
+
Use the +AutoClean+ generator which will remove all files generated by
|
104
|
+
any filetask (include those created by rules):
|
105
|
+
import "autoclean"
|
106
|
+
|
107
|
+
file "junk" do
|
108
|
+
# create junk
|
109
|
+
end
|
110
|
+
|
111
|
+
gen Rule, :o => :c do |t|
|
112
|
+
sys "cc -c -o #{t.name} #{t.source}"
|
113
|
+
end
|
114
|
+
|
115
|
+
desc "Cleanup generated files."
|
116
|
+
gen AutoClean, :clean
|
117
|
+
# The clean task automatically detects which files where created
|
118
|
+
# by our rule and the junk task.
|
119
|
+
# Additionally we can add files to remove to the variable with the
|
120
|
+
# same name as the AutoClean taskname (here: clean):
|
121
|
+
var[:clean].include "**/*.bak"
|
122
|
+
|
123
|
+
=== The DirectedRule generator
|
124
|
+
|
125
|
+
A directed rule is some sort of special rule. It searches for source
|
126
|
+
files in one or more given directories and produces file in one output
|
127
|
+
directory.
|
128
|
+
|
129
|
+
import "directedrule"
|
130
|
+
|
131
|
+
ro = gen DirectedRule, "obj" => sys["src_*"], :o => :c do |t|
|
132
|
+
sys "cc -c -o #{t.name} #{t.source}"
|
133
|
+
end
|
134
|
+
|
135
|
+
This rule produces a file task for targets in the obj/ directory
|
136
|
+
ending in `.o'. It looks for a source file in all directories starting
|
137
|
+
with `src_' and files ending in `.c'.
|
138
|
+
|
139
|
+
Practically, this means that it compiles the C files in src_x/, src_y,
|
140
|
+
... to object files which are placed in the obj/ directory.
|
141
|
+
|
142
|
+
Look in the doc/examples/directedrule directory of the Rant
|
143
|
+
distribution for a small example project.
|
144
|
+
|
145
|
+
=== Constraining variables
|
146
|
+
|
147
|
+
Rant allows you to constrain variables which are managed by the +var+
|
148
|
+
command (and thus can be set from the commandline):
|
149
|
+
|
150
|
+
var :count, 0..10
|
151
|
+
|
152
|
+
This initializes the variable +count+ to 0 and restricts it to the
|
153
|
+
integer range 0 to 10. Create a task to test it:
|
154
|
+
|
155
|
+
task :show_count do
|
156
|
+
puts var[:count]
|
157
|
+
end
|
158
|
+
|
159
|
+
And now try to set the count variable from the commandline:
|
160
|
+
|
161
|
+
% rant
|
162
|
+
0
|
163
|
+
% rant count=5
|
164
|
+
5
|
165
|
+
% rant count=-1
|
166
|
+
rant: [ERROR] in file `/home/stefan/tmp/Rantfile', line 2:
|
167
|
+
"-1" doesn't match constraint: integer 0..10
|
168
|
+
rant aborted!
|
169
|
+
% rant count=100
|
170
|
+
rant: [ERROR] in file `/home/stefan/tmp/Rantfile', line 2:
|
171
|
+
"100" doesn't match constraint: integer 0..10
|
172
|
+
rant aborted!
|
173
|
+
|
174
|
+
Other available constraints:
|
175
|
+
|
176
|
+
# variable str is ensured to be a string
|
177
|
+
var :str, :String
|
178
|
+
|
179
|
+
# variable b is a bool (always true or false)
|
180
|
+
# can be set to "yes", "no", "1", "0", "true", "false"
|
181
|
+
var :b, :Bool
|
182
|
+
|
183
|
+
=== The Action generator
|
184
|
+
|
185
|
+
Consider a C project. In some C source file, let's say config.h you
|
186
|
+
define the project version, e.g.:
|
187
|
+
#define VERSION 2.3
|
188
|
+
Many of your tools use this version number, so you have decided to
|
189
|
+
duplicate it in a file called +version+, which contains just a line
|
190
|
+
with the program version. On solution to automate the +version+ file
|
191
|
+
creation would be to write a file task:
|
192
|
+
file "version" => "config.h" do |t|
|
193
|
+
puts "updating version file"
|
194
|
+
open("w", t.name) { |f| f.puts(extract_config_version()) }
|
195
|
+
end
|
196
|
+
and make all other tasks that need this version dependent on it. But
|
197
|
+
this can get very tedious if you have many tasks that need this
|
198
|
+
version file. Another solution is to just run the task every time the
|
199
|
+
Rantfile is sourced. This can be achieved by placing the following
|
200
|
+
statement after the "version" task:
|
201
|
+
rac.build "version"
|
202
|
+
This tells rant to immediately invoke all tasks that are required to
|
203
|
+
build the version file. But imagine your users just want to see the
|
204
|
+
list of available tasks:
|
205
|
+
% rant --tasks
|
206
|
+
updating version file
|
207
|
+
rant foo # build foo program
|
208
|
+
rant lib # build libfoo.so
|
209
|
+
rant clean # remove generated files
|
210
|
+
Hmm, we really didn't need the version to show our users the available
|
211
|
+
tasks. To avoid this, wrap such code in an Action:
|
212
|
+
file "version" => "config.h" do |t|
|
213
|
+
puts "updating version file"
|
214
|
+
open("w", t.name) { |f| f.puts(extract_config_version()) }
|
215
|
+
end
|
216
|
+
|
217
|
+
gen Action do
|
218
|
+
rac.build "version"
|
219
|
+
end
|
220
|
+
And now on a clean source base:
|
221
|
+
% rant --tasks
|
222
|
+
rant foo # build foo program
|
223
|
+
rant lib # build libfoo.so
|
224
|
+
rant clean # remove generated files
|
225
|
+
OK. Didn't confuse our users! Run any task:
|
226
|
+
% rant foo
|
227
|
+
updating version file
|
228
|
+
cc -o foo foo.c
|
229
|
+
This means, Action blocks are executed whenever we actually want to
|
230
|
+
build something, not just extract information from our Rantfile. It is
|
231
|
+
recommended to wrap any code that has effects on the environment
|
232
|
+
(mainly the file system) inside an Action block instead of embedding
|
233
|
+
it plain in the Rantfile.
|
234
|
+
|
235
|
+
An Action block also won't be run when our Rantfile is read by
|
236
|
+
rant-import.
|
237
|
+
|
50
238
|
== See also
|
51
239
|
|
52
240
|
Rantfile basics::
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
import %w(directedrule autoclean)
|
3
|
+
|
4
|
+
desc "Build foo."
|
5
|
+
file :foo => "obj/libfoo.a" do |t|
|
6
|
+
sys "cc -o #{t.name} #{t.source}"
|
7
|
+
end
|
8
|
+
|
9
|
+
gen Directory, "obj"
|
10
|
+
|
11
|
+
ro = gen DirectedRule, "obj" => sys["src_*"], :o => :c do |t|
|
12
|
+
rac.build "obj"
|
13
|
+
sys "cc -c -o #{t.name} #{t.source}"
|
14
|
+
end
|
15
|
+
|
16
|
+
file "obj/libfoo.a" => ro.candidates do |t|
|
17
|
+
sys "ar cr #{t.name} #{t.prerequisites.arglist}"
|
18
|
+
sys "ranlib #{t.name}"
|
19
|
+
end
|
20
|
+
|
21
|
+
gen AutoClean, :clean
|
22
|
+
|
23
|
+
# vim: ft=ruby
|
File without changes
|
File without changes
|
data/doc/jamis.rb
ADDED
@@ -0,0 +1,590 @@
|
|
1
|
+
module RDoc
|
2
|
+
module Page
|
3
|
+
|
4
|
+
FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif"
|
5
|
+
|
6
|
+
STYLE = <<CSS
|
7
|
+
a {
|
8
|
+
color: #00F;
|
9
|
+
text-decoration: none;
|
10
|
+
}
|
11
|
+
|
12
|
+
a:hover {
|
13
|
+
color: #77F;
|
14
|
+
text-decoration: underline;
|
15
|
+
}
|
16
|
+
|
17
|
+
body, td, p {
|
18
|
+
font-family: %fonts%;
|
19
|
+
background: #FFF;
|
20
|
+
color: #000;
|
21
|
+
margin: 0px;
|
22
|
+
font-size: small;
|
23
|
+
}
|
24
|
+
|
25
|
+
#content {
|
26
|
+
margin: 2em;
|
27
|
+
}
|
28
|
+
|
29
|
+
#description p {
|
30
|
+
margin-bottom: 0.5em;
|
31
|
+
}
|
32
|
+
|
33
|
+
.sectiontitle {
|
34
|
+
margin-top: 1em;
|
35
|
+
margin-bottom: 1em;
|
36
|
+
padding: 0.5em;
|
37
|
+
padding-left: 2em;
|
38
|
+
background: #005;
|
39
|
+
color: #FFF;
|
40
|
+
font-weight: bold;
|
41
|
+
border: 1px dotted black;
|
42
|
+
}
|
43
|
+
|
44
|
+
.attr-rw {
|
45
|
+
padding-left: 1em;
|
46
|
+
padding-right: 1em;
|
47
|
+
text-align: center;
|
48
|
+
color: #055;
|
49
|
+
}
|
50
|
+
|
51
|
+
.attr-name {
|
52
|
+
font-weight: bold;
|
53
|
+
}
|
54
|
+
|
55
|
+
.attr-desc {
|
56
|
+
}
|
57
|
+
|
58
|
+
.attr-value {
|
59
|
+
font-family: monospace;
|
60
|
+
}
|
61
|
+
|
62
|
+
.file-title-prefix {
|
63
|
+
font-size: large;
|
64
|
+
}
|
65
|
+
|
66
|
+
.file-title {
|
67
|
+
font-size: large;
|
68
|
+
font-weight: bold;
|
69
|
+
background: #005;
|
70
|
+
color: #FFF;
|
71
|
+
}
|
72
|
+
|
73
|
+
.banner {
|
74
|
+
background: #005;
|
75
|
+
color: #FFF;
|
76
|
+
border: 1px solid black;
|
77
|
+
padding: 1em;
|
78
|
+
}
|
79
|
+
|
80
|
+
.banner td {
|
81
|
+
background: transparent;
|
82
|
+
color: #FFF;
|
83
|
+
}
|
84
|
+
|
85
|
+
h1 a, h2 a, .sectiontitle a, .banner a {
|
86
|
+
color: #FF0;
|
87
|
+
}
|
88
|
+
|
89
|
+
h1 a:hover, h2 a:hover, .sectiontitle a:hover, .banner a:hover {
|
90
|
+
color: #FF7;
|
91
|
+
}
|
92
|
+
|
93
|
+
.dyn-source {
|
94
|
+
display: none;
|
95
|
+
background: #FFE;
|
96
|
+
color: #000;
|
97
|
+
border: 1px dotted black;
|
98
|
+
margin: 0.5em 2em 0.5em 2em;
|
99
|
+
padding: 0.5em;
|
100
|
+
}
|
101
|
+
|
102
|
+
.dyn-source .cmt {
|
103
|
+
color: #00F;
|
104
|
+
font-style: italic;
|
105
|
+
}
|
106
|
+
|
107
|
+
.dyn-source .kw {
|
108
|
+
color: #070;
|
109
|
+
font-weight: bold;
|
110
|
+
}
|
111
|
+
|
112
|
+
.method {
|
113
|
+
margin-left: 1em;
|
114
|
+
margin-right: 1em;
|
115
|
+
margin-bottom: 1em;
|
116
|
+
}
|
117
|
+
|
118
|
+
.description pre {
|
119
|
+
padding: 0.5em;
|
120
|
+
border: 1px dotted black;
|
121
|
+
background: #FFE;
|
122
|
+
}
|
123
|
+
|
124
|
+
.method .title {
|
125
|
+
font-family: monospace;
|
126
|
+
font-size: large;
|
127
|
+
border-bottom: 1px dashed black;
|
128
|
+
margin-bottom: 0.3em;
|
129
|
+
padding-bottom: 0.1em;
|
130
|
+
}
|
131
|
+
|
132
|
+
.method .description, .method .sourcecode {
|
133
|
+
margin-left: 1em;
|
134
|
+
}
|
135
|
+
|
136
|
+
.description p, .sourcecode p {
|
137
|
+
margin-bottom: 0.5em;
|
138
|
+
}
|
139
|
+
|
140
|
+
.method .sourcecode p.source-link {
|
141
|
+
text-indent: 0em;
|
142
|
+
margin-top: 0.5em;
|
143
|
+
}
|
144
|
+
|
145
|
+
.method .aka {
|
146
|
+
margin-top: 0.3em;
|
147
|
+
margin-left: 1em;
|
148
|
+
font-style: italic;
|
149
|
+
text-indent: 2em;
|
150
|
+
}
|
151
|
+
|
152
|
+
h1 {
|
153
|
+
padding: 1em;
|
154
|
+
border: 1px solid black;
|
155
|
+
font-size: x-large;
|
156
|
+
font-weight: bold;
|
157
|
+
color: #FFF;
|
158
|
+
background: #007;
|
159
|
+
}
|
160
|
+
|
161
|
+
h2 {
|
162
|
+
padding: 0.5em 1em 0.5em 1em;
|
163
|
+
border: 1px solid black;
|
164
|
+
font-size: large;
|
165
|
+
font-weight: bold;
|
166
|
+
color: #FFF;
|
167
|
+
background: #009;
|
168
|
+
}
|
169
|
+
|
170
|
+
h3, h4, h5, h6 {
|
171
|
+
padding: 0.2em 1em 0.2em 1em;
|
172
|
+
border: 1px dashed black;
|
173
|
+
color: #000;
|
174
|
+
background: #AAF;
|
175
|
+
}
|
176
|
+
|
177
|
+
.sourcecode > pre {
|
178
|
+
padding: 0.5em;
|
179
|
+
border: 1px dotted black;
|
180
|
+
background: #FFE;
|
181
|
+
}
|
182
|
+
|
183
|
+
CSS
|
184
|
+
|
185
|
+
XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
|
186
|
+
<!DOCTYPE html
|
187
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
188
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
189
|
+
}
|
190
|
+
|
191
|
+
HEADER = XHTML_PREAMBLE + <<ENDHEADER
|
192
|
+
<html>
|
193
|
+
<head>
|
194
|
+
<title>%title%</title>
|
195
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
|
196
|
+
<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
|
197
|
+
|
198
|
+
<script language="JavaScript" type="text/javascript">
|
199
|
+
// <![CDATA[
|
200
|
+
|
201
|
+
function toggleSource( id )
|
202
|
+
{
|
203
|
+
var elem
|
204
|
+
var link
|
205
|
+
|
206
|
+
if( document.getElementById )
|
207
|
+
{
|
208
|
+
elem = document.getElementById( id )
|
209
|
+
link = document.getElementById( "l_" + id )
|
210
|
+
}
|
211
|
+
else if ( document.all )
|
212
|
+
{
|
213
|
+
elem = eval( "document.all." + id )
|
214
|
+
link = eval( "document.all.l_" + id )
|
215
|
+
}
|
216
|
+
else
|
217
|
+
return false;
|
218
|
+
|
219
|
+
if( elem.style.display == "block" )
|
220
|
+
{
|
221
|
+
elem.style.display = "none"
|
222
|
+
link.innerHTML = "show source"
|
223
|
+
}
|
224
|
+
else
|
225
|
+
{
|
226
|
+
elem.style.display = "block"
|
227
|
+
link.innerHTML = "hide source"
|
228
|
+
}
|
229
|
+
}
|
230
|
+
|
231
|
+
function openCode( url )
|
232
|
+
{
|
233
|
+
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
|
234
|
+
}
|
235
|
+
// ]]>
|
236
|
+
</script>
|
237
|
+
</head>
|
238
|
+
|
239
|
+
<body>
|
240
|
+
ENDHEADER
|
241
|
+
|
242
|
+
FILE_PAGE = <<HTML
|
243
|
+
<table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'>
|
244
|
+
<tr><td>
|
245
|
+
<table width="100%" border='0' cellpadding='0' cellspacing='0'><tr>
|
246
|
+
<td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />%short_name%</td>
|
247
|
+
<td align="right">
|
248
|
+
<table border='0' cellspacing="0" cellpadding="2">
|
249
|
+
<tr>
|
250
|
+
<td>Path:</td>
|
251
|
+
<td>%full_path%
|
252
|
+
IF:cvsurl
|
253
|
+
(<a href="%cvsurl%">CVS</a>)
|
254
|
+
ENDIF:cvsurl
|
255
|
+
</td>
|
256
|
+
</tr>
|
257
|
+
<tr>
|
258
|
+
<td>Modified:</td>
|
259
|
+
<td>%dtm_modified%</td>
|
260
|
+
</tr>
|
261
|
+
</table>
|
262
|
+
</td></tr>
|
263
|
+
</table>
|
264
|
+
</td></tr>
|
265
|
+
</table><br>
|
266
|
+
HTML
|
267
|
+
|
268
|
+
###################################################################
|
269
|
+
|
270
|
+
CLASS_PAGE = <<HTML
|
271
|
+
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
272
|
+
<td class="file-title"><span class="file-title-prefix">%classmod%</span><br />%full_name%</td>
|
273
|
+
<td align="right">
|
274
|
+
<table cellspacing=0 cellpadding=2>
|
275
|
+
<tr valign="top">
|
276
|
+
<td>In:</td>
|
277
|
+
<td>
|
278
|
+
START:infiles
|
279
|
+
HREF:full_path_url:full_path:
|
280
|
+
IF:cvsurl
|
281
|
+
(<a href="%cvsurl%">CVS</a>)
|
282
|
+
ENDIF:cvsurl
|
283
|
+
END:infiles
|
284
|
+
</td>
|
285
|
+
</tr>
|
286
|
+
IF:parent
|
287
|
+
<tr>
|
288
|
+
<td>Parent:</td>
|
289
|
+
<td>
|
290
|
+
IF:par_url
|
291
|
+
<a href="%par_url%">
|
292
|
+
ENDIF:par_url
|
293
|
+
%parent%
|
294
|
+
IF:par_url
|
295
|
+
</a>
|
296
|
+
ENDIF:par_url
|
297
|
+
</td>
|
298
|
+
</tr>
|
299
|
+
ENDIF:parent
|
300
|
+
</table>
|
301
|
+
</td>
|
302
|
+
</tr>
|
303
|
+
</table>
|
304
|
+
HTML
|
305
|
+
|
306
|
+
###################################################################
|
307
|
+
|
308
|
+
METHOD_LIST = <<HTML
|
309
|
+
<div id="content">
|
310
|
+
IF:diagram
|
311
|
+
<table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center">
|
312
|
+
%diagram%
|
313
|
+
</td></tr></table>
|
314
|
+
ENDIF:diagram
|
315
|
+
|
316
|
+
IF:description
|
317
|
+
<div class="description">%description%</div>
|
318
|
+
ENDIF:description
|
319
|
+
|
320
|
+
IF:requires
|
321
|
+
<div class="sectiontitle">Required Files</div>
|
322
|
+
<ul>
|
323
|
+
START:requires
|
324
|
+
<li>HREF:aref:name:</li>
|
325
|
+
END:requires
|
326
|
+
</ul>
|
327
|
+
ENDIF:requires
|
328
|
+
|
329
|
+
IF:toc
|
330
|
+
<div class="sectiontitle">Contents</div>
|
331
|
+
<ul>
|
332
|
+
START:toc
|
333
|
+
<li><a href="#%href%">%secname%</a></li>
|
334
|
+
END:toc
|
335
|
+
</ul>
|
336
|
+
ENDIF:toc
|
337
|
+
|
338
|
+
IF:methods
|
339
|
+
<div class="sectiontitle">Methods</div>
|
340
|
+
<ul>
|
341
|
+
START:methods
|
342
|
+
<li>HREF:aref:name:</li>
|
343
|
+
END:methods
|
344
|
+
</ul>
|
345
|
+
ENDIF:methods
|
346
|
+
|
347
|
+
IF:includes
|
348
|
+
<div class="sectiontitle">Included Modules</div>
|
349
|
+
<ul>
|
350
|
+
START:includes
|
351
|
+
<li>HREF:aref:name:</li>
|
352
|
+
END:includes
|
353
|
+
</ul>
|
354
|
+
ENDIF:includes
|
355
|
+
|
356
|
+
START:sections
|
357
|
+
IF:sectitle
|
358
|
+
<div class="sectiontitle"><a nem="%secsequence%">%sectitle%</a></div>
|
359
|
+
IF:seccomment
|
360
|
+
<div class="description">
|
361
|
+
%seccomment%
|
362
|
+
</div>
|
363
|
+
ENDIF:seccomment
|
364
|
+
ENDIF:sectitle
|
365
|
+
|
366
|
+
IF:classlist
|
367
|
+
<div class="sectiontitle">Classes and Modules</div>
|
368
|
+
%classlist%
|
369
|
+
ENDIF:classlist
|
370
|
+
|
371
|
+
IF:constants
|
372
|
+
<div class="sectiontitle">Constants</div>
|
373
|
+
<table border='0' cellpadding='5'>
|
374
|
+
START:constants
|
375
|
+
<tr valign='top'>
|
376
|
+
<td class="attr-name">%name%</td>
|
377
|
+
<td>=</td>
|
378
|
+
<td class="attr-value">%value%</td>
|
379
|
+
</tr>
|
380
|
+
IF:desc
|
381
|
+
<tr valign='top'>
|
382
|
+
<td> </td>
|
383
|
+
<td colspan="2" class="attr-desc">%desc%</td>
|
384
|
+
</tr>
|
385
|
+
ENDIF:desc
|
386
|
+
END:constants
|
387
|
+
</table>
|
388
|
+
ENDIF:constants
|
389
|
+
|
390
|
+
IF:attributes
|
391
|
+
<div class="sectiontitle">Attributes</div>
|
392
|
+
<table border='0' cellpadding='5'>
|
393
|
+
START:attributes
|
394
|
+
<tr valign='top'>
|
395
|
+
<td class='attr-rw'>
|
396
|
+
IF:rw
|
397
|
+
[%rw%]
|
398
|
+
ENDIF:rw
|
399
|
+
</td>
|
400
|
+
<td class='attr-name'>%name%</td>
|
401
|
+
<td class='attr-desc'>%a_desc%</td>
|
402
|
+
</tr>
|
403
|
+
END:attributes
|
404
|
+
</table>
|
405
|
+
ENDIF:attributes
|
406
|
+
|
407
|
+
IF:method_list
|
408
|
+
START:method_list
|
409
|
+
IF:methods
|
410
|
+
<div class="sectiontitle">%type% %category% methods</div>
|
411
|
+
START:methods
|
412
|
+
<div class="method">
|
413
|
+
<div class="title">
|
414
|
+
IF:callseq
|
415
|
+
<a name="%aref%"></a><b>%callseq%</b>
|
416
|
+
ENDIF:callseq
|
417
|
+
IFNOT:callseq
|
418
|
+
<a name="%aref%"></a><b>%name%</b>%params%
|
419
|
+
ENDIF:callseq
|
420
|
+
IF:codeurl
|
421
|
+
[ <a href="javascript:openCode('%codeurl%')">source</a> ]
|
422
|
+
ENDIF:codeurl
|
423
|
+
</div>
|
424
|
+
IF:m_desc
|
425
|
+
<div class="description">
|
426
|
+
%m_desc%
|
427
|
+
</div>
|
428
|
+
ENDIF:m_desc
|
429
|
+
IF:aka
|
430
|
+
<div class="aka">
|
431
|
+
This method is also aliased as
|
432
|
+
START:aka
|
433
|
+
<a href="%aref%">%name%</a>
|
434
|
+
END:aka
|
435
|
+
</div>
|
436
|
+
ENDIF:aka
|
437
|
+
IF:sourcecode
|
438
|
+
<div class="sourcecode">
|
439
|
+
<p class="source-link">[ <a href="javascript:toggleSource('%aref%_source')" id="l_%aref%_source">show source</a> ]</p>
|
440
|
+
<div id="%aref%_source" class="dyn-source">
|
441
|
+
<pre>
|
442
|
+
%sourcecode%
|
443
|
+
</pre>
|
444
|
+
</div>
|
445
|
+
</div>
|
446
|
+
ENDIF:sourcecode
|
447
|
+
</div>
|
448
|
+
END:methods
|
449
|
+
ENDIF:methods
|
450
|
+
END:method_list
|
451
|
+
ENDIF:method_list
|
452
|
+
END:sections
|
453
|
+
</div>
|
454
|
+
HTML
|
455
|
+
|
456
|
+
FOOTER = <<ENDFOOTER
|
457
|
+
</body>
|
458
|
+
</html>
|
459
|
+
ENDFOOTER
|
460
|
+
|
461
|
+
BODY = HEADER + <<ENDBODY
|
462
|
+
!INCLUDE! <!-- banner header -->
|
463
|
+
|
464
|
+
<div id="bodyContent">
|
465
|
+
#{METHOD_LIST}
|
466
|
+
</div>
|
467
|
+
|
468
|
+
#{FOOTER}
|
469
|
+
ENDBODY
|
470
|
+
|
471
|
+
########################## Source code ##########################
|
472
|
+
|
473
|
+
SRC_PAGE = XHTML_PREAMBLE + <<HTML
|
474
|
+
<html>
|
475
|
+
<head><title>%title%</title>
|
476
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
|
477
|
+
<style>
|
478
|
+
.ruby-comment { color: green; font-style: italic }
|
479
|
+
.ruby-constant { color: #4433aa; font-weight: bold; }
|
480
|
+
.ruby-identifier { color: #222222; }
|
481
|
+
.ruby-ivar { color: #2233dd; }
|
482
|
+
.ruby-keyword { color: #3333FF; font-weight: bold }
|
483
|
+
.ruby-node { color: #777777; }
|
484
|
+
.ruby-operator { color: #111111; }
|
485
|
+
.ruby-regexp { color: #662222; }
|
486
|
+
.ruby-value { color: #662222; font-style: italic }
|
487
|
+
.kw { color: #3333FF; font-weight: bold }
|
488
|
+
.cmt { color: green; font-style: italic }
|
489
|
+
.str { color: #662222; font-style: italic }
|
490
|
+
.re { color: #662222; }
|
491
|
+
</style>
|
492
|
+
</head>
|
493
|
+
<body bgcolor="white">
|
494
|
+
<pre>%code%</pre>
|
495
|
+
</body>
|
496
|
+
</html>
|
497
|
+
HTML
|
498
|
+
|
499
|
+
########################## Index ################################
|
500
|
+
|
501
|
+
FR_INDEX_BODY = <<HTML
|
502
|
+
!INCLUDE!
|
503
|
+
HTML
|
504
|
+
|
505
|
+
FILE_INDEX = XHTML_PREAMBLE + <<HTML
|
506
|
+
<html>
|
507
|
+
<head>
|
508
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
|
509
|
+
<style>
|
510
|
+
<!--
|
511
|
+
body {
|
512
|
+
background-color: #EEE;
|
513
|
+
font-family: #{FONTS};
|
514
|
+
color: #000;
|
515
|
+
margin: 0px;
|
516
|
+
}
|
517
|
+
.banner {
|
518
|
+
background: #005;
|
519
|
+
color: #FFF;
|
520
|
+
padding: 0.2em;
|
521
|
+
font-size: small;
|
522
|
+
font-weight: bold;
|
523
|
+
text-align: center;
|
524
|
+
}
|
525
|
+
.entries {
|
526
|
+
margin: 0.25em 1em 0 1em;
|
527
|
+
font-size: x-small;
|
528
|
+
}
|
529
|
+
a {
|
530
|
+
color: #00F;
|
531
|
+
text-decoration: none;
|
532
|
+
white-space: nowrap;
|
533
|
+
}
|
534
|
+
a:hover {
|
535
|
+
color: #77F;
|
536
|
+
text-decoration: underline;
|
537
|
+
}
|
538
|
+
-->
|
539
|
+
</style>
|
540
|
+
<base target="docwin">
|
541
|
+
</head>
|
542
|
+
<body>
|
543
|
+
<div class="banner">%list_title%</div>
|
544
|
+
<div class="entries">
|
545
|
+
START:entries
|
546
|
+
<a href="%href%">%name%</a><br>
|
547
|
+
END:entries
|
548
|
+
</div>
|
549
|
+
</body></html>
|
550
|
+
HTML
|
551
|
+
|
552
|
+
CLASS_INDEX = FILE_INDEX
|
553
|
+
METHOD_INDEX = FILE_INDEX
|
554
|
+
|
555
|
+
INDEX = XHTML_PREAMBLE + <<HTML
|
556
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
557
|
+
<head>
|
558
|
+
<title>%title%</title>
|
559
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
|
560
|
+
</head>
|
561
|
+
|
562
|
+
<frameset cols="20%,*">
|
563
|
+
<frameset rows="15%,35%,50%">
|
564
|
+
<frame src="fr_file_index.html" title="Files" name="Files" />
|
565
|
+
<frame src="fr_class_index.html" name="Classes" />
|
566
|
+
<frame src="fr_method_index.html" name="Methods" />
|
567
|
+
</frameset>
|
568
|
+
IF:inline_source
|
569
|
+
<frame src="%initial_page%" name="docwin">
|
570
|
+
ENDIF:inline_source
|
571
|
+
IFNOT:inline_source
|
572
|
+
<frameset rows="80%,20%">
|
573
|
+
<frame src="%initial_page%" name="docwin">
|
574
|
+
<frame src="blank.html" name="source">
|
575
|
+
</frameset>
|
576
|
+
ENDIF:inline_source
|
577
|
+
<noframes>
|
578
|
+
<body bgcolor="white">
|
579
|
+
Click <a href="html/index.html">here</a> for a non-frames
|
580
|
+
version of this page.
|
581
|
+
</body>
|
582
|
+
</noframes>
|
583
|
+
</frameset>
|
584
|
+
|
585
|
+
</html>
|
586
|
+
HTML
|
587
|
+
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|