builder 3.1.4 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGES +18 -0
- data/{README.rdoc → README.md} +59 -26
- data/Rakefile +18 -13
- data/builder.blurb +27 -0
- data/builder.gemspec +45 -0
- data/doc/jamis.rb +592 -0
- data/lib/blankslate.rb +1 -0
- data/lib/builder.rb +1 -0
- data/lib/builder/blankslate.rb +1 -0
- data/lib/builder/version.rb +2 -1
- data/lib/builder/xchar.rb +5 -4
- data/lib/builder/xmlbase.rb +20 -12
- data/lib/builder/xmlevents.rb +1 -0
- data/lib/builder/xmlmarkup.rb +32 -21
- data/rakelib/publish.rake +21 -0
- data/rakelib/tags.rake +63 -0
- data/rakelib/testing.rake +8 -0
- data/test/helper.rb +13 -0
- data/test/performance.rb +3 -1
- data/test/preload.rb +1 -0
- data/test/test_blankslate.rb +4 -13
- data/test/test_eventbuilder.rb +4 -3
- data/test/test_markupbuilder.rb +57 -18
- data/test/test_method_caching.rb +5 -4
- data/test/test_namecollision.rb +3 -2
- data/test/test_xchar.rb +17 -9
- metadata +30 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 386ed394ff60c6aff710d3304b69fac8ead0e6c89b80f80691b434fcb772290f
|
4
|
+
data.tar.gz: 42ccc387ac8ba03c586bf3b280977292418e96031e859ea764808a8d132e5654
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 76c76d003cc4198733b46dfb9078d130a298c90a5fda954b521c965ae91c891212be43808b29b0d55824b4f3cdfa96289ea2267a57425713725a3ef30b930d83
|
7
|
+
data.tar.gz: dba82177c0a2ef38fdafbe1bb875487ad8e112b1f298c06a4a6c001c267172bd1043245229f45839bcdd64e0f2cc8093f7a4d27a5839b65446926560b936463d
|
data/CHANGES
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
= Change Log
|
2
2
|
|
3
|
+
== Version 3.2.3 (2017-01-13)
|
4
|
+
|
5
|
+
* Support for Ruby 2.4
|
6
|
+
|
7
|
+
== Version 3.2.2 (2013-06-01
|
8
|
+
|
9
|
+
* Misc minor fixes
|
10
|
+
|
11
|
+
== Version 3.2.1 (2013-05-30)
|
12
|
+
|
13
|
+
* Travis & Rdoc fixes
|
14
|
+
|
15
|
+
== Version 3.2.0 (2013-02-23)
|
16
|
+
|
17
|
+
* Ruby 2.0 compatibility changes.
|
18
|
+
|
19
|
+
* Allow single quoted attributes.
|
20
|
+
|
3
21
|
== Version 3.1.0
|
4
22
|
|
5
23
|
* Included the to_xs arity patch needed for weird Rails compatibility
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,33 +1,35 @@
|
|
1
|
-
#
|
2
|
-
= Project: Builder
|
1
|
+
# Project: Builder
|
3
2
|
|
4
|
-
|
3
|
+
## Goal
|
5
4
|
|
6
5
|
Provide a simple way to create XML markup and data structures.
|
7
6
|
|
8
|
-
|
7
|
+
## Classes
|
9
8
|
|
10
|
-
Builder::XmlMarkup:: Generate XML markup
|
9
|
+
Builder::XmlMarkup:: Generate XML markup notation
|
11
10
|
Builder::XmlEvents:: Generate XML events (i.e. SAX-like)
|
12
11
|
|
13
|
-
|
12
|
+
**Notes:**
|
14
13
|
|
15
14
|
* An <tt>Builder::XmlTree</tt> class to generate XML tree
|
16
15
|
(i.e. DOM-like) structures is also planned, but not yet implemented.
|
17
16
|
Also, the events builder is currently lagging the markup builder in
|
18
17
|
features.
|
19
18
|
|
20
|
-
|
19
|
+
## Usage
|
21
20
|
|
21
|
+
```ruby
|
22
22
|
require 'rubygems'
|
23
23
|
require_gem 'builder', '~> 2.0'
|
24
24
|
|
25
25
|
builder = Builder::XmlMarkup.new
|
26
26
|
xml = builder.person { |b| b.name("Jim"); b.phone("555-1234") }
|
27
27
|
xml #=> <person><name>Jim</name><phone>555-1234</phone></person>
|
28
|
+
```
|
28
29
|
|
29
30
|
or
|
30
31
|
|
32
|
+
```ruby
|
31
33
|
require 'rubygems'
|
32
34
|
require_gem 'builder'
|
33
35
|
|
@@ -39,10 +41,11 @@ or
|
|
39
41
|
# <name>Jim</name>
|
40
42
|
# <phone>555-1234</phone>
|
41
43
|
# </person>
|
44
|
+
```
|
42
45
|
|
43
|
-
|
46
|
+
## Compatibility
|
44
47
|
|
45
|
-
|
48
|
+
### Version 2.0.0 Compatibility Changes
|
46
49
|
|
47
50
|
Version 2.0.0 introduces automatically escaped attribute values for
|
48
51
|
the first time. Versions prior to 2.0.0 did not insert escape
|
@@ -52,26 +55,28 @@ occasionally used by a small number of developers. Since strings
|
|
52
55
|
could always be explicitly escaped by hand, this was not a major
|
53
56
|
restriction in functionality.
|
54
57
|
|
55
|
-
However, it did
|
58
|
+
However, it did surprise most users of builder. Since the body text is
|
56
59
|
normally escaped, everybody expected the attribute values to be
|
57
60
|
escaped as well. Escaped attribute values were the number one support
|
58
61
|
request on the 1.x Builder series.
|
59
62
|
|
60
63
|
Starting with Builder version 2.0.0, all attribute values expressed as
|
61
64
|
strings will be processed and the appropriate characters will be
|
62
|
-
escaped (e.g. "&" will be
|
65
|
+
escaped (e.g. "&" will be translated to "&amp;"). Attribute values
|
63
66
|
that are expressed as Symbol values will not be processed for escaped
|
64
67
|
characters and will be unchanged in output. (Yes, this probably counts
|
65
68
|
as Symbol abuse, but the convention is convenient and flexible).
|
66
69
|
|
67
70
|
Example:
|
68
71
|
|
72
|
+
```ruby
|
69
73
|
xml = Builder::XmlMarkup.new
|
70
74
|
xml.sample(:escaped=>"This&That", :unescaped=>:"Here&There")
|
71
75
|
xml.target! =>
|
72
76
|
<sample escaped="This&That" unescaped="Here&There"/>
|
77
|
+
```
|
73
78
|
|
74
|
-
|
79
|
+
### Version 1.0.0 Compatibility Changes
|
75
80
|
|
76
81
|
Version 1.0.0 introduces some changes that are not backwards
|
77
82
|
compatible with earlier releases of builder. The main areas of
|
@@ -85,47 +90,59 @@ incompatibility are:
|
|
85
90
|
* Builder must now be an explicit target for markup tags. Instead of
|
86
91
|
writing
|
87
92
|
|
93
|
+
```ruby
|
88
94
|
xml_markup = Builder::XmlMarkup.new
|
89
95
|
xml_markup.div { strong("text") }
|
96
|
+
```
|
90
97
|
|
91
98
|
you need to write
|
92
99
|
|
100
|
+
```ruby
|
93
101
|
xml_markup = Builder::XmlMarkup.new
|
94
102
|
xml_markup.div { xml_markup.strong("text") }
|
103
|
+
```
|
95
104
|
|
96
105
|
* The builder object is passed as a parameter to all nested markup
|
97
106
|
blocks. This allows you to create a short alias for the builder
|
98
107
|
object that can be used within the block. For example, the previous
|
99
108
|
example can be written as:
|
100
109
|
|
110
|
+
```ruby
|
101
111
|
xml_markup = Builder::XmlMarkup.new
|
102
112
|
xml_markup.div { |xml| xml.strong("text") }
|
113
|
+
```
|
103
114
|
|
104
115
|
* If you have both a pre-1.0 and a post-1.0 gem of builder installed,
|
105
116
|
you can choose which version to use through the RubyGems
|
106
117
|
+require_gem+ facility.
|
107
118
|
|
119
|
+
```ruby
|
108
120
|
require_gem 'builder', "~> 0.0" # Gets the old version
|
109
121
|
require_gem 'builder', "~> 1.0" # Gets the new version
|
122
|
+
```
|
110
123
|
|
111
|
-
|
124
|
+
## Features
|
112
125
|
|
113
126
|
* XML Comments are supported ...
|
114
127
|
|
128
|
+
```ruby
|
115
129
|
xml_markup.comment! "This is a comment"
|
116
130
|
#=> <!-- This is a comment -->
|
131
|
+
```
|
117
132
|
|
118
133
|
* XML processing instructions are supported ...
|
119
134
|
|
135
|
+
```ruby
|
120
136
|
xml_markup.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
|
121
137
|
#=> <?xml version="1.0" encoding="UTF-8"?>
|
138
|
+
```
|
122
139
|
|
123
140
|
If the processing instruction is omitted, it defaults to "xml".
|
124
141
|
When the processing instruction is "xml", the defaults attributes
|
125
142
|
are:
|
126
143
|
|
127
|
-
<b>version</b
|
128
|
-
<b>encoding</b
|
144
|
+
<b>version</b>: 1.0
|
145
|
+
<b>encoding</b>: "UTF-8"
|
129
146
|
|
130
147
|
(NOTE: if the encoding is set to "UTF-8" and $KCODE is set to
|
131
148
|
"UTF8", then Builder will emit UTF-8 encoded strings rather than
|
@@ -133,8 +150,10 @@ incompatibility are:
|
|
133
150
|
|
134
151
|
* XML entity declarations are now supported to a small degree.
|
135
152
|
|
153
|
+
```ruby
|
136
154
|
xml_markup.declare! :DOCTYPE, :chapter, :SYSTEM, "../dtds/chapter.dtd"
|
137
155
|
#=> <!DOCTYPE chapter SYSTEM "../dtds/chapter.dtd">
|
156
|
+
```
|
138
157
|
|
139
158
|
The parameters to a declare! method must be either symbols or
|
140
159
|
strings. Symbols are inserted without quotes, and strings are
|
@@ -142,16 +161,19 @@ incompatibility are:
|
|
142
161
|
not allowed.
|
143
162
|
|
144
163
|
If you need to have an argument to declare! be inserted without
|
145
|
-
quotes, but the
|
164
|
+
quotes, but the argument does not conform to the typical Ruby
|
146
165
|
syntax for symbols, then use the :"string" form to specify a symbol.
|
147
166
|
|
148
167
|
For example:
|
149
168
|
|
169
|
+
```ruby
|
150
170
|
xml_markup.declare! :ELEMENT, :chapter, :"(title,para+)"
|
151
171
|
#=> <!ELEMENT chapter (title,para+)>
|
172
|
+
```
|
152
173
|
|
153
174
|
Nested entity declarations are allowed. For example:
|
154
175
|
|
176
|
+
```ruby
|
155
177
|
@xml_markup.declare! :DOCTYPE, :chapter do |x|
|
156
178
|
x.declare! :ELEMENT, :chapter, :"(title,para+)"
|
157
179
|
x.declare! :ELEMENT, :title, :"(#PCDATA)"
|
@@ -165,13 +187,16 @@ incompatibility are:
|
|
165
187
|
<!ELEMENT title (#PCDATA)>
|
166
188
|
<!ELEMENT para (#PCDATA)>
|
167
189
|
]>
|
190
|
+
```
|
168
191
|
|
169
192
|
* Some support for XML namespaces is now available. If the first
|
170
193
|
argument to a tag call is a symbol, it will be joined to the tag to
|
171
194
|
produce a namespace:tag combination. It is easier to show this than
|
172
195
|
describe it.
|
173
196
|
|
197
|
+
```ruby
|
174
198
|
xml.SOAP :Envelope do ... end
|
199
|
+
```
|
175
200
|
|
176
201
|
Just put a space before the colon in a namespace to produce the
|
177
202
|
right form for builder (e.g. "<tt>SOAP:Envelope</tt>" =>
|
@@ -181,7 +206,7 @@ incompatibility are:
|
|
181
206
|
Builder (<b>NOTE:</b> this is _new_ behavior as of version 2.0).
|
182
207
|
|
183
208
|
However, occasionally you need to use entities in attribute values.
|
184
|
-
Using a
|
209
|
+
Using a symbol (rather than a string) for an attribute value will
|
185
210
|
cause Builder to not run its quoting/escaping algorithm on that
|
186
211
|
particular value.
|
187
212
|
|
@@ -190,10 +215,12 @@ incompatibility are:
|
|
190
215
|
|
191
216
|
Example:
|
192
217
|
|
218
|
+
```ruby
|
193
219
|
xml = Builder::XmlMarkup.new
|
194
220
|
xml.sample(:escaped=>"This&That", :unescaped=>:"Here&There")
|
195
221
|
xml.target! =>
|
196
222
|
<sample escaped="This&That" unescaped="Here&There"/>
|
223
|
+
```
|
197
224
|
|
198
225
|
* UTF-8 Support
|
199
226
|
|
@@ -204,22 +231,28 @@ incompatibility are:
|
|
204
231
|
encoding is set to "UTF-8" and that the $KCODE variable is set to
|
205
232
|
"UTF8".
|
206
233
|
|
234
|
+
```ruby
|
207
235
|
$KCODE = 'UTF8'
|
208
236
|
xml = Builder::Markup.new
|
209
237
|
xml.instruct!(:xml, :encoding => "UTF-8")
|
210
238
|
xml.sample("Iñtërnâtiônàl")
|
211
239
|
xml.target! =>
|
212
240
|
"<sample>Iñtërnâtiônàl</sample>"
|
241
|
+
```
|
213
242
|
|
214
|
-
|
243
|
+
## Links
|
215
244
|
|
216
|
-
|
217
|
-
|
218
|
-
|
245
|
+
| Description | Link |
|
246
|
+
| :----: | :----: |
|
247
|
+
| Documents | http://builder.rubyforge.org/ |
|
248
|
+
| Github Clone | git://github.com/tenderlove/builder.git |
|
249
|
+
| Issue / Bug Reports | https://github.com/tenderlove/builder/issues?state=open |
|
219
250
|
|
220
|
-
|
251
|
+
## Contact
|
221
252
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
253
|
+
| Description | Value |
|
254
|
+
| :----: | :----: |
|
255
|
+
| Author | Jim Weirich |
|
256
|
+
| Email | jim.weirich@gmail.com |
|
257
|
+
| Home Page | http://onestepback.org |
|
258
|
+
| License | MIT Licence (http://www.opensource.org/licenses/mit-license.html) |
|
data/Rakefile
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Rakefile for rake -*- ruby -*-
|
2
3
|
|
3
4
|
# Copyright 2004, 2005, 2006 by Jim Weirich (jim@weirichhouse.org).
|
@@ -9,10 +10,10 @@
|
|
9
10
|
|
10
11
|
require 'rake/clean'
|
11
12
|
require 'rake/testtask'
|
12
|
-
require 'rdoc/task'
|
13
13
|
begin
|
14
14
|
require 'rubygems'
|
15
15
|
require 'rubygems/package_task'
|
16
|
+
require 'rdoc/task'
|
16
17
|
rescue Exception
|
17
18
|
nil
|
18
19
|
end
|
@@ -21,7 +22,7 @@ require './lib/builder/version'
|
|
21
22
|
|
22
23
|
# Determine the current version of the software
|
23
24
|
|
24
|
-
CLOBBER.include('pkg')
|
25
|
+
CLOBBER.include('pkg', 'html')
|
25
26
|
CLEAN.include('pkg/builder-*').include('pkg/blankslate-*').exclude('pkg/*.gem')
|
26
27
|
|
27
28
|
PKG_VERSION = Builder::VERSION
|
@@ -43,28 +44,34 @@ task :tu => [:test_units]
|
|
43
44
|
|
44
45
|
Rake::TestTask.new("test_units") do |t|
|
45
46
|
t.test_files = FileList['test/test*.rb']
|
46
|
-
t.libs << "."
|
47
|
+
t.libs << "." << "test"
|
47
48
|
t.verbose = false
|
48
49
|
end
|
49
50
|
|
50
51
|
# Create a task to build the RDOC documentation tree.
|
51
52
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
if defined?(RDoc)
|
54
|
+
rd = RDoc::Task.new("rdoc") { |rdoc|
|
55
|
+
rdoc.rdoc_dir = 'html'
|
56
|
+
rdoc.title = "Builder for Markup"
|
57
|
+
rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README.rdoc'
|
58
|
+
rdoc.rdoc_files.include('lib/**/*.rb', '[A-Z]*', 'doc/**/*.rdoc').exclude("TAGS")
|
59
|
+
rdoc.template = 'doc/jamis.rb'
|
60
|
+
}
|
61
|
+
else
|
62
|
+
rd = Struct.new(:rdoc_files).new([])
|
63
|
+
end
|
59
64
|
|
60
65
|
# ====================================================================
|
61
66
|
# Create a task that will package the Rake software into distributable
|
62
67
|
# gem files.
|
63
68
|
|
64
69
|
PKG_FILES = FileList[
|
70
|
+
'[A-Z]*',
|
71
|
+
'doc/**/*',
|
65
72
|
'lib/**/*.rb',
|
66
73
|
'test/**/*.rb',
|
67
|
-
'
|
74
|
+
'rakelib/**/*'
|
68
75
|
]
|
69
76
|
PKG_FILES.exclude('test/test_cssbuilder.rb')
|
70
77
|
PKG_FILES.exclude('lib/builder/css.rb')
|
@@ -98,7 +105,6 @@ simple to do. Currently the following builder objects are supported:
|
|
98
105
|
|
99
106
|
s.test_files = PKG_FILES.select { |fn| fn =~ /^test\/test/ }
|
100
107
|
|
101
|
-
s.has_rdoc = true
|
102
108
|
s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
|
103
109
|
s.rdoc_options <<
|
104
110
|
'--title' << 'Builder -- Easy XML Building' <<
|
@@ -129,7 +135,6 @@ classes that make heavy use of method_missing.
|
|
129
135
|
|
130
136
|
s.test_files = PKG_FILES.select { |fn| fn =~ /^test\/test/ }
|
131
137
|
|
132
|
-
s.has_rdoc = true
|
133
138
|
s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
|
134
139
|
s.rdoc_options <<
|
135
140
|
'--title' << 'BlankSlate -- Base Class for building proxies.' <<
|
data/builder.blurb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
name: builder
|
2
|
+
document: http://builder.rubyforge.org
|
3
|
+
download: http://rubyforge.org/frs/?group_id=415
|
4
|
+
description: >
|
5
|
+
<p>This package contains Builder, a simple ruby library for
|
6
|
+
building XML document quickly and easily.</p>
|
7
|
+
|
8
|
+
<p>Here's an example:</p>
|
9
|
+
|
10
|
+
<pre>
|
11
|
+
xml = Builder::XmlMarkup.new(:indent=>2)
|
12
|
+
xml.person {
|
13
|
+
xml.first_name("Jim")
|
14
|
+
xml.last_name("Weirich")
|
15
|
+
}
|
16
|
+
puts xml.target!
|
17
|
+
</pre>
|
18
|
+
|
19
|
+
<p>Produces:</p>
|
20
|
+
|
21
|
+
<pre>
|
22
|
+
<person>
|
23
|
+
<first_name>Jim</first_name>
|
24
|
+
<last_name>Weirich</last_name>
|
25
|
+
</person>
|
26
|
+
</pre>
|
27
|
+
|
data/builder.gemspec
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require './lib/builder/version'
|
3
|
+
|
4
|
+
PKG_VERSION = Builder::VERSION
|
5
|
+
|
6
|
+
PKG_FILES = Dir[
|
7
|
+
'[A-Z]*',
|
8
|
+
'doc/**/*',
|
9
|
+
'lib/**/*.rb',
|
10
|
+
'test/**/*.rb',
|
11
|
+
'rakelib/**/*'
|
12
|
+
]
|
13
|
+
|
14
|
+
Gem::Specification.new do |s|
|
15
|
+
|
16
|
+
#### Basic information.
|
17
|
+
|
18
|
+
s.name = 'builder'
|
19
|
+
s.version = PKG_VERSION
|
20
|
+
s.summary = "Builders for MarkUp."
|
21
|
+
s.description = %{\
|
22
|
+
Builder provides a number of builder objects that make creating structured data
|
23
|
+
simple to do. Currently the following builder objects are supported:
|
24
|
+
|
25
|
+
* XML Markup
|
26
|
+
* XML Events
|
27
|
+
}
|
28
|
+
|
29
|
+
s.files = PKG_FILES
|
30
|
+
s.require_path = 'lib'
|
31
|
+
|
32
|
+
s.test_files = PKG_FILES.select { |fn| fn =~ /^test\/test/ }
|
33
|
+
|
34
|
+
s.has_rdoc = true
|
35
|
+
# s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
|
36
|
+
s.rdoc_options <<
|
37
|
+
'--title' << 'Builder -- Easy XML Building' <<
|
38
|
+
'--main' << 'README.rdoc' <<
|
39
|
+
'--line-numbers'
|
40
|
+
|
41
|
+
s.authors = ["Jim Weirich", "Aaron Patterson"]
|
42
|
+
s.email = "aron.patterson@gmail.com"
|
43
|
+
s.homepage = "https://github.com/tenderlove/builder"
|
44
|
+
s.license = 'MIT'
|
45
|
+
end
|
data/doc/jamis.rb
ADDED
@@ -0,0 +1,592 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module RDoc
|
3
|
+
module Page
|
4
|
+
|
5
|
+
FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif"
|
6
|
+
|
7
|
+
STYLE = <<CSS
|
8
|
+
a {
|
9
|
+
color: #00F;
|
10
|
+
text-decoration: none;
|
11
|
+
}
|
12
|
+
|
13
|
+
a:hover {
|
14
|
+
color: #77F;
|
15
|
+
text-decoration: underline;
|
16
|
+
}
|
17
|
+
|
18
|
+
body, td, p {
|
19
|
+
font-family: %fonts%;
|
20
|
+
background: #FFF;
|
21
|
+
color: #000;
|
22
|
+
margin: 0px;
|
23
|
+
font-size: small;
|
24
|
+
}
|
25
|
+
|
26
|
+
#content {
|
27
|
+
margin: 2em;
|
28
|
+
}
|
29
|
+
|
30
|
+
#description p {
|
31
|
+
margin-bottom: 0.5em;
|
32
|
+
}
|
33
|
+
|
34
|
+
.sectiontitle {
|
35
|
+
margin-top: 1em;
|
36
|
+
margin-bottom: 1em;
|
37
|
+
padding: 0.5em;
|
38
|
+
padding-left: 2em;
|
39
|
+
background: #005;
|
40
|
+
color: #FFF;
|
41
|
+
font-weight: bold;
|
42
|
+
border: 1px dotted black;
|
43
|
+
}
|
44
|
+
|
45
|
+
.attr-rw {
|
46
|
+
padding-left: 1em;
|
47
|
+
padding-right: 1em;
|
48
|
+
text-align: center;
|
49
|
+
color: #055;
|
50
|
+
}
|
51
|
+
|
52
|
+
.attr-name {
|
53
|
+
font-weight: bold;
|
54
|
+
}
|
55
|
+
|
56
|
+
.attr-desc {
|
57
|
+
}
|
58
|
+
|
59
|
+
.attr-value {
|
60
|
+
font-family: monospace;
|
61
|
+
}
|
62
|
+
|
63
|
+
.file-title-prefix {
|
64
|
+
font-size: large;
|
65
|
+
}
|
66
|
+
|
67
|
+
.file-title {
|
68
|
+
font-size: large;
|
69
|
+
font-weight: bold;
|
70
|
+
background: #005;
|
71
|
+
color: #FFF;
|
72
|
+
}
|
73
|
+
|
74
|
+
.banner {
|
75
|
+
background: #005;
|
76
|
+
color: #FFF;
|
77
|
+
border: 1px solid black;
|
78
|
+
padding: 1em;
|
79
|
+
}
|
80
|
+
|
81
|
+
.banner td {
|
82
|
+
background: transparent;
|
83
|
+
color: #FFF;
|
84
|
+
}
|
85
|
+
|
86
|
+
h1 a, h2 a, .sectiontitle a, .banner a {
|
87
|
+
color: #FF0;
|
88
|
+
}
|
89
|
+
|
90
|
+
h1 a:hover, h2 a:hover, .sectiontitle a:hover, .banner a:hover {
|
91
|
+
color: #FF7;
|
92
|
+
}
|
93
|
+
|
94
|
+
.dyn-source {
|
95
|
+
display: none;
|
96
|
+
background: #FFE;
|
97
|
+
color: #000;
|
98
|
+
border: 1px dotted black;
|
99
|
+
margin: 0.5em 2em 0.5em 2em;
|
100
|
+
padding: 0.5em;
|
101
|
+
}
|
102
|
+
|
103
|
+
.dyn-source .cmt {
|
104
|
+
color: #00F;
|
105
|
+
font-style: italic;
|
106
|
+
}
|
107
|
+
|
108
|
+
.dyn-source .kw {
|
109
|
+
color: #070;
|
110
|
+
font-weight: bold;
|
111
|
+
}
|
112
|
+
|
113
|
+
.method {
|
114
|
+
margin-left: 1em;
|
115
|
+
margin-right: 1em;
|
116
|
+
margin-bottom: 1em;
|
117
|
+
}
|
118
|
+
|
119
|
+
.description pre {
|
120
|
+
padding: 0.5em;
|
121
|
+
border: 1px dotted black;
|
122
|
+
background: #FFE;
|
123
|
+
}
|
124
|
+
|
125
|
+
.method .title {
|
126
|
+
font-family: monospace;
|
127
|
+
font-size: large;
|
128
|
+
border-bottom: 1px dashed black;
|
129
|
+
margin-bottom: 0.3em;
|
130
|
+
padding-bottom: 0.1em;
|
131
|
+
}
|
132
|
+
|
133
|
+
.method .description, .method .sourcecode {
|
134
|
+
margin-left: 1em;
|
135
|
+
}
|
136
|
+
|
137
|
+
.description p, .sourcecode p {
|
138
|
+
margin-bottom: 0.5em;
|
139
|
+
}
|
140
|
+
|
141
|
+
.method .sourcecode p.source-link {
|
142
|
+
text-indent: 0em;
|
143
|
+
margin-top: 0.5em;
|
144
|
+
}
|
145
|
+
|
146
|
+
.method .aka {
|
147
|
+
margin-top: 0.3em;
|
148
|
+
margin-left: 1em;
|
149
|
+
font-style: italic;
|
150
|
+
text-indent: 2em;
|
151
|
+
}
|
152
|
+
|
153
|
+
h1 {
|
154
|
+
padding: 1em;
|
155
|
+
border: 1px solid black;
|
156
|
+
font-size: x-large;
|
157
|
+
font-weight: bold;
|
158
|
+
color: #FFF;
|
159
|
+
background: #007;
|
160
|
+
}
|
161
|
+
|
162
|
+
h2 {
|
163
|
+
padding: 0.5em 1em 0.5em 1em;
|
164
|
+
border: 1px solid black;
|
165
|
+
font-size: large;
|
166
|
+
font-weight: bold;
|
167
|
+
color: #FFF;
|
168
|
+
background: #009;
|
169
|
+
}
|
170
|
+
|
171
|
+
h3, h4, h5, h6 {
|
172
|
+
padding: 0.2em 1em 0.2em 1em;
|
173
|
+
border: 1px dashed black;
|
174
|
+
color: #000;
|
175
|
+
background: #AAF;
|
176
|
+
}
|
177
|
+
|
178
|
+
.sourcecode > pre {
|
179
|
+
padding: 0.5em;
|
180
|
+
border: 1px dotted black;
|
181
|
+
background: #FFE;
|
182
|
+
}
|
183
|
+
|
184
|
+
CSS
|
185
|
+
|
186
|
+
XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
|
187
|
+
<!DOCTYPE html
|
188
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
189
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
190
|
+
}
|
191
|
+
|
192
|
+
HEADER = XHTML_PREAMBLE + <<ENDHEADER
|
193
|
+
<html>
|
194
|
+
<head>
|
195
|
+
<title>%title%</title>
|
196
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
|
197
|
+
<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
|
198
|
+
|
199
|
+
<script language="JavaScript" type="text/javascript">
|
200
|
+
// <![CDATA[
|
201
|
+
|
202
|
+
function toggleSource( id )
|
203
|
+
{
|
204
|
+
var elem
|
205
|
+
var link
|
206
|
+
|
207
|
+
if( document.getElementById )
|
208
|
+
{
|
209
|
+
elem = document.getElementById( id )
|
210
|
+
link = document.getElementById( "l_" + id )
|
211
|
+
}
|
212
|
+
else if ( document.all )
|
213
|
+
{
|
214
|
+
elem = eval( "document.all." + id )
|
215
|
+
link = eval( "document.all.l_" + id )
|
216
|
+
}
|
217
|
+
else
|
218
|
+
return false;
|
219
|
+
|
220
|
+
if( elem.style.display == "block" )
|
221
|
+
{
|
222
|
+
elem.style.display = "none"
|
223
|
+
link.innerHTML = "show source"
|
224
|
+
}
|
225
|
+
else
|
226
|
+
{
|
227
|
+
elem.style.display = "block"
|
228
|
+
link.innerHTML = "hide source"
|
229
|
+
}
|
230
|
+
}
|
231
|
+
|
232
|
+
function openCode( url )
|
233
|
+
{
|
234
|
+
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
|
235
|
+
}
|
236
|
+
// ]]>
|
237
|
+
</script>
|
238
|
+
</head>
|
239
|
+
|
240
|
+
<body>
|
241
|
+
ENDHEADER
|
242
|
+
|
243
|
+
FILE_PAGE = <<HTML
|
244
|
+
<table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'>
|
245
|
+
<tr><td>
|
246
|
+
<table width="100%" border='0' cellpadding='0' cellspacing='0'><tr>
|
247
|
+
<td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />%short_name%</td>
|
248
|
+
<td align="right">
|
249
|
+
<table border='0' cellspacing="0" cellpadding="2">
|
250
|
+
<tr>
|
251
|
+
<td>Path:</td>
|
252
|
+
<td>%full_path%
|
253
|
+
IF:cvsurl
|
254
|
+
(<a href="%cvsurl%">CVS</a>)
|
255
|
+
ENDIF:cvsurl
|
256
|
+
</td>
|
257
|
+
</tr>
|
258
|
+
<tr>
|
259
|
+
<td>Modified:</td>
|
260
|
+
<td>%dtm_modified%</td>
|
261
|
+
</tr>
|
262
|
+
</table>
|
263
|
+
</td></tr>
|
264
|
+
</table>
|
265
|
+
</td></tr>
|
266
|
+
</table><br>
|
267
|
+
HTML
|
268
|
+
|
269
|
+
###################################################################
|
270
|
+
|
271
|
+
CLASS_PAGE = <<HTML
|
272
|
+
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
273
|
+
<td class="file-title"><span class="file-title-prefix">%classmod%</span><br />%full_name%</td>
|
274
|
+
<td align="right">
|
275
|
+
<table cellspacing=0 cellpadding=2>
|
276
|
+
<tr valign="top">
|
277
|
+
<td>In:</td>
|
278
|
+
<td>
|
279
|
+
START:infiles
|
280
|
+
HREF:full_path_url:full_path:
|
281
|
+
IF:cvsurl
|
282
|
+
(<a href="%cvsurl%">CVS</a>)
|
283
|
+
ENDIF:cvsurl
|
284
|
+
END:infiles
|
285
|
+
</td>
|
286
|
+
</tr>
|
287
|
+
IF:parent
|
288
|
+
<tr>
|
289
|
+
<td>Parent:</td>
|
290
|
+
<td>
|
291
|
+
IF:par_url
|
292
|
+
<a href="%par_url%">
|
293
|
+
ENDIF:par_url
|
294
|
+
%parent%
|
295
|
+
IF:par_url
|
296
|
+
</a>
|
297
|
+
ENDIF:par_url
|
298
|
+
</td>
|
299
|
+
</tr>
|
300
|
+
ENDIF:parent
|
301
|
+
</table>
|
302
|
+
</td>
|
303
|
+
</tr>
|
304
|
+
</table>
|
305
|
+
HTML
|
306
|
+
|
307
|
+
###################################################################
|
308
|
+
|
309
|
+
METHOD_LIST = <<HTML
|
310
|
+
<div id="content">
|
311
|
+
IF:diagram
|
312
|
+
<table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center">
|
313
|
+
%diagram%
|
314
|
+
</td></tr></table>
|
315
|
+
ENDIF:diagram
|
316
|
+
|
317
|
+
IF:description
|
318
|
+
<div class="description">%description%</div>
|
319
|
+
ENDIF:description
|
320
|
+
|
321
|
+
IF:requires
|
322
|
+
<div class="sectiontitle">Required Files</div>
|
323
|
+
<ul>
|
324
|
+
START:requires
|
325
|
+
<li>HREF:aref:name:</li>
|
326
|
+
END:requires
|
327
|
+
</ul>
|
328
|
+
ENDIF:requires
|
329
|
+
|
330
|
+
IF:toc
|
331
|
+
<div class="sectiontitle">Contents</div>
|
332
|
+
<ul>
|
333
|
+
START:toc
|
334
|
+
<li><a href="#%href%">%secname%</a></li>
|
335
|
+
END:toc
|
336
|
+
</ul>
|
337
|
+
ENDIF:toc
|
338
|
+
|
339
|
+
IF:methods
|
340
|
+
<div class="sectiontitle">Methods</div>
|
341
|
+
<ul>
|
342
|
+
START:methods
|
343
|
+
<li>HREF:aref:name:</li>
|
344
|
+
END:methods
|
345
|
+
</ul>
|
346
|
+
ENDIF:methods
|
347
|
+
|
348
|
+
IF:includes
|
349
|
+
<div class="sectiontitle">Included Modules</div>
|
350
|
+
<ul>
|
351
|
+
START:includes
|
352
|
+
<li>HREF:aref:name:</li>
|
353
|
+
END:includes
|
354
|
+
</ul>
|
355
|
+
ENDIF:includes
|
356
|
+
|
357
|
+
START:sections
|
358
|
+
IF:sectitle
|
359
|
+
<div class="sectiontitle"><a nem="%secsequence%">%sectitle%</a></div>
|
360
|
+
IF:seccomment
|
361
|
+
<div class="description">
|
362
|
+
%seccomment%
|
363
|
+
</div>
|
364
|
+
ENDIF:seccomment
|
365
|
+
ENDIF:sectitle
|
366
|
+
|
367
|
+
IF:classlist
|
368
|
+
<div class="sectiontitle">Classes and Modules</div>
|
369
|
+
%classlist%
|
370
|
+
ENDIF:classlist
|
371
|
+
|
372
|
+
IF:constants
|
373
|
+
<div class="sectiontitle">Constants</div>
|
374
|
+
<table border='0' cellpadding='5'>
|
375
|
+
START:constants
|
376
|
+
<tr valign='top'>
|
377
|
+
<td class="attr-name">%name%</td>
|
378
|
+
<td>=</td>
|
379
|
+
<td class="attr-value">%value%</td>
|
380
|
+
</tr>
|
381
|
+
IF:desc
|
382
|
+
<tr valign='top'>
|
383
|
+
<td> </td>
|
384
|
+
<td colspan="2" class="attr-desc">%desc%</td>
|
385
|
+
</tr>
|
386
|
+
ENDIF:desc
|
387
|
+
END:constants
|
388
|
+
</table>
|
389
|
+
ENDIF:constants
|
390
|
+
|
391
|
+
IF:attributes
|
392
|
+
<div class="sectiontitle">Attributes</div>
|
393
|
+
<table border='0' cellpadding='5'>
|
394
|
+
START:attributes
|
395
|
+
<tr valign='top'>
|
396
|
+
<td class='attr-rw'>
|
397
|
+
IF:rw
|
398
|
+
[%rw%]
|
399
|
+
ENDIF:rw
|
400
|
+
</td>
|
401
|
+
<td class='attr-name'>%name%</td>
|
402
|
+
<td class='attr-desc'>%a_desc%</td>
|
403
|
+
</tr>
|
404
|
+
END:attributes
|
405
|
+
</table>
|
406
|
+
ENDIF:attributes
|
407
|
+
|
408
|
+
IF:method_list
|
409
|
+
START:method_list
|
410
|
+
IF:methods
|
411
|
+
<div class="sectiontitle">%type% %category% methods</div>
|
412
|
+
START:methods
|
413
|
+
<div class="method">
|
414
|
+
<div class="title">
|
415
|
+
IF:callseq
|
416
|
+
<a name="%aref%"></a><b>%callseq%</b>
|
417
|
+
ENDIF:callseq
|
418
|
+
IFNOT:callseq
|
419
|
+
<a name="%aref%"></a><b>%name%</b>%params%
|
420
|
+
ENDIF:callseq
|
421
|
+
IF:codeurl
|
422
|
+
[ <a href="javascript:openCode('%codeurl%')">source</a> ]
|
423
|
+
ENDIF:codeurl
|
424
|
+
</div>
|
425
|
+
IF:m_desc
|
426
|
+
<div class="description">
|
427
|
+
%m_desc%
|
428
|
+
</div>
|
429
|
+
ENDIF:m_desc
|
430
|
+
IF:aka
|
431
|
+
<div class="aka">
|
432
|
+
This method is also aliased as
|
433
|
+
START:aka
|
434
|
+
<a href="%aref%">%name%</a>
|
435
|
+
END:aka
|
436
|
+
</div>
|
437
|
+
ENDIF:aka
|
438
|
+
IF:sourcecode
|
439
|
+
<div class="sourcecode">
|
440
|
+
<p class="source-link">[ <a href="javascript:toggleSource('%aref%_source')" id="l_%aref%_source">show source</a> ]</p>
|
441
|
+
<div id="%aref%_source" class="dyn-source">
|
442
|
+
<pre>
|
443
|
+
%sourcecode%
|
444
|
+
</pre>
|
445
|
+
</div>
|
446
|
+
</div>
|
447
|
+
ENDIF:sourcecode
|
448
|
+
</div>
|
449
|
+
END:methods
|
450
|
+
ENDIF:methods
|
451
|
+
END:method_list
|
452
|
+
ENDIF:method_list
|
453
|
+
END:sections
|
454
|
+
</div>
|
455
|
+
HTML
|
456
|
+
|
457
|
+
FOOTER = <<ENDFOOTER
|
458
|
+
</body>
|
459
|
+
</html>
|
460
|
+
ENDFOOTER
|
461
|
+
|
462
|
+
BODY = HEADER + <<ENDBODY
|
463
|
+
!INCLUDE! <!-- banner header -->
|
464
|
+
|
465
|
+
<div id="bodyContent">
|
466
|
+
#{METHOD_LIST}
|
467
|
+
</div>
|
468
|
+
|
469
|
+
#{FOOTER}
|
470
|
+
ENDBODY
|
471
|
+
|
472
|
+
########################## Source code ##########################
|
473
|
+
|
474
|
+
SRC_PAGE = XHTML_PREAMBLE + <<HTML
|
475
|
+
<html>
|
476
|
+
<head><title>%title%</title>
|
477
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
|
478
|
+
<style>
|
479
|
+
.ruby-comment { color: green; font-style: italic }
|
480
|
+
.ruby-constant { color: #4433aa; font-weight: bold; }
|
481
|
+
.ruby-identifier { color: #222222; }
|
482
|
+
.ruby-ivar { color: #2233dd; }
|
483
|
+
.ruby-keyword { color: #3333FF; font-weight: bold }
|
484
|
+
.ruby-node { color: #777777; }
|
485
|
+
.ruby-operator { color: #111111; }
|
486
|
+
.ruby-regexp { color: #662222; }
|
487
|
+
.ruby-value { color: #662222; font-style: italic }
|
488
|
+
.kw { color: #3333FF; font-weight: bold }
|
489
|
+
.cmt { color: green; font-style: italic }
|
490
|
+
.str { color: #662222; font-style: italic }
|
491
|
+
.re { color: #662222; }
|
492
|
+
</style>
|
493
|
+
</head>
|
494
|
+
<body bgcolor="white">
|
495
|
+
<pre>%code%</pre>
|
496
|
+
</body>
|
497
|
+
</html>
|
498
|
+
HTML
|
499
|
+
|
500
|
+
########################## Index ################################
|
501
|
+
|
502
|
+
FR_INDEX_BODY = <<HTML
|
503
|
+
!INCLUDE!
|
504
|
+
HTML
|
505
|
+
|
506
|
+
FILE_INDEX = XHTML_PREAMBLE + <<HTML
|
507
|
+
<html>
|
508
|
+
<head>
|
509
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
|
510
|
+
<style>
|
511
|
+
<!--
|
512
|
+
body {
|
513
|
+
background-color: #EEE;
|
514
|
+
font-family: #{FONTS};
|
515
|
+
color: #000;
|
516
|
+
margin: 0px;
|
517
|
+
}
|
518
|
+
.banner {
|
519
|
+
background: #005;
|
520
|
+
color: #FFF;
|
521
|
+
padding: 0.2em;
|
522
|
+
font-size: small;
|
523
|
+
font-weight: bold;
|
524
|
+
text-align: center;
|
525
|
+
}
|
526
|
+
.entries {
|
527
|
+
margin: 0.25em 1em 0 1em;
|
528
|
+
font-size: x-small;
|
529
|
+
}
|
530
|
+
a {
|
531
|
+
color: #00F;
|
532
|
+
text-decoration: none;
|
533
|
+
white-space: nowrap;
|
534
|
+
}
|
535
|
+
a:hover {
|
536
|
+
color: #77F;
|
537
|
+
text-decoration: underline;
|
538
|
+
}
|
539
|
+
-->
|
540
|
+
</style>
|
541
|
+
<base target="docwin">
|
542
|
+
</head>
|
543
|
+
<body>
|
544
|
+
<div class="banner">%list_title%</div>
|
545
|
+
<div class="entries">
|
546
|
+
START:entries
|
547
|
+
<a href="%href%">%name%</a><br>
|
548
|
+
END:entries
|
549
|
+
</div>
|
550
|
+
</body></html>
|
551
|
+
HTML
|
552
|
+
|
553
|
+
CLASS_INDEX = FILE_INDEX
|
554
|
+
METHOD_INDEX = FILE_INDEX
|
555
|
+
|
556
|
+
INDEX = XHTML_PREAMBLE + <<HTML
|
557
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
558
|
+
<head>
|
559
|
+
<title>%title%</title>
|
560
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
|
561
|
+
</head>
|
562
|
+
|
563
|
+
<frameset cols="20%,*">
|
564
|
+
<frameset rows="15%,35%,50%">
|
565
|
+
<frame src="fr_file_index.html" title="Files" name="Files" />
|
566
|
+
<frame src="fr_class_index.html" name="Classes" />
|
567
|
+
<frame src="fr_method_index.html" name="Methods" />
|
568
|
+
</frameset>
|
569
|
+
IF:inline_source
|
570
|
+
<frame src="%initial_page%" name="docwin">
|
571
|
+
ENDIF:inline_source
|
572
|
+
IFNOT:inline_source
|
573
|
+
<frameset rows="80%,20%">
|
574
|
+
<frame src="%initial_page%" name="docwin">
|
575
|
+
<frame src="blank.html" name="source">
|
576
|
+
</frameset>
|
577
|
+
ENDIF:inline_source
|
578
|
+
<noframes>
|
579
|
+
<body bgcolor="white">
|
580
|
+
Click <a href="html/index.html">here</a> for a non-frames
|
581
|
+
version of this page.
|
582
|
+
</body>
|
583
|
+
</noframes>
|
584
|
+
</frameset>
|
585
|
+
|
586
|
+
</html>
|
587
|
+
HTML
|
588
|
+
|
589
|
+
end
|
590
|
+
end
|
591
|
+
|
592
|
+
|