sstephenson-rubyosa 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +16 -0
- data/COPYRIGHT +25 -0
- data/README +49 -0
- data/bin/rdoc-osa +232 -0
- data/data/rubyosa/rdoc_html.rb +696 -0
- data/extconf.rb +59 -0
- data/sample/AddressBook/inspect.rb +31 -0
- data/sample/BBEdit/unix_script.rb +19 -0
- data/sample/Finder/show_desktop.rb +10 -0
- data/sample/Mail/get_selected_mail.rb +14 -0
- data/sample/Photoshop/new_doc.rb +13 -0
- data/sample/Photoshop/new_doc_with_text.rb +34 -0
- data/sample/QuickTime/play_all.rb +30 -0
- data/sample/TextEdit/hello_world.rb +19 -0
- data/sample/iChat/image.rb +18 -0
- data/sample/iChat/uptime.rb +15 -0
- data/sample/iTunes/artwork.rb +14 -0
- data/sample/iTunes/control.rb +66 -0
- data/sample/iTunes/fade_volume.rb +23 -0
- data/sample/iTunes/inspect.rb +16 -0
- data/sample/iTunes/name_that_tune.rb +97 -0
- data/sample/iTunes/tag_genre_lastfm.rb +32 -0
- data/sample/misc/sdef.rb +37 -0
- data/src/lib/rbosa.rb +1001 -0
- data/src/lib/rbosa_properties.rb +141 -0
- data/src/rbosa.c +720 -0
- data/src/rbosa.h +55 -0
- data/src/rbosa_conv.c +97 -0
- data/src/rbosa_err.c +105 -0
- data/src/rbosa_sdef.c +441 -0
- metadata +90 -0
data/AUTHORS
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Maintainer & Author:
|
2
|
+
Laurent Sansonetti <lsansonetti@apple.com>
|
3
|
+
|
4
|
+
Contributors:
|
5
|
+
Aaron Patterson <aaron.patterson@gmail.com>
|
6
|
+
Carlos Villela <carlos.villela@gmail.com>
|
7
|
+
James MacAulay <jmacaulay@gmail.com>
|
8
|
+
Justin Palmer <encytemedia@gmail.com>
|
9
|
+
Michael Pruett <michael@68k.org>
|
10
|
+
Michail Pishchagin <mblsha@gmail.com>
|
11
|
+
Mike Naberezny <mike@maintainable.com>
|
12
|
+
Sebastian Delmont <sd@notso.net>
|
13
|
+
Stefan Saasen <s@juretta.com>
|
14
|
+
Terry Donoghue <donoghue@apple.com>
|
15
|
+
Vincent Isambart <vincent.isambart@gmail.com>
|
16
|
+
Wes Rogers <wesrog@gmail.com>
|
data/COPYRIGHT
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
Copyright (c) 2006-2007, Apple Inc. All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
4
|
+
modification, are permitted provided that the following conditions
|
5
|
+
are met:
|
6
|
+
1. Redistributions of source code must retain the above copyright
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
10
|
+
documentation and/or other materials provided with the distribution.
|
11
|
+
3. Neither the name of Apple Inc. ("Apple") nor the names of
|
12
|
+
its contributors may be used to endorse or promote products derived
|
13
|
+
from this software without specific prior written permission.
|
14
|
+
|
15
|
+
THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
|
16
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
18
|
+
ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR
|
19
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
20
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
21
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
22
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
23
|
+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
24
|
+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
25
|
+
POSSIBILITY OF SUCH DAMAGE.
|
data/README
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
== Introduction ==
|
2
|
+
|
3
|
+
RubyOSA is a bridge that connects Ruby to the Apple Event Manager
|
4
|
+
infrastructure.
|
5
|
+
|
6
|
+
It automatically populates the API (classes, methods, constants) according
|
7
|
+
to the target application's scriptable definition.
|
8
|
+
|
9
|
+
RubyOSA is an alternative to RubyAEOSA, and meant to replace it.
|
10
|
+
|
11
|
+
RubyOSA is licensied under a BSD license, see the COPYRIGHT file for more
|
12
|
+
information.
|
13
|
+
|
14
|
+
More information on the project home page: http://rubyosa.rubyforge.org.
|
15
|
+
|
16
|
+
== Requirements ==
|
17
|
+
|
18
|
+
Mac OS X 10.4.X or greater
|
19
|
+
ruby 1.8.X or greater
|
20
|
+
libxml-ruby 0.3.8 or greater
|
21
|
+
|
22
|
+
== Get started ==
|
23
|
+
|
24
|
+
$ ruby extconf.rb
|
25
|
+
$ make
|
26
|
+
$ sudo make install
|
27
|
+
$ sudo make install-extras
|
28
|
+
|
29
|
+
`make install' will only install the core of the bridge, while
|
30
|
+
`make install-extras' will install some additional tools such as the rdoc-osa
|
31
|
+
utility.
|
32
|
+
|
33
|
+
== Support ==
|
34
|
+
|
35
|
+
A tutorial is available online at http://rubyosa.rubyforge.org/tutorial.html.
|
36
|
+
|
37
|
+
Sample code is available in the `sample' sub-directory.
|
38
|
+
|
39
|
+
The rdoc-osa tool can be used to generate API reference documentation
|
40
|
+
for the given application. See its --help flag for more information
|
41
|
+
about how to use it.
|
42
|
+
|
43
|
+
Feel free to send feedback to rubyosa-discuss@rubyforge.org.
|
44
|
+
|
45
|
+
You can also file bugs, patches and feature requests to the tracker:
|
46
|
+
http://rubyforge.org/tracker/?group_id=1845.
|
47
|
+
|
48
|
+
When reporting a bug, please set the AEDebugSends and AEDebugReceives
|
49
|
+
environment variables to 1 and attach the logs.
|
data/bin/rdoc-osa
ADDED
@@ -0,0 +1,232 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# RDoc frontend for RubyOSA. Generate API reference documentation for the
|
3
|
+
# given application, based on the descriptions in the sdef(5).
|
4
|
+
#
|
5
|
+
# Copyright (c) 2006-2007, Apple Inc. All rights reserved.
|
6
|
+
#
|
7
|
+
# Redistribution and use in source and binary forms, with or without
|
8
|
+
# modification, are permitted provided that the following conditions
|
9
|
+
# are met:
|
10
|
+
# 1. Redistributions of source code must retain the above copyright
|
11
|
+
# notice, this list of conditions and the following disclaimer.
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
13
|
+
# notice, this list of conditions and the following disclaimer in the
|
14
|
+
# documentation and/or other materials provided with the distribution.
|
15
|
+
# 3. Neither the name of Apple Inc. ("Apple") nor the names of
|
16
|
+
# its contributors may be used to endorse or promote products derived
|
17
|
+
# from this software without specific prior written permission.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
|
20
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR
|
23
|
+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
24
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
25
|
+
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
26
|
+
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
27
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
28
|
+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
|
31
|
+
require 'tmpdir'
|
32
|
+
require 'rbconfig'
|
33
|
+
require 'rbosa'
|
34
|
+
|
35
|
+
def usage
|
36
|
+
STDERR.puts <<-EOS
|
37
|
+
Usage: #{$0} [--addition] [--name | --path | --bundle_id | --signature] <criterion> [rdoc-options...]
|
38
|
+
Examples:
|
39
|
+
# Generate HTML documentation for iTunes:
|
40
|
+
#{$0} --name iTunes
|
41
|
+
# Generate RI documentation for iTunes:
|
42
|
+
#{$0} --name iTunes --ri
|
43
|
+
# Generate HTML documentation for the StandardAdditions scriptable addition:
|
44
|
+
#{$0} --addition --name StandardAdditions
|
45
|
+
See rdoc --help for additional options.
|
46
|
+
EOS
|
47
|
+
exit 1
|
48
|
+
end
|
49
|
+
|
50
|
+
def unique_tmp_path(base, extension='', dir=Dir.tmpdir)
|
51
|
+
i = 0
|
52
|
+
loop do
|
53
|
+
p = File.join(dir, "#{base}-#{i}-#{Process.pid}" + extension)
|
54
|
+
return p unless File.exists?(p)
|
55
|
+
i += 1
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
usage unless ARGV.length >= 2
|
60
|
+
addition = key = criterion = nil
|
61
|
+
while arg = ARGV.shift
|
62
|
+
case arg
|
63
|
+
when '--addition'
|
64
|
+
addition = true
|
65
|
+
when '--name', '--path', '--bundle_id', '--signature'
|
66
|
+
if key
|
67
|
+
$stderr.puts "You cannot use --name, --path, --bundle_id or --signature more than once."
|
68
|
+
exit 1
|
69
|
+
end
|
70
|
+
key = arg[2..-1].intern
|
71
|
+
criterion = ARGV.shift
|
72
|
+
usage if criterion.nil?
|
73
|
+
else
|
74
|
+
if key and criterion
|
75
|
+
ARGV.unshift(arg)
|
76
|
+
break
|
77
|
+
end
|
78
|
+
usage
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
DOC_NOT_AVAILABLE = 'Documentation not available.'
|
83
|
+
|
84
|
+
app = app_name = nil
|
85
|
+
|
86
|
+
if addition
|
87
|
+
app_name = criterion if key == :name
|
88
|
+
mod = Module.new
|
89
|
+
OSA.const_set('TheApplication', mod)
|
90
|
+
klass = Class.new(OSA::Element)
|
91
|
+
mod.const_set('Application', klass)
|
92
|
+
klass.class_eval do
|
93
|
+
include OSA::EventDispatcher
|
94
|
+
METHODS_DESCRIPTION = []
|
95
|
+
DESCRIPTION = 'The application class.'
|
96
|
+
end
|
97
|
+
app = klass.new.merge(key => criterion)
|
98
|
+
else
|
99
|
+
app = OSA.app(key => criterion)
|
100
|
+
app_name = if app.respond_to?(:name)
|
101
|
+
app.name
|
102
|
+
else
|
103
|
+
if key != :name
|
104
|
+
STDERR.puts "Can't guess the application name, because the application doesn't have a #name method. Please use `--name' instead."
|
105
|
+
exit 1
|
106
|
+
else
|
107
|
+
criterion
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
mod = OSA.const_get(app.class.name.scan(/^OSA::(.+)::Application$/).to_s)
|
113
|
+
fake_ruby_src = mod.constants.map do |const_name|
|
114
|
+
obj = mod.const_get(const_name)
|
115
|
+
case obj
|
116
|
+
when Class
|
117
|
+
# Class.
|
118
|
+
methods_desc = obj.const_get('METHODS_DESCRIPTION').map do |method|
|
119
|
+
args_doc, args_def, args_def_opt = '', '', ''
|
120
|
+
if method.args and !method.args.empty?
|
121
|
+
args_doc_ary, args_def_ary, args_def_opt_ary = [], [], []
|
122
|
+
method.args.each do |x|
|
123
|
+
arg = x.name
|
124
|
+
desc = x.description
|
125
|
+
desc = DOC_NOT_AVAILABLE if desc.empty?
|
126
|
+
args_doc_ary << " # #{arg}::\n # #{desc}" + (x.optional? ? ' Optional. Can be passed as a Hash key/value.' : '')
|
127
|
+
if x.optional?
|
128
|
+
args_def_ary << x.name + '=nil'
|
129
|
+
args_def_opt_ary << ':' + x.name + ' => nil'
|
130
|
+
else
|
131
|
+
args_def_ary << x.name
|
132
|
+
args_def_opt_ary << x.name
|
133
|
+
end
|
134
|
+
end
|
135
|
+
args_doc = args_doc_ary.join("\n")
|
136
|
+
args_def = '(' + args_def_ary.join(', ') + ')'
|
137
|
+
args_def_opt = '(' + args_def_opt_ary.join(', ') + ')'
|
138
|
+
end
|
139
|
+
if method.result
|
140
|
+
args_doc << "\n" unless args_doc.empty?
|
141
|
+
desc = method.result.description
|
142
|
+
desc = DOC_NOT_AVAILABLE if desc.empty?
|
143
|
+
args_doc << " # Returns::\n # #{desc}\n"
|
144
|
+
end
|
145
|
+
<<EOS
|
146
|
+
# call-seq:
|
147
|
+
# #{method.name + args_def}
|
148
|
+
# #{args_def_opt != args_def ? method.name + args_def_opt : ''}
|
149
|
+
#
|
150
|
+
# #{method.description}
|
151
|
+
#{args_doc}
|
152
|
+
def #{method.name}#{args_def}; end
|
153
|
+
EOS
|
154
|
+
end
|
155
|
+
<<EOS
|
156
|
+
# #{(obj.const_get('DESCRIPTION') || 'n/a')}
|
157
|
+
class #{obj.name} < #{obj.superclass}
|
158
|
+
#{methods_desc.join.rstrip}
|
159
|
+
end
|
160
|
+
|
161
|
+
EOS
|
162
|
+
when Module
|
163
|
+
# Enumeration group.
|
164
|
+
next unless obj.const_defined?(:DESCRIPTION)
|
165
|
+
enums_desc = obj.const_get(:DESCRIPTION).map do |item|
|
166
|
+
<<EOS
|
167
|
+
# #{item.description}
|
168
|
+
#{item.name} = '#{obj.const_get(item.name).code}'
|
169
|
+
EOS
|
170
|
+
end
|
171
|
+
<<EOS
|
172
|
+
module #{mod.name}::#{const_name}
|
173
|
+
#{enums_desc}
|
174
|
+
end
|
175
|
+
|
176
|
+
EOS
|
177
|
+
end
|
178
|
+
end.
|
179
|
+
join
|
180
|
+
|
181
|
+
header = if addition
|
182
|
+
<<EOS
|
183
|
+
# This documentation describes the RubyOSA API for the #{criterion} scriptable addition. It has been automatically generated.
|
184
|
+
#
|
185
|
+
# In order to use this API you have to merge the scriptable addition into an application object. For instance:
|
186
|
+
#
|
187
|
+
# OSA.app('iTunes').merge(#{app_name ? "'#{app_name}'" : ":#{key} => '#{criterion}'"})
|
188
|
+
#
|
189
|
+
# The module OSA::TheApplication is fake, everything inside will be defined in the module of the application you are controlling (for iTunes, in OSA::ITunes).
|
190
|
+
EOS
|
191
|
+
else
|
192
|
+
<<EOS
|
193
|
+
# This documentation describes the RubyOSA API for the #{app_name} application. It has been automatically generated.
|
194
|
+
#
|
195
|
+
# The main class is #{mod.name}::Application, of which an instance is created likewise:
|
196
|
+
#
|
197
|
+
# OSA.app('#{app_name}')
|
198
|
+
EOS
|
199
|
+
end
|
200
|
+
|
201
|
+
header << <<EOS
|
202
|
+
#
|
203
|
+
# For more information about RubyOSA, please visit the project homepage: http://rubyosa.rubyforge.org.
|
204
|
+
module OSA; end
|
205
|
+
# The #{app_name} module.
|
206
|
+
module #{mod.name}; end
|
207
|
+
EOS
|
208
|
+
|
209
|
+
fake_ruby_src = header << fake_ruby_src
|
210
|
+
|
211
|
+
rdoc_flags = ''
|
212
|
+
datadir = if Config.respond_to?(:datadir)
|
213
|
+
Config.datadir('rubyosa')
|
214
|
+
else
|
215
|
+
File.join(Config::CONFIG['datadir'], 'rubyosa')
|
216
|
+
end
|
217
|
+
template = File.join(datadir, 'rdoc_html.rb')
|
218
|
+
if File.exists?(template)
|
219
|
+
rdoc_flags << " --template '#{template}' "
|
220
|
+
end
|
221
|
+
rdoc_flags << " --title '#{app_name} RubyOSA API' "
|
222
|
+
rdoc_flags << ' --main OSA '
|
223
|
+
rdoc_flags << ARGV.join(' ')
|
224
|
+
|
225
|
+
path = unique_tmp_path(app_name, '.rb')
|
226
|
+
File.open(path, 'w') { |io| io.puts fake_ruby_src }
|
227
|
+
line = "rdoc #{rdoc_flags} \"#{path}\""
|
228
|
+
unless system(line)
|
229
|
+
STDERR.puts "Error when executing `#{line}' : #{$?}"
|
230
|
+
exit 1
|
231
|
+
end
|
232
|
+
File.unlink(path)
|
@@ -0,0 +1,696 @@
|
|
1
|
+
#
|
2
|
+
# Note: this is the original default RDoc template slightly modified for the
|
3
|
+
# RubyOSA project.
|
4
|
+
#
|
5
|
+
# = CSS2 RDoc HTML template
|
6
|
+
#
|
7
|
+
# This is a template for RDoc that uses XHTML 1.0 Transitional and dictates a
|
8
|
+
# bit more of the appearance of the output to cascading stylesheets than the
|
9
|
+
# default. It was designed for clean inline code display, and uses DHTMl to
|
10
|
+
# toggle the visbility of each method's source with each click on the '[source]'
|
11
|
+
# link.
|
12
|
+
#
|
13
|
+
# == Authors
|
14
|
+
#
|
15
|
+
# * Michael Granger <ged@FaerieMUD.org>
|
16
|
+
#
|
17
|
+
# Copyright (c) 2002, 2003 The FaerieMUD Consortium. Some rights reserved.
|
18
|
+
#
|
19
|
+
# This work is licensed under the Creative Commons Attribution License. To view
|
20
|
+
# a copy of this license, visit http://creativecommons.org/licenses/by/1.0/ or
|
21
|
+
# send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
|
22
|
+
# 94305, USA.
|
23
|
+
#
|
24
|
+
|
25
|
+
module RDoc
|
26
|
+
module Page
|
27
|
+
|
28
|
+
FONTS = "Verdana,Arial,Helvetica,sans-serif"
|
29
|
+
|
30
|
+
STYLE = %{
|
31
|
+
body {
|
32
|
+
font-family: Verdana,Arial,Helvetica,sans-serif;
|
33
|
+
font-size: 90%;
|
34
|
+
margin: 0;
|
35
|
+
margin-left: 40px;
|
36
|
+
padding: 0;
|
37
|
+
background: white;
|
38
|
+
}
|
39
|
+
|
40
|
+
h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
|
41
|
+
h1 { font-size: 150%; }
|
42
|
+
h2,h3,h4 { margin-top: 1em; }
|
43
|
+
|
44
|
+
a { background: #eef; color: #039; text-decoration: none; }
|
45
|
+
a:hover { background: #039; color: #eef; }
|
46
|
+
|
47
|
+
/* Override the base stylesheet's Anchor inside a table cell */
|
48
|
+
td > a {
|
49
|
+
background: transparent;
|
50
|
+
color: #039;
|
51
|
+
text-decoration: none;
|
52
|
+
}
|
53
|
+
|
54
|
+
/* and inside a section title */
|
55
|
+
.section-title > a {
|
56
|
+
background: transparent;
|
57
|
+
color: #eee;
|
58
|
+
text-decoration: none;
|
59
|
+
}
|
60
|
+
|
61
|
+
/* === Structural elements =================================== */
|
62
|
+
|
63
|
+
div#index {
|
64
|
+
margin: 0;
|
65
|
+
margin-left: -40px;
|
66
|
+
padding: 0;
|
67
|
+
font-size: 90%;
|
68
|
+
}
|
69
|
+
|
70
|
+
|
71
|
+
div#index a {
|
72
|
+
margin-left: 0.7em;
|
73
|
+
}
|
74
|
+
|
75
|
+
div#index .section-bar {
|
76
|
+
margin-left: 0px;
|
77
|
+
padding-left: 0.7em;
|
78
|
+
background: #ccc;
|
79
|
+
font-size: small;
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
div#classHeader, div#fileHeader {
|
84
|
+
width: auto;
|
85
|
+
color: white;
|
86
|
+
padding: 0.5em 1.5em 0.5em 1.5em;
|
87
|
+
margin: 0;
|
88
|
+
margin-left: -40px;
|
89
|
+
border-bottom: 3px solid #006;
|
90
|
+
}
|
91
|
+
|
92
|
+
div#classHeader a, div#fileHeader a {
|
93
|
+
background: inherit;
|
94
|
+
color: white;
|
95
|
+
}
|
96
|
+
|
97
|
+
div#classHeader td, div#fileHeader td {
|
98
|
+
background: inherit;
|
99
|
+
color: white;
|
100
|
+
}
|
101
|
+
|
102
|
+
|
103
|
+
div#fileHeader {
|
104
|
+
background: #057;
|
105
|
+
}
|
106
|
+
|
107
|
+
div#classHeader {
|
108
|
+
background: #048;
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
.class-name-in-header {
|
113
|
+
font-size: 180%;
|
114
|
+
font-weight: bold;
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
div#bodyContent {
|
119
|
+
padding: 0 1.5em 0 1.5em;
|
120
|
+
}
|
121
|
+
|
122
|
+
div#description {
|
123
|
+
padding: 0.5em 1.5em;
|
124
|
+
background: #efefef;
|
125
|
+
border: 1px dotted #999;
|
126
|
+
}
|
127
|
+
|
128
|
+
div#description h1,h2,h3,h4,h5,h6 {
|
129
|
+
color: #125;;
|
130
|
+
background: transparent;
|
131
|
+
}
|
132
|
+
|
133
|
+
div#validator-badges {
|
134
|
+
text-align: center;
|
135
|
+
}
|
136
|
+
div#validator-badges img { border: 0; }
|
137
|
+
|
138
|
+
div#copyright {
|
139
|
+
color: #333;
|
140
|
+
background: #efefef;
|
141
|
+
font: 0.75em sans-serif;
|
142
|
+
margin-top: 5em;
|
143
|
+
margin-bottom: 0;
|
144
|
+
padding: 0.5em 2em;
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
/* === Classes =================================== */
|
149
|
+
|
150
|
+
table.header-table {
|
151
|
+
color: white;
|
152
|
+
font-size: small;
|
153
|
+
}
|
154
|
+
|
155
|
+
.type-note {
|
156
|
+
font-size: small;
|
157
|
+
color: #DEDEDE;
|
158
|
+
}
|
159
|
+
|
160
|
+
.xxsection-bar {
|
161
|
+
background: #eee;
|
162
|
+
color: #333;
|
163
|
+
padding: 3px;
|
164
|
+
}
|
165
|
+
|
166
|
+
.section-bar {
|
167
|
+
color: #333;
|
168
|
+
border-bottom: 1px solid #999;
|
169
|
+
margin-left: -20px;
|
170
|
+
}
|
171
|
+
|
172
|
+
|
173
|
+
.section-title {
|
174
|
+
background: #79a;
|
175
|
+
color: #eee;
|
176
|
+
padding: 3px;
|
177
|
+
margin-top: 2em;
|
178
|
+
margin-left: -30px;
|
179
|
+
border: 1px solid #999;
|
180
|
+
}
|
181
|
+
|
182
|
+
.top-aligned-row { vertical-align: top }
|
183
|
+
.bottom-aligned-row { vertical-align: bottom }
|
184
|
+
|
185
|
+
/* --- Context section classes ----------------------- */
|
186
|
+
|
187
|
+
.context-row { }
|
188
|
+
.context-item-name { font-family: monospace; font-weight: bold; color: black; }
|
189
|
+
.context-item-value { font-size: small; color: #448; }
|
190
|
+
.context-item-desc { color: #333; padding-left: 2em; }
|
191
|
+
|
192
|
+
/* --- Method classes -------------------------- */
|
193
|
+
.method-detail {
|
194
|
+
background: #efefef;
|
195
|
+
padding: 0;
|
196
|
+
margin-top: 0.5em;
|
197
|
+
margin-bottom: 1em;
|
198
|
+
border: 1px dotted #ccc;
|
199
|
+
}
|
200
|
+
.method-heading {
|
201
|
+
color: black;
|
202
|
+
background: #ccc;
|
203
|
+
border-bottom: 1px solid #666;
|
204
|
+
padding: 0.2em 0.5em 0 0.5em;
|
205
|
+
}
|
206
|
+
.method-signature { color: black; background: inherit; }
|
207
|
+
.method-name { font-weight: bold; }
|
208
|
+
.method-args { font-style: italic; }
|
209
|
+
.method-description { padding: 0 0.5em 0 0.5em; }
|
210
|
+
|
211
|
+
/* --- Source code sections -------------------- */
|
212
|
+
|
213
|
+
a.source-toggle { font-size: 90%; }
|
214
|
+
div.method-source-code {
|
215
|
+
background: #262626;
|
216
|
+
color: #ffdead;
|
217
|
+
margin: 1em;
|
218
|
+
padding: 0.5em;
|
219
|
+
border: 1px dashed #999;
|
220
|
+
overflow: hidden;
|
221
|
+
}
|
222
|
+
|
223
|
+
div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
224
|
+
|
225
|
+
/* --- Ruby keyword styles --------------------- */
|
226
|
+
|
227
|
+
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
|
228
|
+
|
229
|
+
.ruby-constant { color: #7fffd4; background: transparent; }
|
230
|
+
.ruby-keyword { color: #00ffff; background: transparent; }
|
231
|
+
.ruby-ivar { color: #eedd82; background: transparent; }
|
232
|
+
.ruby-operator { color: #00ffee; background: transparent; }
|
233
|
+
.ruby-identifier { color: #ffdead; background: transparent; }
|
234
|
+
.ruby-node { color: #ffa07a; background: transparent; }
|
235
|
+
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
|
236
|
+
.ruby-regexp { color: #ffa07a; background: transparent; }
|
237
|
+
.ruby-value { color: #7fffd4; background: transparent; }
|
238
|
+
}
|
239
|
+
|
240
|
+
|
241
|
+
#####################################################################
|
242
|
+
### H E A D E R T E M P L A T E
|
243
|
+
#####################################################################
|
244
|
+
|
245
|
+
XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
|
246
|
+
<!DOCTYPE html
|
247
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
248
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
249
|
+
}
|
250
|
+
|
251
|
+
HEADER = XHTML_PREAMBLE + %{
|
252
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
253
|
+
<head>
|
254
|
+
<title>%title%</title>
|
255
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
|
256
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
257
|
+
<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
|
258
|
+
<script type="text/javascript">
|
259
|
+
// <![CDATA[
|
260
|
+
|
261
|
+
function popupCode( url ) {
|
262
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
263
|
+
}
|
264
|
+
|
265
|
+
function toggleCode( id ) {
|
266
|
+
if ( document.getElementById )
|
267
|
+
elem = document.getElementById( id );
|
268
|
+
else if ( document.all )
|
269
|
+
elem = eval( "document.all." + id );
|
270
|
+
else
|
271
|
+
return false;
|
272
|
+
|
273
|
+
elemStyle = elem.style;
|
274
|
+
|
275
|
+
if ( elemStyle.display != "block" ) {
|
276
|
+
elemStyle.display = "block"
|
277
|
+
} else {
|
278
|
+
elemStyle.display = "none"
|
279
|
+
}
|
280
|
+
|
281
|
+
return true;
|
282
|
+
}
|
283
|
+
|
284
|
+
// Make codeblocks hidden by default
|
285
|
+
document.writeln( "<style type=\\"text/css\\">div.method-source-code { display: none }</style>" )
|
286
|
+
|
287
|
+
// ]]>
|
288
|
+
</script>
|
289
|
+
|
290
|
+
</head>
|
291
|
+
<body>
|
292
|
+
}
|
293
|
+
|
294
|
+
|
295
|
+
#####################################################################
|
296
|
+
### C O N T E X T C O N T E N T T E M P L A T E
|
297
|
+
#####################################################################
|
298
|
+
|
299
|
+
CONTEXT_CONTENT = %{
|
300
|
+
}
|
301
|
+
|
302
|
+
|
303
|
+
#####################################################################
|
304
|
+
### F O O T E R T E M P L A T E
|
305
|
+
#####################################################################
|
306
|
+
FOOTER = %{
|
307
|
+
<div id="validator-badges">
|
308
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
309
|
+
</div>
|
310
|
+
|
311
|
+
</body>
|
312
|
+
</html>
|
313
|
+
}
|
314
|
+
|
315
|
+
|
316
|
+
#####################################################################
|
317
|
+
### F I L E P A G E H E A D E R T E M P L A T E
|
318
|
+
#####################################################################
|
319
|
+
|
320
|
+
FILE_PAGE = %{
|
321
|
+
<div id="fileHeader">
|
322
|
+
<h1>%short_name%</h1>
|
323
|
+
<table class="header-table">
|
324
|
+
<tr class="top-aligned-row">
|
325
|
+
<td><strong>Path:</strong></td>
|
326
|
+
<td>%full_path%
|
327
|
+
IF:cvsurl
|
328
|
+
(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
|
329
|
+
ENDIF:cvsurl
|
330
|
+
</td>
|
331
|
+
</tr>
|
332
|
+
<tr class="top-aligned-row">
|
333
|
+
<td><strong>Last Update:</strong></td>
|
334
|
+
<td>%dtm_modified%</td>
|
335
|
+
</tr>
|
336
|
+
</table>
|
337
|
+
</div>
|
338
|
+
}
|
339
|
+
|
340
|
+
|
341
|
+
#####################################################################
|
342
|
+
### C L A S S P A G E H E A D E R T E M P L A T E
|
343
|
+
#####################################################################
|
344
|
+
|
345
|
+
CLASS_PAGE = %{
|
346
|
+
<div id="classHeader">
|
347
|
+
<table class="header-table">
|
348
|
+
<tr class="top-aligned-row">
|
349
|
+
<td><strong>%classmod%</strong></td>
|
350
|
+
<td class="class-name-in-header">%full_name%</td>
|
351
|
+
</tr>
|
352
|
+
<!--
|
353
|
+
<tr class="top-aligned-row">
|
354
|
+
<td><strong>In:</strong></td>
|
355
|
+
<td>
|
356
|
+
START:infiles
|
357
|
+
IF:full_path_url
|
358
|
+
<a href="%full_path_url%">
|
359
|
+
ENDIF:full_path_url
|
360
|
+
%full_path%
|
361
|
+
IF:full_path_url
|
362
|
+
</a>
|
363
|
+
ENDIF:full_path_url
|
364
|
+
IF:cvsurl
|
365
|
+
(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
|
366
|
+
ENDIF:cvsurl
|
367
|
+
<br />
|
368
|
+
END:infiles
|
369
|
+
</td>
|
370
|
+
</tr>
|
371
|
+
-->
|
372
|
+
|
373
|
+
IF:parent
|
374
|
+
<tr class="top-aligned-row">
|
375
|
+
<td><strong>Parent:</strong></td>
|
376
|
+
<td>
|
377
|
+
IF:par_url
|
378
|
+
<a href="%par_url%">
|
379
|
+
ENDIF:par_url
|
380
|
+
%parent%
|
381
|
+
IF:par_url
|
382
|
+
</a>
|
383
|
+
ENDIF:par_url
|
384
|
+
</td>
|
385
|
+
</tr>
|
386
|
+
ENDIF:parent
|
387
|
+
</table>
|
388
|
+
</div>
|
389
|
+
}
|
390
|
+
|
391
|
+
|
392
|
+
#####################################################################
|
393
|
+
### M E T H O D L I S T T E M P L A T E
|
394
|
+
#####################################################################
|
395
|
+
|
396
|
+
METHOD_LIST = %{
|
397
|
+
|
398
|
+
<div id="contextContent">
|
399
|
+
IF:diagram
|
400
|
+
<div id="diagram">
|
401
|
+
%diagram%
|
402
|
+
</div>
|
403
|
+
ENDIF:diagram
|
404
|
+
|
405
|
+
IF:description
|
406
|
+
<div id="description">
|
407
|
+
%description%
|
408
|
+
</div>
|
409
|
+
ENDIF:description
|
410
|
+
|
411
|
+
IF:requires
|
412
|
+
<div id="requires-list">
|
413
|
+
<h3 class="section-bar">Required files</h3>
|
414
|
+
|
415
|
+
<div class="name-list">
|
416
|
+
START:requires
|
417
|
+
HREF:aref:name:
|
418
|
+
END:requires
|
419
|
+
</div>
|
420
|
+
</div>
|
421
|
+
ENDIF:requires
|
422
|
+
|
423
|
+
IF:toc
|
424
|
+
<div id="contents-list">
|
425
|
+
<h3 class="section-bar">Contents</h3>
|
426
|
+
<ul>
|
427
|
+
START:toc
|
428
|
+
<li><a href="#%href%">%secname%</a></li>
|
429
|
+
END:toc
|
430
|
+
</ul>
|
431
|
+
ENDIF:toc
|
432
|
+
</div>
|
433
|
+
|
434
|
+
IF:methods
|
435
|
+
<div id="method-list">
|
436
|
+
<h3 class="section-bar">Methods</h3>
|
437
|
+
|
438
|
+
<div class="name-list">
|
439
|
+
START:methods
|
440
|
+
HREF:aref:name:
|
441
|
+
END:methods
|
442
|
+
</div>
|
443
|
+
</div>
|
444
|
+
ENDIF:methods
|
445
|
+
|
446
|
+
</div>
|
447
|
+
|
448
|
+
|
449
|
+
<!-- if includes -->
|
450
|
+
IF:includes
|
451
|
+
<div id="includes">
|
452
|
+
<h3 class="section-bar">Included Modules</h3>
|
453
|
+
|
454
|
+
<div id="includes-list">
|
455
|
+
START:includes
|
456
|
+
<span class="include-name">HREF:aref:name:</span>
|
457
|
+
END:includes
|
458
|
+
</div>
|
459
|
+
</div>
|
460
|
+
ENDIF:includes
|
461
|
+
|
462
|
+
START:sections
|
463
|
+
<div id="section">
|
464
|
+
IF:sectitle
|
465
|
+
<h2 class="section-title"><a name="%secsequence%">%sectitle%</a></h2>
|
466
|
+
IF:seccomment
|
467
|
+
<div class="section-comment">
|
468
|
+
%seccomment%
|
469
|
+
</div>
|
470
|
+
ENDIF:seccomment
|
471
|
+
ENDIF:sectitle
|
472
|
+
|
473
|
+
IF:classlist
|
474
|
+
<div id="class-list">
|
475
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
476
|
+
|
477
|
+
%classlist%
|
478
|
+
</div>
|
479
|
+
ENDIF:classlist
|
480
|
+
|
481
|
+
IF:constants
|
482
|
+
<div id="constants-list">
|
483
|
+
<h3 class="section-bar">Constants</h3>
|
484
|
+
|
485
|
+
<div class="name-list">
|
486
|
+
<table summary="Constants">
|
487
|
+
START:constants
|
488
|
+
<tr class="top-aligned-row context-row">
|
489
|
+
<td class="context-item-name">%name%</td>
|
490
|
+
<td>=</td>
|
491
|
+
<td class="context-item-value">%value%</td>
|
492
|
+
IF:desc
|
493
|
+
<td width="3em"> </td>
|
494
|
+
<td class="context-item-desc">%desc%</td>
|
495
|
+
ENDIF:desc
|
496
|
+
</tr>
|
497
|
+
END:constants
|
498
|
+
</table>
|
499
|
+
</div>
|
500
|
+
</div>
|
501
|
+
ENDIF:constants
|
502
|
+
|
503
|
+
IF:aliases
|
504
|
+
<div id="aliases-list">
|
505
|
+
<h3 class="section-bar">External Aliases</h3>
|
506
|
+
|
507
|
+
<div class="name-list">
|
508
|
+
<table summary="aliases">
|
509
|
+
START:aliases
|
510
|
+
<tr class="top-aligned-row context-row">
|
511
|
+
<td class="context-item-name">%old_name%</td>
|
512
|
+
<td>-></td>
|
513
|
+
<td class="context-item-value">%new_name%</td>
|
514
|
+
</tr>
|
515
|
+
IF:desc
|
516
|
+
<tr class="top-aligned-row context-row">
|
517
|
+
<td> </td>
|
518
|
+
<td colspan="2" class="context-item-desc">%desc%</td>
|
519
|
+
</tr>
|
520
|
+
ENDIF:desc
|
521
|
+
END:aliases
|
522
|
+
</table>
|
523
|
+
</div>
|
524
|
+
</div>
|
525
|
+
ENDIF:aliases
|
526
|
+
|
527
|
+
|
528
|
+
IF:attributes
|
529
|
+
<div id="attribute-list">
|
530
|
+
<h3 class="section-bar">Attributes</h3>
|
531
|
+
|
532
|
+
<div class="name-list">
|
533
|
+
<table>
|
534
|
+
START:attributes
|
535
|
+
<tr class="top-aligned-row context-row">
|
536
|
+
<td class="context-item-name">%name%</td>
|
537
|
+
IF:rw
|
538
|
+
<td class="context-item-value"> [%rw%] </td>
|
539
|
+
ENDIF:rw
|
540
|
+
IFNOT:rw
|
541
|
+
<td class="context-item-value"> </td>
|
542
|
+
ENDIF:rw
|
543
|
+
<td class="context-item-desc">%a_desc%</td>
|
544
|
+
</tr>
|
545
|
+
END:attributes
|
546
|
+
</table>
|
547
|
+
</div>
|
548
|
+
</div>
|
549
|
+
ENDIF:attributes
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
<!-- if method_list -->
|
554
|
+
IF:method_list
|
555
|
+
<div id="methods">
|
556
|
+
START:method_list
|
557
|
+
IF:methods
|
558
|
+
<h3 class="section-bar">%type% %category% methods</h3>
|
559
|
+
|
560
|
+
START:methods
|
561
|
+
<div id="method-%aref%" class="method-detail">
|
562
|
+
<a name="%aref%"></a>
|
563
|
+
|
564
|
+
<div class="method-heading">
|
565
|
+
IF:callseq
|
566
|
+
<span class="method-name">%callseq%</span>
|
567
|
+
ENDIF:callseq
|
568
|
+
IFNOT:callseq
|
569
|
+
<span class="method-name">%name%</span><span class="method-args">%params%</span>
|
570
|
+
ENDIF:callseq
|
571
|
+
IF:codeurl
|
572
|
+
</a>
|
573
|
+
ENDIF:codeurl
|
574
|
+
</div>
|
575
|
+
|
576
|
+
<div class="method-description">
|
577
|
+
IF:m_desc
|
578
|
+
%m_desc%
|
579
|
+
ENDIF:m_desc
|
580
|
+
</div>
|
581
|
+
</div>
|
582
|
+
|
583
|
+
END:methods
|
584
|
+
ENDIF:methods
|
585
|
+
END:method_list
|
586
|
+
|
587
|
+
</div>
|
588
|
+
ENDIF:method_list
|
589
|
+
END:sections
|
590
|
+
}
|
591
|
+
|
592
|
+
|
593
|
+
#####################################################################
|
594
|
+
### B O D Y T E M P L A T E
|
595
|
+
#####################################################################
|
596
|
+
|
597
|
+
BODY = HEADER + %{
|
598
|
+
|
599
|
+
!INCLUDE! <!-- banner header -->
|
600
|
+
|
601
|
+
<div id="bodyContent">
|
602
|
+
|
603
|
+
} + METHOD_LIST + %{
|
604
|
+
|
605
|
+
</div>
|
606
|
+
|
607
|
+
} + FOOTER
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
#####################################################################
|
612
|
+
### S O U R C E C O D E T E M P L A T E
|
613
|
+
#####################################################################
|
614
|
+
|
615
|
+
SRC_PAGE = XHTML_PREAMBLE + %{
|
616
|
+
<html>
|
617
|
+
<head>
|
618
|
+
<title>%title%</title>
|
619
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
|
620
|
+
<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
|
621
|
+
</head>
|
622
|
+
<body class="standalone-code">
|
623
|
+
<pre>%code%</pre>
|
624
|
+
</body>
|
625
|
+
</html>
|
626
|
+
}
|
627
|
+
|
628
|
+
|
629
|
+
#####################################################################
|
630
|
+
### I N D E X F I L E T E M P L A T E S
|
631
|
+
#####################################################################
|
632
|
+
|
633
|
+
FR_INDEX_BODY = %{
|
634
|
+
!INCLUDE!
|
635
|
+
}
|
636
|
+
|
637
|
+
FILE_INDEX = XHTML_PREAMBLE + %{
|
638
|
+
<!--
|
639
|
+
|
640
|
+
%list_title%
|
641
|
+
|
642
|
+
-->
|
643
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
644
|
+
<head>
|
645
|
+
<title>%list_title%</title>
|
646
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
|
647
|
+
<link rel="stylesheet" href="%style_url%" type="text/css" />
|
648
|
+
<base target="docwin" />
|
649
|
+
</head>
|
650
|
+
<body>
|
651
|
+
<div id="index">
|
652
|
+
<h1 class="section-bar">%list_title%</h1>
|
653
|
+
<div id="index-entries">
|
654
|
+
START:entries
|
655
|
+
<a href="%href%">%name%</a><br />
|
656
|
+
END:entries
|
657
|
+
</div>
|
658
|
+
</div>
|
659
|
+
</body>
|
660
|
+
</html>
|
661
|
+
}
|
662
|
+
|
663
|
+
CLASS_INDEX = FILE_INDEX
|
664
|
+
METHOD_INDEX = FILE_INDEX
|
665
|
+
|
666
|
+
INDEX = %{<?xml version="1.0" encoding="%charset%"?>
|
667
|
+
<!DOCTYPE html
|
668
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
669
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
670
|
+
|
671
|
+
<!--
|
672
|
+
|
673
|
+
%title%
|
674
|
+
|
675
|
+
-->
|
676
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
677
|
+
<head>
|
678
|
+
<title>%title%</title>
|
679
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
|
680
|
+
</head>
|
681
|
+
<frameset rows="20%, 80%">
|
682
|
+
<frameset cols="50%,50%">
|
683
|
+
<frame src="fr_class_index.html" name="Classes" />
|
684
|
+
<frame src="fr_method_index.html" name="Methods" />
|
685
|
+
</frameset>
|
686
|
+
<frame src="%initial_page%" name="docwin" />
|
687
|
+
</frameset>
|
688
|
+
</html>
|
689
|
+
}
|
690
|
+
|
691
|
+
|
692
|
+
|
693
|
+
end # module Page
|
694
|
+
end # class RDoc
|
695
|
+
|
696
|
+
require 'rdoc/generators/template/html/one_page_html'
|