sqlpostgres 1.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.
Files changed (207) hide show
  1. data/Gemfile +8 -0
  2. data/Gemfile.lock +22 -0
  3. data/LICENSE.md +23 -0
  4. data/README.rdoc +59 -0
  5. data/Rakefile +32 -0
  6. data/VERSION +1 -0
  7. data/doc/BUGS +2 -0
  8. data/doc/examples/README +6 -0
  9. data/doc/examples/connection.rb +16 -0
  10. data/doc/examples/connection_auto.rb +22 -0
  11. data/doc/examples/connection_ctor.rb +18 -0
  12. data/doc/examples/connection_default.rb +15 -0
  13. data/doc/examples/connection_exec.rb +18 -0
  14. data/doc/examples/connection_manual.rb +12 -0
  15. data/doc/examples/connection_wrapped_new.rb +13 -0
  16. data/doc/examples/connection_wrapped_open.rb +13 -0
  17. data/doc/examples/cursor.rb +38 -0
  18. data/doc/examples/include_module.rb +9 -0
  19. data/doc/examples/include_module2.rb +12 -0
  20. data/doc/examples/insert.rb +30 -0
  21. data/doc/examples/insert2.rb +36 -0
  22. data/doc/examples/insert_bytea.rb +16 -0
  23. data/doc/examples/insert_bytea_array.rb +17 -0
  24. data/doc/examples/insert_default_values.rb +16 -0
  25. data/doc/examples/insert_insert.rb +16 -0
  26. data/doc/examples/insert_insert_default.rb +16 -0
  27. data/doc/examples/insert_insert_select.rb +20 -0
  28. data/doc/examples/insert_select.rb +20 -0
  29. data/doc/examples/interval.rb +17 -0
  30. data/doc/examples/savepoint.rb +38 -0
  31. data/doc/examples/select.rb +33 -0
  32. data/doc/examples/select2.rb +36 -0
  33. data/doc/examples/select_cross_join.rb +18 -0
  34. data/doc/examples/select_distinct.rb +18 -0
  35. data/doc/examples/select_distinct_on +19 -0
  36. data/doc/examples/select_for_update.rb +18 -0
  37. data/doc/examples/select_from.rb +17 -0
  38. data/doc/examples/select_from_subselect.rb +20 -0
  39. data/doc/examples/select_group_by.rb +19 -0
  40. data/doc/examples/select_having.rb +20 -0
  41. data/doc/examples/select_join_on.rb +18 -0
  42. data/doc/examples/select_join_using.rb +18 -0
  43. data/doc/examples/select_limit.rb +19 -0
  44. data/doc/examples/select_natural_join.rb +18 -0
  45. data/doc/examples/select_offset.rb +19 -0
  46. data/doc/examples/select_order_by.rb +20 -0
  47. data/doc/examples/select_select.rb +30 -0
  48. data/doc/examples/select_select_alias.rb +30 -0
  49. data/doc/examples/select_select_expression.rb +31 -0
  50. data/doc/examples/select_select_literal.rb +24 -0
  51. data/doc/examples/select_union.rb +21 -0
  52. data/doc/examples/select_where_array.rb +18 -0
  53. data/doc/examples/select_where_in.rb +18 -0
  54. data/doc/examples/select_where_string.rb +18 -0
  55. data/doc/examples/simple.rb +34 -0
  56. data/doc/examples/transaction.rb +30 -0
  57. data/doc/examples/transaction_abort.rb +30 -0
  58. data/doc/examples/transaction_commit.rb +34 -0
  59. data/doc/examples/translate_substitute_values.rb +17 -0
  60. data/doc/examples/update.rb +32 -0
  61. data/doc/examples/update2.rb +44 -0
  62. data/doc/examples/update_only.rb +17 -0
  63. data/doc/examples/update_set.rb +17 -0
  64. data/doc/examples/update_set_array.rb +16 -0
  65. data/doc/examples/update_set_bytea.rb +16 -0
  66. data/doc/examples/update_set_expression.rb +16 -0
  67. data/doc/examples/update_set_subselect.rb +20 -0
  68. data/doc/examples/update_where.rb +17 -0
  69. data/doc/examples/use_prefix.rb +8 -0
  70. data/doc/examples/use_prefix2.rb +11 -0
  71. data/doc/index.html +31 -0
  72. data/doc/insertexamples.rb +9 -0
  73. data/doc/makemanual +4 -0
  74. data/doc/makerdoc +5 -0
  75. data/doc/manual.dbk +622 -0
  76. data/lib/sqlpostgres/Connection.rb +198 -0
  77. data/lib/sqlpostgres/Cursor.rb +157 -0
  78. data/lib/sqlpostgres/Delete.rb +67 -0
  79. data/lib/sqlpostgres/Exceptions.rb +15 -0
  80. data/lib/sqlpostgres/Insert.rb +279 -0
  81. data/lib/sqlpostgres/NullConnection.rb +22 -0
  82. data/lib/sqlpostgres/PgBit.rb +73 -0
  83. data/lib/sqlpostgres/PgBox.rb +37 -0
  84. data/lib/sqlpostgres/PgCidr.rb +21 -0
  85. data/lib/sqlpostgres/PgCircle.rb +75 -0
  86. data/lib/sqlpostgres/PgInet.rb +21 -0
  87. data/lib/sqlpostgres/PgInterval.rb +208 -0
  88. data/lib/sqlpostgres/PgLineSegment.rb +37 -0
  89. data/lib/sqlpostgres/PgMacAddr.rb +21 -0
  90. data/lib/sqlpostgres/PgPath.rb +64 -0
  91. data/lib/sqlpostgres/PgPoint.rb +65 -0
  92. data/lib/sqlpostgres/PgPolygon.rb +56 -0
  93. data/lib/sqlpostgres/PgTime.rb +77 -0
  94. data/lib/sqlpostgres/PgTimeWithTimeZone.rb +98 -0
  95. data/lib/sqlpostgres/PgTimestamp.rb +93 -0
  96. data/lib/sqlpostgres/PgTwoPoints.rb +54 -0
  97. data/lib/sqlpostgres/PgType.rb +34 -0
  98. data/lib/sqlpostgres/PgWrapper.rb +41 -0
  99. data/lib/sqlpostgres/Savepoint.rb +98 -0
  100. data/lib/sqlpostgres/Select.rb +855 -0
  101. data/lib/sqlpostgres/Transaction.rb +120 -0
  102. data/lib/sqlpostgres/Translate.rb +436 -0
  103. data/lib/sqlpostgres/Update.rb +188 -0
  104. data/lib/sqlpostgres.rb +67 -0
  105. data/test/Assert.rb +72 -0
  106. data/test/Connection.test.rb +246 -0
  107. data/test/Cursor.test.rb +190 -0
  108. data/test/Delete.test.rb +68 -0
  109. data/test/Insert.test.rb +123 -0
  110. data/test/MockPGconn.rb +62 -0
  111. data/test/NullConnection.test.rb +32 -0
  112. data/test/PgBit.test.rb +98 -0
  113. data/test/PgBox.test.rb +108 -0
  114. data/test/PgCidr.test.rb +61 -0
  115. data/test/PgCircle.test.rb +107 -0
  116. data/test/PgInet.test.rb +61 -0
  117. data/test/PgInterval.test.rb +180 -0
  118. data/test/PgLineSegment.test.rb +108 -0
  119. data/test/PgMacAddr.test.rb +61 -0
  120. data/test/PgPath.test.rb +106 -0
  121. data/test/PgPoint.test.rb +100 -0
  122. data/test/PgPolygon.test.rb +95 -0
  123. data/test/PgTime.test.rb +120 -0
  124. data/test/PgTimeWithTimeZone.test.rb +117 -0
  125. data/test/PgTimestamp.test.rb +134 -0
  126. data/test/RandomThings.rb +25 -0
  127. data/test/Savepoint.test.rb +286 -0
  128. data/test/Select.test.rb +930 -0
  129. data/test/Test.rb +62 -0
  130. data/test/TestConfig.rb +21 -0
  131. data/test/TestSetup.rb +13 -0
  132. data/test/TestUtil.rb +92 -0
  133. data/test/Transaction.test.rb +275 -0
  134. data/test/Translate.test.rb +354 -0
  135. data/test/Update.test.rb +227 -0
  136. data/test/roundtrip.test.rb +565 -0
  137. data/test/test +34 -0
  138. data/tools/exampleinserter/ExampleInserter.rb +177 -0
  139. data/tools/rdoc/ChangeLog +796 -0
  140. data/tools/rdoc/EXAMPLE.rb +48 -0
  141. data/tools/rdoc/MANIFEST +58 -0
  142. data/tools/rdoc/Makefile +27 -0
  143. data/tools/rdoc/NEW_FEATURES +226 -0
  144. data/tools/rdoc/README +390 -0
  145. data/tools/rdoc/ToDo +6 -0
  146. data/tools/rdoc/contrib/Index +6 -0
  147. data/tools/rdoc/contrib/xslfo/ChangeLog +181 -0
  148. data/tools/rdoc/contrib/xslfo/README +106 -0
  149. data/tools/rdoc/contrib/xslfo/TODO +10 -0
  150. data/tools/rdoc/contrib/xslfo/convert.xsl +151 -0
  151. data/tools/rdoc/contrib/xslfo/demo/README +21 -0
  152. data/tools/rdoc/contrib/xslfo/demo/rdocfo +99 -0
  153. data/tools/rdoc/contrib/xslfo/fcm.xsl +54 -0
  154. data/tools/rdoc/contrib/xslfo/files.xsl +62 -0
  155. data/tools/rdoc/contrib/xslfo/labeled-lists.xsl +66 -0
  156. data/tools/rdoc/contrib/xslfo/lists.xsl +44 -0
  157. data/tools/rdoc/contrib/xslfo/modules.xsl +152 -0
  158. data/tools/rdoc/contrib/xslfo/rdoc.xsl +75 -0
  159. data/tools/rdoc/contrib/xslfo/source.xsl +66 -0
  160. data/tools/rdoc/contrib/xslfo/styles.xsl +69 -0
  161. data/tools/rdoc/contrib/xslfo/tables.xsl +67 -0
  162. data/tools/rdoc/contrib/xslfo/utils.xsl +21 -0
  163. data/tools/rdoc/debian/changelog +33 -0
  164. data/tools/rdoc/debian/compat +1 -0
  165. data/tools/rdoc/debian/control +20 -0
  166. data/tools/rdoc/debian/copyright +10 -0
  167. data/tools/rdoc/debian/dirs +2 -0
  168. data/tools/rdoc/debian/docs +2 -0
  169. data/tools/rdoc/debian/rdoc.1 +252 -0
  170. data/tools/rdoc/debian/rdoc.manpages +1 -0
  171. data/tools/rdoc/debian/rdoc.pod +149 -0
  172. data/tools/rdoc/debian/rules +9 -0
  173. data/tools/rdoc/dot/dot.rb +255 -0
  174. data/tools/rdoc/etc/rdoc.dtd +203 -0
  175. data/tools/rdoc/install.rb +137 -0
  176. data/tools/rdoc/markup/install.rb +43 -0
  177. data/tools/rdoc/markup/sample/sample.rb +42 -0
  178. data/tools/rdoc/markup/simple_markup/fragments.rb +323 -0
  179. data/tools/rdoc/markup/simple_markup/inline.rb +348 -0
  180. data/tools/rdoc/markup/simple_markup/lines.rb +147 -0
  181. data/tools/rdoc/markup/simple_markup/preprocess.rb +68 -0
  182. data/tools/rdoc/markup/simple_markup/to_html.rb +281 -0
  183. data/tools/rdoc/markup/simple_markup.rb +474 -0
  184. data/tools/rdoc/markup/test/AllTests.rb +2 -0
  185. data/tools/rdoc/markup/test/TestInline.rb +151 -0
  186. data/tools/rdoc/markup/test/TestParse.rb +411 -0
  187. data/tools/rdoc/rdoc/code_objects.rb +536 -0
  188. data/tools/rdoc/rdoc/diagram.rb +331 -0
  189. data/tools/rdoc/rdoc/generators/chm_generator.rb +112 -0
  190. data/tools/rdoc/rdoc/generators/html_generator.rb +1268 -0
  191. data/tools/rdoc/rdoc/generators/template/chm/chm.rb +86 -0
  192. data/tools/rdoc/rdoc/generators/template/html/html.rb +705 -0
  193. data/tools/rdoc/rdoc/generators/template/html/kilmer.rb +377 -0
  194. data/tools/rdoc/rdoc/generators/template/xml/rdf.rb +110 -0
  195. data/tools/rdoc/rdoc/generators/template/xml/xml.rb +110 -0
  196. data/tools/rdoc/rdoc/generators/xml_generator.rb +130 -0
  197. data/tools/rdoc/rdoc/options.rb +451 -0
  198. data/tools/rdoc/rdoc/parsers/parse_c.rb +287 -0
  199. data/tools/rdoc/rdoc/parsers/parse_f95.rb +118 -0
  200. data/tools/rdoc/rdoc/parsers/parse_rb.rb +2311 -0
  201. data/tools/rdoc/rdoc/parsers/parse_simple.rb +37 -0
  202. data/tools/rdoc/rdoc/parsers/parserfactory.rb +75 -0
  203. data/tools/rdoc/rdoc/rdoc.rb +219 -0
  204. data/tools/rdoc/rdoc/template.rb +234 -0
  205. data/tools/rdoc/rdoc/tokenstream.rb +25 -0
  206. data/tools/rdoc/rdoc.rb +9 -0
  207. metadata +291 -0
data/tools/rdoc/README ADDED
@@ -0,0 +1,390 @@
1
+ = RDOC - Ruby Documentation System
2
+
3
+ This package contains Rdoc and SimpleMarkup. Rdoc is an application
4
+ that produces documentation for one or more Ruby source files. We work
5
+ similarly to JavaDoc, parsing the source, and extracting the
6
+ definition for classes, modules, and methods (along with includes and
7
+ requires). We associate with these optional documentation contained
8
+ in the immediately preceding comment block, and then render the result
9
+ using a pluggable output formatter. (Currently, HTML is the only
10
+ supported format. Markup is a library that converts plain text into
11
+ various output formats. The Markup library is used to interpret the
12
+ comment blocks that Rdoc uses to document methods, classes, and so on.
13
+
14
+
15
+ == Installation
16
+
17
+ This distribution contains two packages, rdoc itself and a text markup
18
+ library, 'markup'. You can install them both using the single command
19
+
20
+ % ruby install.rb
21
+
22
+ in this directory. If you just want to install 'markup', change to the
23
+ markup directory and run the install.rb script there.
24
+
25
+
26
+ == Roadmap
27
+
28
+ * If you want to use Rdoc to create documentation for your Ruby source
29
+ files, read on.
30
+ * If you want to include extensions written in C, see rdoc/parsers/parse_c.rb.
31
+ * For information on the various markups available in comment
32
+ blocks, see markup/simple_markup.rb.
33
+ * If you want to drive Rdoc programatically, see RDoc::RDoc.
34
+ * If you want to use the library to format text blocks into HTML,
35
+ have a look at SM::SimpleMarkup.
36
+ * If you want to try writing your own HTML output template, see
37
+ RDoc::Page.
38
+
39
+ == Summary
40
+
41
+ Once installed, you can create documentation using the 'rdoc' command
42
+ (the command is 'rdoc.rb' under Windows)
43
+
44
+ % rdoc [options] [names...]
45
+
46
+ Type "rdoc --help" for an up-to-date option summary.
47
+
48
+ A typical use might be to generate documentation for a package of Ruby
49
+ source (such as rdoc itself).
50
+
51
+ % rdoc
52
+
53
+ This command generates documentation for all the Ruby and C source
54
+ files in and below the current directory. These will be stored in a
55
+ documentation tree starting in the subdirectory 'doc'.
56
+
57
+ You can make this slightly more useful for your readers by having the
58
+ index page contain the documentation for the primary file. In our
59
+ case, we could type
60
+
61
+ % rdoc --main rdoc/rdoc.rb
62
+
63
+ You'll find information on the various formatting tricks you can use
64
+ in comment blocks in the documentation this generates.
65
+
66
+ RDoc uses file extensions to determine how to process each file. File
67
+ names ending <tt>.rb</tt> and <tt>.rbw</tt> are assumed to be Ruby
68
+ source. Files ending <tt>.c</tt> are parsed as C files. All other
69
+ files are assumed to contain just SimpleMarkup-style markup (with or
70
+ without leading '#' comment markers). If directory names are passed to
71
+ RDoc, they are scanned recursively for C and Ruby source files only.
72
+
73
+ == Credits
74
+
75
+ * The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
76
+ work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
77
+ parser for irb and the rtags package.
78
+
79
+ * Code to diagram classes and modules was written by Sergey A Yanovitsky
80
+ (Jah) of Enticla.
81
+
82
+ * Charset patch from MoonWolf.
83
+
84
+ * Rich Kilmer wrote the kilmer.rb output template.
85
+
86
+ * Dan Brickley led the design of the RDF format.
87
+
88
+ == License
89
+
90
+ RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers. It
91
+ is free software, and may be redistributed under the terms specified
92
+ in the README file of the Ruby distribution.
93
+
94
+
95
+ == Support
96
+
97
+ The Rdoc homepage is http://rdoc.sourceforge.net. There you'll find
98
+ links for downloading the Rdoc package, and instructions on how to get
99
+ the still-quivering sources from CVS. I'm also using Sourceforge to
100
+ track bugs and manage feature requests. If you submit patches, it
101
+ would help if they were inline (not attachments) and generated using
102
+ "diff -u". I don't have access to a wide variety of browsers, so
103
+ reports that output looks funny under Browser XYZ aren't too helpful:
104
+ far better are suggested changes to the generated HTML that fix the
105
+ problem.
106
+
107
+ For other information, feel free to ask on the ruby-talk mailing list
108
+ (which is mirrored to comp.lang.ruby) or contact
109
+ mailto:dave@pragmaticprogrammer.com.
110
+
111
+ ----
112
+
113
+ = Usage
114
+
115
+ RDoc is invoked from the command line using:
116
+
117
+ % rdoc <options> [name...]
118
+
119
+ Files are parsed, and the information they contain collected, before
120
+ any output is produced. This allows cross references between all files
121
+ to be resolved. If a name is a directory, it is traversed. If no
122
+ names are specified, all Ruby files in the current directory (and
123
+ subdirectories) are processed.
124
+
125
+ Options are:
126
+
127
+ [<tt>--all</tt>]
128
+ include protected and private methods in the output (by default
129
+ only public methods are included)
130
+
131
+ [<tt>--main</tt> _name_]
132
+ set the class, module, or file to appear on the index page
133
+
134
+ [<tt>--exclude</tt> <i>pattern</i>]
135
+ exclude files and directories matching this pattern from processing
136
+
137
+ [<tt>--quiet</tt>]
138
+ do not display progress messages
139
+
140
+ [<tt>--one-file</tt>]
141
+ place all the output into a single file
142
+
143
+ [<tt>--op</tt> _dir_]
144
+ set the output directory to _dir_ (the default is the directory
145
+ "doc")
146
+
147
+ [<tt>--opname</tt> _name_]
148
+ set the output name (has no effect for HTML).
149
+
150
+ [<tt>--charset</tt> _charset_]
151
+ Set the character set for the generated HTML.
152
+
153
+ [<tt>--fmt</tt> _fmt_]
154
+ generate output in a particular format.
155
+
156
+ [<tt>--include</tt> <i>dir,...</i>]
157
+ specify one or more directories to be searched when satifying
158
+ :include: directives. Multiple <tt>--include</tt> options may be
159
+ given. The directory containing the file currently being processed
160
+ is always searched.
161
+
162
+ [<tt>--inline-source</tt>]
163
+ By default, the source code of methods is shown in a popup. With
164
+ this option, it's displayed inline.
165
+
166
+ [<tt>--show-hash</tt>]
167
+ A name of the form #name in a comment is a possible hyperlink to
168
+ an instance method name. When displayed, the '#' is removed unless
169
+ this option is specified
170
+
171
+ [<tt>--template</tt> <i>name</i>]
172
+ specify an alternate template to use when generating output (the
173
+ default is 'standard'). This template should be in a directory
174
+ accessible via $: as rdoc/generators/xxxx_template, where 'xxxx'
175
+ depends on the output formatter.
176
+
177
+ [<tt>--diagram</tt>]
178
+ include diagrams showing modules and classes. This is currently
179
+ an experimental feature, and may not be supported by all output
180
+ templates. You need dot V1.8.6 or later to use the --diagram
181
+ option correctly (http://www.research.att.com/sw/tools/graphviz/).
182
+
183
+ = Example
184
+
185
+ A typical small Ruby program commented using RDoc might be as follows. You
186
+ can see the formatted result in EXAMPLE.rb and Anagram.
187
+
188
+ :include: EXAMPLE.rb
189
+
190
+ = Markup
191
+
192
+ Comment blocks can be written fairly naturally.
193
+
194
+ Paragraphs are lines that share the left margin. Text indented past
195
+ this margin are formatted verbatim.
196
+
197
+ 1. Lists are typed as indented paragraphs with:
198
+ * a '*' or '-' (for bullet lists)
199
+ * a digit followed by a period for
200
+ numbered lists
201
+
202
+ For example, the input that produced the above paragraph looked like
203
+ 1. Lists are typed as indented
204
+ paragraphs with:
205
+ * a '*' or '-' (for bullet lists)
206
+ * a digit followed by a period for
207
+ numbered lists
208
+
209
+ 2. Labeled lists (sometimes called description
210
+ lists) are typed using square brackets for the label.
211
+ [cat] small domestic animal
212
+ [+cat+] command to copy standard input
213
+
214
+ 3. Labeled lists may also be produced by putting a double colon
215
+ after the label. This sets the result in tabular form, so the
216
+ descriptions all line up. This was used to create the 'author'
217
+ block at the bottom of this description.
218
+ cat:: small domestic animal
219
+ +cat+:: command to copy standard input
220
+
221
+ For both kinds of labeled lists, if the body text starts on the same
222
+ line as the label, then the start of that text determines the block
223
+ indent for the rest of the body. The text may also start on the line
224
+ following the label, indented from the start of the label. This is
225
+ often preferable if the label is long. Both the following are
226
+ valid labeled list entries:
227
+
228
+ <tt>--output</tt> <i>name [, name]</i>::
229
+ specify the name of one or more output files. If multiple
230
+ files are present, the first is used as the index.
231
+
232
+ <tt>--quiet:</tt>:: do not output the names, sizes, byte counts,
233
+ index areas, or bit ratios of units as
234
+ they are processed.
235
+
236
+ 4. Headings are entered using equals signs
237
+
238
+ = Level One Heading
239
+ == Level Two Heading
240
+ and so on
241
+
242
+ 5. Rules (horizontal lines) are entered using three or
243
+ more hyphens.
244
+
245
+ 6. Non-verbatim text can be marked up:
246
+
247
+ _italic_:: \_word_ or \<em>text</em>
248
+ *bold*:: \*word* or \<b>text</b>
249
+ +typewriter+:: \+word+ or \<tt>text</tt>
250
+
251
+ The first form only works around 'words', where a word is a
252
+ sequence of upper and lower case letters and underscores. Putting a
253
+ backslash before inline markup stops it being interpreted, which is
254
+ how I created the table above:
255
+
256
+ _italic_:: \_word_ or \<em>text</em>
257
+ *bold*:: \*word* or \<b>text</b>
258
+ +typewriter+:: \+word+ or \<tt>text</tt>
259
+
260
+ 7. Names of classes, source files, and any method names
261
+ containing an underscore or preceded by a hash
262
+ character are automatically hyperlinked from
263
+ comment text to their description.
264
+
265
+ 8. Hyperlinks to the web starting http:, mailto:, ftp:, or www. are
266
+ recognized. An HTTP url that references an external image file is
267
+ converted into an inline <IMG..>. Hyperlinks starting 'link:' are
268
+ assumed to refer to local files whose path is relative to the --op
269
+ directory.
270
+
271
+ Hyperlinks can also be of the form <tt>label</tt>[url], in which
272
+ case the label is used in the displayed text, and <tt>url</tt> is
273
+ used as the target.
274
+
275
+ 9. Method parameter lists are extracted and displayed with
276
+ the method description. If a method calls +yield+, then
277
+ the parameters passed to yield will also be displayed:
278
+
279
+ def fred
280
+ ...
281
+ yield line, address
282
+
283
+ This will get documented as
284
+
285
+ fred() { |line, address| ... }
286
+
287
+ You can override this using a comment containing
288
+ ':yields: ...' immediately after the method definition
289
+
290
+ def fred # :yields: index, position
291
+ ...
292
+ yield line, address
293
+
294
+ which will get documented as
295
+
296
+ fred() { |index, position| ... }
297
+
298
+
299
+ 10. ':yields:' is an example of a documentation modifier. These appear
300
+ immediately after the start of the document element they are modifying.
301
+ Other modifiers include
302
+
303
+ [<tt>:nodoc:</tt><i>[all]</i>]
304
+ don't include this element in the documentation. For classes
305
+ and modules, the methods, aliases, and attributes directly
306
+ within the affected class or module will also be omitted. By
307
+ default, though, modules and classes within that class of
308
+ module _will_ be documented. This is turned off by adding the
309
+ +all+ modifier.
310
+
311
+ module SM #:nodoc:
312
+ class Input
313
+ end
314
+ end
315
+ module Markup #:nodoc: all
316
+ class Output
317
+ end
318
+ end
319
+
320
+ In the above code, only class <tt>SM::Input</tt> will be
321
+ documented.
322
+
323
+ [<tt>:doc:</tt>]
324
+ force a method or attribute to be documented even if it
325
+ wouldn't otherwise be. Useful is, for example, you want to
326
+ include documentation of a particular private method.
327
+
328
+ [<tt>:notnew:</tt>]
329
+ only applicable to the +initialize+ instance method. Normally
330
+ RDoc assumes that the documentation and parameters for
331
+ #initialize are actually for the ::new method, and so fakes
332
+ out a ::new for the class. THe :notnew: modifier stops
333
+ this. Remember that #initialize is protected, so you won't
334
+ see the documentation unless you use the -a command line
335
+ option.
336
+
337
+
338
+ 11. RDoc stops processing comments if it finds a comment
339
+ line containing '<tt>#--</tt>'. This can be used to
340
+ separate external from internal comments, or
341
+ to stop a comment being associated with a method,
342
+ class, or module. Commenting can be turned back on with
343
+ a line that starts '<tt>#++</tt>'.
344
+
345
+ # Extract the age and calculate the
346
+ # date-of-birth.
347
+ #--
348
+ # FIXME: fails if the birthday falls on
349
+ # February 29th
350
+ #++
351
+ # The DOB is returned as a Time object.
352
+
353
+ def get_dob(person)
354
+ ...
355
+
356
+ 12. Comment blocks can contain other directives:
357
+
358
+ [<tt>:include:</tt><i>filename</i>]
359
+ include the contents of the named file at this point. The
360
+ file will be searched for in the directories listed by
361
+ the <tt>--include</tt> option, or in the current
362
+ directory by default. The contents of the file will be
363
+ shifted to have the same indentation as the ':' at the
364
+ start of the :include: directive.
365
+
366
+ [<tt>:title:</tt><i>text</i>]
367
+ Sets the title for the document. Equivalent to the --title command
368
+ line parameter. (The command line parameter overrides any :title:
369
+ directive in the source).
370
+
371
+ [<tt>:main:</tt><i>name</i>]
372
+ Equivalent to the --main command line parameter.
373
+
374
+ ---
375
+
376
+ See also markup/simple_markup.rb.
377
+
378
+ = Other stuff
379
+
380
+ Author:: Dave Thomas <dave@pragmaticprogrammer.com>
381
+ Requires:: Ruby 1.6.5 or later
382
+ License:: Copyright (c) 2001-2003 Dave Thomas.
383
+ Released under the same license as Ruby.
384
+
385
+ == Warranty
386
+
387
+ This software is provided "as is" and without any express or
388
+ implied warranties, including, without limitation, the implied
389
+ warranties of merchantibility and fitness for a particular
390
+ purpose.
data/tools/rdoc/ToDo ADDED
@@ -0,0 +1,6 @@
1
+ - the current HTML output is not particularly portable. I need someone
2
+ who knows browsers to come up with some HTML that works everywhere.
3
+
4
+ - add XML export (to drive UML generation tools among other things)
5
+
6
+ - tidy parse.rb
@@ -0,0 +1,6 @@
1
+ Contributions to RDoc:
2
+
3
+ xslfo/ Support for Formatting Objects, allowing RDoc to generate
4
+ output in PDF, PostScript, etc
5
+
6
+
@@ -0,0 +1,181 @@
1
+ 2002-03-20 18:42 wobblini
2
+
3
+ * convert.xsl, fcm.xsl, files.xsl, labeled-lists.xsl, modules.xsl,
4
+ rdoc.xsl, source.xsl:
5
+ More tweaking of two-layered XSLT processing.
6
+
7
+ 2002-03-20 18:41 wobblini
8
+
9
+ * TODO:
10
+ TODO file started
11
+
12
+ 2002-03-18 19:57 wobblini
13
+
14
+ * convert.xsl, fcm.xsl, files.xsl, modules.xsl, rdoc.xsl,
15
+ source.xsl, styles.xsl:
16
+ Further changes in connection with doing two XSL transformations
17
+
18
+ 2002-03-17 21:38 wobblini
19
+
20
+ * lists.xsl:
21
+ added CVS header
22
+
23
+ 2002-03-17 21:36 wobblini
24
+
25
+ * lists.xsl:
26
+ should have been added before
27
+
28
+ 2002-03-17 21:28 wobblini
29
+
30
+ * ChangeLog:
31
+ minor changes
32
+
33
+ 2002-03-17 21:28 wobblini
34
+
35
+ * demo/rdocfo:
36
+ typo
37
+
38
+ 2002-03-17 21:26 wobblini
39
+
40
+ * demo/rdocfo:
41
+ typo correction
42
+
43
+ 2002-03-17 21:24 wobblini
44
+
45
+ * demo/: README, rdocfo:
46
+ rdocfo -- script to (semi-)automate XSL-FO production with Saxon.
47
+
48
+ 2002-03-17 17:01 wobblini
49
+
50
+ * README:
51
+ minor changes
52
+
53
+ 2002-03-17 16:33 wobblini
54
+
55
+ * README, fcm.xsl, files.xsl, labeled-lists.xsl, modules.xsl,
56
+ rdoc.xsl, source.xsl, styles.xsl:
57
+ Now using two transformations (see convert.xsl). Handling of IDs
58
+ and cross-refs more nicely parameterized.
59
+
60
+ 2002-03-17 16:32 wobblini
61
+
62
+ * convert.xsl:
63
+ Converts from default XML output to intermediate XML for input to
64
+ stylesheets.
65
+
66
+ 2002-03-12 11:57 wobblini
67
+
68
+ * files.xsl, labeled-lists.xsl, modules.xsl, rdoc.xsl, source.xsl:
69
+ some further fine-tuning to get links working (most are)
70
+
71
+ 2002-03-11 17:12 wobblini
72
+
73
+ * ChangeLog, fcm.xsl, files.xsl, labeled-lists.xsl, modules.xsl,
74
+ rdoc.xsl, source.xsl, styles.xsl, tables.xsl:
75
+ more minor changes. normalized font sizes to "pt" values.
76
+
77
+ 2002-03-10 17:45 wobblini
78
+
79
+ * labeled-lists.xsl:
80
+ New file with some old templates (refactoring file-wise).
81
+
82
+ 2002-03-10 16:58 wobblini
83
+
84
+ * fcm.xsl, files.xsl, modules.xsl, rdoc.xsl, source.xsl,
85
+ styles.xsl, tables.xsl:
86
+ Continued work on start-indent and margin-left problems, especially
87
+ with tables and lists. Beginnings of PDF links (working for master
88
+ file list, not for anything else).
89
+
90
+ 2002-03-06 16:11 wobblini
91
+
92
+ * README:
93
+ Additional info on what you get in your XSL-FO file
94
+
95
+ 2002-03-06 16:06 wobblini
96
+
97
+ * ChangeLog:
98
+ update
99
+
100
+ 2002-03-06 16:05 wobblini
101
+
102
+ * source.xsl:
103
+ Handle source-code-listing elements in Class and Module elements
104
+
105
+ 2002-03-06 16:04 wobblini
106
+
107
+ * files.xsl, modules.xsl, rdoc.xsl, styles.xsl:
108
+ Some refactoring, file-wise. Also continued tinkering with
109
+ start-indent vs. left-margin.
110
+
111
+ 2002-03-06 16:03 wobblini
112
+
113
+ * fcm.xsl:
114
+ common template for file, class, module
115
+
116
+ 2002-03-03 19:27 wobblini
117
+
118
+ * README:
119
+ Typo corrections
120
+
121
+ 2002-03-03 18:02 pragdave
122
+
123
+ * README: Convert to Simple Markup
124
+
125
+ 2002-03-03 08:40 wobblini
126
+
127
+ * ChangeLog:
128
+ Now producing automated ChangeLog with cvs2cl.pl.
129
+
130
+ 2002-03-03 08:36 wobblini
131
+
132
+ * ChangeLog: [no log message]
133
+
134
+ 2002-03-03 08:31 wobblini
135
+
136
+ * tables.xsl:
137
+ Added missing <fo:table-body> elements.
138
+
139
+ 2002-03-03 08:30 wobblini
140
+
141
+ * README: [no log message]
142
+
143
+ 2002-03-03 08:20 wobblini
144
+
145
+ * modules.xsl:
146
+ Changed attribute-name to @name, as per change in the DTD.
147
+
148
+ 2002-03-02 23:33 wobblini
149
+
150
+ * ChangeLog: [no log message]
151
+
152
+ 2002-03-02 23:30 wobblini
153
+
154
+ * ChangeLog, files.xsl, modules.xsl, rdoc.xsl, tables.xsl:
155
+ Added XSL tables to handle <table> and <dl> elements.
156
+
157
+ 2002-03-02 22:20 wobblini
158
+
159
+ * modules.xsl, styles.xsl:
160
+ Getting the initial CVS commit right
161
+
162
+ 2002-03-02 22:19 wobblini
163
+
164
+ * files.xsl:
165
+ Minor changes
166
+
167
+ 2002-03-02 17:20 wobblini
168
+
169
+ * rdoc.xsl, styles.xsl, modules.xsl:
170
+ part of XSL-FO stylesheet suite
171
+
172
+ 2002-03-02 17:20 wobblini
173
+
174
+ * files.xsl:
175
+ part of XSL-FO suite
176
+
177
+ 2002-03-02 17:18 wobblini
178
+
179
+ * README:
180
+ Adding XSL-FO files to contrib/xslfo subdirectory.
181
+
@@ -0,0 +1,106 @@
1
+ = XSL-FO (Formatting Object) stylesheets for RDoc
2
+
3
+
4
+ == WHAT
5
+
6
+ This package provides XSL-FO transformation stylesheets to transform
7
+ RDoc XML output into XSL formatting object (XSL-FO) files. These
8
+ files, in turn, can be processed to produce PDF, DVI, PostScript, and
9
+ other types of output suitable for printing or viewing.
10
+
11
+ The output you'll get (the XSL-FO file) is organized like this:
12
+
13
+ Title page
14
+ Files:
15
+ - list of files
16
+ - entry for each file with info and description
17
+ Classes:
18
+ - list of classes
19
+ - entry for each class
20
+ Modules:
21
+ - list of modules
22
+ - entry for each module
23
+ Source code for classes (sorted by class/method)
24
+ Source code for modules (sorted by module/method)
25
+
26
+
27
+ == WHY
28
+
29
+ XSL-FO is mainly for producing nicely formatted printed output. The
30
+ goal of these stylesheets is to enable people to do exactly that, with
31
+ RDoc output. You can also create a PDF version of RDoc output. The
32
+ PDF version includes internal links among files, classes, methods, and
33
+ source code.
34
+
35
+
36
+ == HOW
37
+
38
+ To use these stylesheets, you need an XSLT processor, such as Michael
39
+ Kay's Saxon (http://saxon.sourceforge.net). You also need a
40
+ post-processor for the XSL-FO files. I've developed the stylesheets
41
+ using PassiveTeX by Sebastian Rahtz. PassiveTeX produces DVI files
42
+ from XSL files; it also works in tandem with pdflatex to produce PDF
43
+ output from XSL-FO input.
44
+
45
+ Once you have the necessary tools in place, here's (an example of)
46
+ what to do.
47
+
48
+ 1. Create an RDoc XML file:
49
+
50
+ rdoc --fmt xml > myfile.xml
51
+
52
+ 2. Run Saxon twice: first, on the existing XML file (which produces a
53
+ new XML file, which is needed by the XSL-FO stylesheets); second,
54
+ on the new XML file:
55
+
56
+ java com.icl.saxon.StyleSheet myfile.xml /path/to/convert.xsl > second.xml
57
+ java com.icl.saxon.StyleSheet second.xml /path/to/rdoc.xsl > myfile.fo
58
+
59
+ (Replace "/path/to/" with whatever's appropriate, of course.)
60
+
61
+ Now you have a file full of XSL-FO objects, in "myfile.fo".
62
+
63
+ 4. Run your postprocessing software on your .fo file. For example, to
64
+ use PassiveTeX you would put this in a file (myfile.tex, say):
65
+
66
+ \def\xmlfile{myfile.fo}
67
+ \input xmltex.tex
68
+ \end{document}
69
+
70
+ and run LaTeX on it. That will produce a DVI file (myfile.dvi).
71
+
72
+ 5. To get PDF output:
73
+
74
+ pdflatex "&pdfxmltex" myfile.fo
75
+
76
+ which will produce myfile.pdf. You can also use the above myfile.tex
77
+ file and run:
78
+
79
+ pdflatex myfile
80
+
81
+ 6. You can also run your .fo file through FOP, Apache's XSL-FO
82
+ processor (http://xml.apache.org/fop) or any other XSL-FO
83
+ processor. Note that FOP and PassiveTeX produce somewhat
84
+ different results.
85
+
86
+ 7. In the demo subdirectory, there's also a script called rdocfo,
87
+ which semi-automates the processing. Run "rdocfo -h" to see
88
+ some options.
89
+
90
+
91
+ == WHO
92
+
93
+ The RDoc XSL stylesheets are written and maintained by David Alan Black
94
+ (dblack@candle.superlink.net). Feedback is welcome.
95
+
96
+
97
+ == STILL TO COME
98
+
99
+ See TODO.
100
+
101
+
102
+ ==== CVS info
103
+
104
+ $Id: README,v 1.1 2003/10/10 08:00:05 wconrad Exp $
105
+ $Author: wconrad $
106
+
@@ -0,0 +1,10 @@
1
+ XSL-FO stylesheets for RDoc
2
+ David Alan Black
3
+
4
+ $Id: TODO,v 1.1 2003/10/10 08:00:05 wconrad Exp $
5
+ $Author: wconrad $
6
+
7
+
8
+ * Method descriptions aren't being handled (oversight).
9
+ * Source code annoying doesn't do line breaks on consecutive keywords
10
+