rdoc 3.1 → 6.3.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rdoc might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/CONTRIBUTING.rdoc +220 -0
- data/CVE-2013-0256.rdoc +49 -0
- data/ExampleMarkdown.md +37 -0
- data/ExampleRDoc.rdoc +208 -0
- data/Gemfile +12 -0
- data/History.rdoc +1666 -0
- data/LEGAL.rdoc +50 -0
- data/LICENSE.rdoc +57 -0
- data/README.rdoc +129 -0
- data/RI.rdoc +57 -0
- data/Rakefile +84 -81
- data/TODO.rdoc +59 -0
- data/bin/console +7 -0
- data/bin/setup +6 -0
- data/{bin → exe}/rdoc +11 -2
- data/exe/ri +12 -0
- data/lib/rdoc/alias.rb +1 -2
- data/lib/rdoc/anon_class.rb +3 -2
- data/lib/rdoc/any_method.rb +234 -40
- data/lib/rdoc/attr.rb +79 -11
- data/lib/rdoc/class_module.rb +443 -71
- data/lib/rdoc/code_object.rb +216 -20
- data/lib/rdoc/code_objects.rb +4 -21
- data/lib/rdoc/comment.rb +250 -0
- data/lib/rdoc/constant.rb +110 -9
- data/lib/rdoc/context/section.rb +232 -0
- data/lib/rdoc/context.rb +392 -172
- data/lib/rdoc/cross_reference.rb +202 -0
- data/lib/rdoc/encoding.rb +83 -28
- data/lib/rdoc/erb_partial.rb +19 -0
- data/lib/rdoc/erbio.rb +8 -3
- data/lib/rdoc/extend.rb +10 -0
- data/lib/rdoc/generator/darkfish.rb +507 -84
- data/lib/rdoc/generator/json_index.rb +300 -0
- data/lib/rdoc/generator/markup.rb +27 -74
- data/lib/rdoc/generator/pot/message_extractor.rb +68 -0
- data/lib/rdoc/generator/pot/po.rb +84 -0
- data/lib/rdoc/generator/pot/po_entry.rb +141 -0
- data/lib/rdoc/generator/pot.rb +98 -0
- data/lib/rdoc/generator/ri.rb +8 -62
- data/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +22 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +19 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +9 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +15 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +9 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +15 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +15 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +12 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +12 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +11 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +14 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/class.rhtml +172 -0
- data/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +639 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
- data/lib/rdoc/generator/template/darkfish/index.rhtml +18 -60
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +51 -83
- data/lib/rdoc/generator/template/darkfish/js/search.js +110 -0
- data/lib/rdoc/generator/template/darkfish/page.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +62 -0
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +58 -0
- data/lib/rdoc/generator/template/json_index/.document +1 -0
- data/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
- data/lib/rdoc/generator/template/json_index/js/searcher.js +229 -0
- data/lib/rdoc/generator.rb +24 -13
- data/lib/rdoc/ghost_method.rb +1 -2
- data/lib/rdoc/i18n/locale.rb +102 -0
- data/lib/rdoc/i18n/text.rb +126 -0
- data/lib/rdoc/i18n.rb +10 -0
- data/lib/rdoc/include.rb +5 -95
- data/lib/rdoc/known_classes.rb +5 -2
- data/lib/rdoc/markdown/entities.rb +2132 -0
- data/lib/rdoc/markdown/literals.kpeg +23 -0
- data/lib/rdoc/markdown/literals.rb +416 -0
- data/lib/rdoc/markdown.kpeg +1237 -0
- data/lib/rdoc/markdown.rb +16684 -0
- data/lib/rdoc/markup/attr_changer.rb +23 -0
- data/lib/rdoc/markup/attr_span.rb +36 -0
- data/lib/rdoc/markup/attribute_manager.rb +135 -62
- data/lib/rdoc/markup/attributes.rb +71 -0
- data/lib/rdoc/markup/blank_line.rb +1 -0
- data/lib/rdoc/markup/block_quote.rb +15 -0
- data/lib/rdoc/markup/document.rb +96 -9
- data/lib/rdoc/markup/formatter.rb +138 -25
- data/lib/rdoc/markup/hard_break.rb +32 -0
- data/lib/rdoc/markup/heading.rb +61 -2
- data/lib/rdoc/markup/include.rb +43 -0
- data/lib/rdoc/markup/indented_paragraph.rb +48 -0
- data/lib/rdoc/markup/list.rb +25 -4
- data/lib/rdoc/markup/list_item.rb +18 -4
- data/lib/rdoc/markup/paragraph.rb +15 -0
- data/lib/rdoc/markup/parser.rb +180 -88
- data/lib/rdoc/markup/pre_process.rb +183 -38
- data/lib/rdoc/markup/raw.rb +6 -5
- data/lib/rdoc/markup/regexp_handling.rb +41 -0
- data/lib/rdoc/markup/rule.rb +1 -0
- data/lib/rdoc/markup/table.rb +47 -0
- data/lib/rdoc/markup/to_ansi.rb +17 -7
- data/lib/rdoc/markup/to_bs.rb +5 -8
- data/lib/rdoc/markup/to_html.rb +238 -137
- data/lib/rdoc/markup/to_html_crossref.rb +125 -152
- data/lib/rdoc/markup/to_html_snippet.rb +285 -0
- data/lib/rdoc/markup/to_joined_paragraph.rb +47 -0
- data/lib/rdoc/markup/to_label.rb +75 -0
- data/lib/rdoc/markup/to_markdown.rb +192 -0
- data/lib/rdoc/markup/to_rdoc.rb +85 -15
- data/lib/rdoc/markup/to_table_of_contents.rb +89 -0
- data/lib/rdoc/markup/to_test.rb +2 -4
- data/lib/rdoc/markup/to_tt_only.rb +121 -0
- data/lib/rdoc/markup/verbatim.rb +39 -0
- data/lib/rdoc/markup.rb +388 -110
- data/lib/rdoc/meta_method.rb +1 -2
- data/lib/rdoc/method_attr.rb +87 -21
- data/lib/rdoc/mixin.rb +121 -0
- data/lib/rdoc/normal_class.rb +39 -10
- data/lib/rdoc/normal_module.rb +22 -7
- data/lib/rdoc/options.rb +613 -73
- data/lib/rdoc/parser/c.rb +621 -287
- data/lib/rdoc/parser/changelog.rb +335 -0
- data/lib/rdoc/parser/markdown.rb +24 -0
- data/lib/rdoc/parser/rd.rb +23 -0
- data/lib/rdoc/parser/ripper_state_lex.rb +590 -0
- data/lib/rdoc/parser/ruby.rb +1368 -762
- data/lib/rdoc/parser/ruby_tools.rb +42 -35
- data/lib/rdoc/parser/simple.rb +23 -11
- data/lib/rdoc/parser/text.rb +12 -0
- data/lib/rdoc/parser.rb +162 -89
- data/lib/rdoc/rd/block_parser.rb +1056 -0
- data/lib/rdoc/rd/block_parser.ry +639 -0
- data/lib/rdoc/rd/inline.rb +72 -0
- data/lib/rdoc/rd/inline_parser.rb +1208 -0
- data/lib/rdoc/rd/inline_parser.ry +593 -0
- data/lib/rdoc/rd.rb +100 -0
- data/lib/rdoc/rdoc.rb +208 -115
- data/lib/rdoc/require.rb +1 -2
- data/lib/rdoc/ri/driver.rb +734 -239
- data/lib/rdoc/ri/formatter.rb +1 -0
- data/lib/rdoc/ri/paths.rb +91 -48
- data/lib/rdoc/ri/store.rb +3 -261
- data/lib/rdoc/ri/task.rb +71 -0
- data/lib/rdoc/ri.rb +5 -2
- data/lib/rdoc/rubygems_hook.rb +246 -0
- data/lib/rdoc/servlet.rb +451 -0
- data/lib/rdoc/single_class.rb +14 -2
- data/lib/rdoc/stats/normal.rb +19 -12
- data/lib/rdoc/stats/quiet.rb +1 -0
- data/lib/rdoc/stats/verbose.rb +1 -0
- data/lib/rdoc/stats.rb +262 -104
- data/lib/rdoc/store.rb +979 -0
- data/lib/rdoc/task.rb +84 -44
- data/lib/rdoc/text.rb +117 -72
- data/lib/rdoc/token_stream.rb +73 -4
- data/lib/rdoc/tom_doc.rb +263 -0
- data/lib/rdoc/top_level.rb +111 -261
- data/lib/rdoc/version.rb +8 -0
- data/lib/rdoc.rb +127 -64
- data/man/ri.1 +247 -0
- data/rdoc.gemspec +249 -0
- metadata +171 -291
- data/.autotest +0 -16
- data/.document +0 -5
- data/History.txt +0 -594
- data/LICENSE.txt +0 -57
- data/Manifest.txt +0 -158
- data/README.txt +0 -45
- data/RI.txt +0 -58
- data/bin/ri +0 -5
- data/lib/rdoc/gauntlet.rb +0 -52
- data/lib/rdoc/generator/template/darkfish/classpage.rhtml +0 -296
- data/lib/rdoc/generator/template/darkfish/filepage.rhtml +0 -124
- data/lib/rdoc/generator/template/darkfish/js/jquery.js +0 -32
- data/lib/rdoc/generator/template/darkfish/js/quicksearch.js +0 -114
- data/lib/rdoc/generator/template/darkfish/js/thickbox-compressed.js +0 -10
- data/lib/rdoc/generator/template/darkfish/rdoc.css +0 -706
- data/lib/rdoc/markup/formatter_test_case.rb +0 -689
- data/lib/rdoc/markup/inline.rb +0 -137
- data/lib/rdoc/markup/text_formatter_test_case.rb +0 -116
- data/lib/rdoc/ruby_lex.rb +0 -1291
- data/lib/rdoc/ruby_token.rb +0 -416
- data/test/README +0 -1
- data/test/binary.dat +0 -0
- data/test/hidden.zip.txt +0 -1
- data/test/test.ja.rdoc +0 -10
- data/test/test.ja.txt +0 -8
- data/test/test.txt +0 -1
- data/test/test_attribute_manager.rb +0 -120
- data/test/test_rdoc_alias.rb +0 -13
- data/test/test_rdoc_any_method.rb +0 -126
- data/test/test_rdoc_attr.rb +0 -61
- data/test/test_rdoc_class_module.rb +0 -233
- data/test/test_rdoc_code_object.rb +0 -165
- data/test/test_rdoc_constant.rb +0 -15
- data/test/test_rdoc_context.rb +0 -370
- data/test/test_rdoc_encoding.rb +0 -166
- data/test/test_rdoc_generator_darkfish.rb +0 -119
- data/test/test_rdoc_generator_ri.rb +0 -76
- data/test/test_rdoc_include.rb +0 -96
- data/test/test_rdoc_markup.rb +0 -37
- data/test/test_rdoc_markup_attribute_manager.rb +0 -240
- data/test/test_rdoc_markup_document.rb +0 -51
- data/test/test_rdoc_markup_paragraph.rb +0 -9
- data/test/test_rdoc_markup_parser.rb +0 -1395
- data/test/test_rdoc_markup_pre_process.rb +0 -185
- data/test/test_rdoc_markup_raw.rb +0 -27
- data/test/test_rdoc_markup_to_ansi.rb +0 -328
- data/test/test_rdoc_markup_to_bs.rb +0 -341
- data/test/test_rdoc_markup_to_html.rb +0 -335
- data/test/test_rdoc_markup_to_html_crossref.rb +0 -169
- data/test/test_rdoc_markup_to_rdoc.rb +0 -327
- data/test/test_rdoc_method_attr.rb +0 -122
- data/test/test_rdoc_normal_class.rb +0 -17
- data/test/test_rdoc_normal_module.rb +0 -31
- data/test/test_rdoc_options.rb +0 -342
- data/test/test_rdoc_parser.rb +0 -83
- data/test/test_rdoc_parser_c.rb +0 -912
- data/test/test_rdoc_parser_ruby.rb +0 -1754
- data/test/test_rdoc_parser_simple.rb +0 -99
- data/test/test_rdoc_rdoc.rb +0 -164
- data/test/test_rdoc_require.rb +0 -25
- data/test/test_rdoc_ri_driver.rb +0 -846
- data/test/test_rdoc_ri_paths.rb +0 -43
- data/test/test_rdoc_ri_store.rb +0 -352
- data/test/test_rdoc_ruby_lex.rb +0 -23
- data/test/test_rdoc_stats.rb +0 -38
- data/test/test_rdoc_task.rb +0 -92
- data/test/test_rdoc_text.rb +0 -251
- data/test/test_rdoc_top_level.rb +0 -120
- data/test/xref_data.rb +0 -62
- data/test/xref_test_case.rb +0 -61
- data.tar.gz.sig +0 -3
- metadata.gz.sig +0 -0
data/LEGAL.rdoc
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# coding: UTF-8
|
2
|
+
|
3
|
+
= Legal Notice Information
|
4
|
+
|
5
|
+
The files in this distribution are covered by the Ruby license (see LICENSE) except the features mentioned below:
|
6
|
+
|
7
|
+
Darkfish::
|
8
|
+
Darkfish was written by Michael Granger and is included under the MIT
|
9
|
+
license. Darkfish contains images from the Silk Icons set by Mark James.
|
10
|
+
|
11
|
+
See lib/rdoc/generator/darkfish.rb for license information.
|
12
|
+
|
13
|
+
* lib/rdoc/generator/darkfish.rb
|
14
|
+
* lib/rdoc/generator/template/darkfish/*
|
15
|
+
* lib/rdoc/generator/template/darkfish/images
|
16
|
+
|
17
|
+
SDoc::
|
18
|
+
Portions of SDoc by (Володя Колесников) Vladimir Kolesnikov are included
|
19
|
+
under the MIT license as RDoc::Generator::JsonIndex. See
|
20
|
+
lib/rdoc/generator/json_index.rb for license information.
|
21
|
+
|
22
|
+
* lib/rdoc/generator/json_index.rb
|
23
|
+
* lib/rdoc/generator/template/json_index/*
|
24
|
+
* The +#search_index+ methods on RDoc::CodeObject subclasses were derived
|
25
|
+
from sdoc.
|
26
|
+
* RDoc::ClassModule#document_self_or_methods comes from SDoc.
|
27
|
+
|
28
|
+
peg-markdown::
|
29
|
+
RDoc's Markdown support is derived from peg-markdown by John MacFarlane. It
|
30
|
+
is used under the MIT license. See RDoc::Markdown for license details.
|
31
|
+
|
32
|
+
MarkdownTest::
|
33
|
+
test/test_rdoc_markdown_test.rb uses MarkdownTest 1.0.3's source files which
|
34
|
+
are included as test/MarkdownTest_1.0.3/*.text which are Copyright (c)
|
35
|
+
2004-2005 John Gruber http://daringfireball.net and is included under the
|
36
|
+
same terms as Perl itself.
|
37
|
+
|
38
|
+
See http://dev.perl.org/licenses/ for the terms of the Perl license.
|
39
|
+
|
40
|
+
Fonts::
|
41
|
+
Source Code Pro is (c) 2010, 2012 Adobe Systems Incorporated.
|
42
|
+
|
43
|
+
Lato is (c) 2010 Łukasz Dziedzic.
|
44
|
+
|
45
|
+
Both fonts are used under the SIL Open Font License, Version 1.1. The
|
46
|
+
license is available at http://scripts.sil.org/OFL
|
47
|
+
|
48
|
+
See lib/rdoc/generator/template/darkfish/fonts.css for complete copyright
|
49
|
+
and license information, including a copy of the OFL.
|
50
|
+
|
data/LICENSE.rdoc
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
RDoc is copyrighted free software.
|
2
|
+
|
3
|
+
You can redistribute it and/or modify it under either the terms of the GPL
|
4
|
+
version 2 (see the file GPL), or the conditions below:
|
5
|
+
|
6
|
+
1. You may make and give away verbatim copies of the source form of the
|
7
|
+
software without restriction, provided that you duplicate all of the
|
8
|
+
original copyright notices and associated disclaimers.
|
9
|
+
|
10
|
+
2. You may modify your copy of the software in any way, provided that
|
11
|
+
you do at least ONE of the following:
|
12
|
+
|
13
|
+
a. place your modifications in the Public Domain or otherwise
|
14
|
+
make them Freely Available, such as by posting said
|
15
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
16
|
+
the author to include your modifications in the software.
|
17
|
+
|
18
|
+
b. use the modified software only within your corporation or
|
19
|
+
organization.
|
20
|
+
|
21
|
+
c. give non-standard binaries non-standard names, with
|
22
|
+
instructions on where to get the original software distribution.
|
23
|
+
|
24
|
+
d. make other distribution arrangements with the author.
|
25
|
+
|
26
|
+
3. You may distribute the software in object code or binary form,
|
27
|
+
provided that you do at least ONE of the following:
|
28
|
+
|
29
|
+
a. distribute the binaries and library files of the software,
|
30
|
+
together with instructions (in the manual page or equivalent)
|
31
|
+
on where to get the original distribution.
|
32
|
+
|
33
|
+
b. accompany the distribution with the machine-readable source of
|
34
|
+
the software.
|
35
|
+
|
36
|
+
c. give non-standard binaries non-standard names, with
|
37
|
+
instructions on where to get the original software distribution.
|
38
|
+
|
39
|
+
d. make other distribution arrangements with the author.
|
40
|
+
|
41
|
+
4. You may modify and include the part of the software into any other
|
42
|
+
software (possibly commercial). But some files in the distribution
|
43
|
+
are not written by the author, so that they are not under these terms.
|
44
|
+
|
45
|
+
For the list of those files and their copying conditions, see the
|
46
|
+
file LEGAL.
|
47
|
+
|
48
|
+
5. The scripts and library files supplied as input to or produced as
|
49
|
+
output from the software do not automatically fall under the
|
50
|
+
copyright of the software, but belong to whomever generated them,
|
51
|
+
and may be sold commercially, and may be aggregated with this
|
52
|
+
software.
|
53
|
+
|
54
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
55
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
56
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
57
|
+
PURPOSE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
= \RDoc - Ruby Documentation System
|
2
|
+
|
3
|
+
home :: https://github.com/ruby/rdoc
|
4
|
+
rdoc :: https://ruby.github.io/rdoc
|
5
|
+
bugs :: https://github.com/ruby/rdoc/issues
|
6
|
+
code quality :: {<img src="https://codeclimate.com/github/ruby/rdoc/badges/gpa.svg" alt="Code Climate">}[https://codeclimate.com/github/ruby/rdoc]
|
7
|
+
|
8
|
+
== Description
|
9
|
+
|
10
|
+
RDoc produces HTML and command-line documentation for Ruby projects. RDoc
|
11
|
+
includes the +rdoc+ and +ri+ tools for generating and displaying documentation
|
12
|
+
from the command-line.
|
13
|
+
|
14
|
+
== Generating Documentation
|
15
|
+
|
16
|
+
Once installed, you can create documentation using the +rdoc+ command
|
17
|
+
|
18
|
+
$ rdoc [options] [names...]
|
19
|
+
|
20
|
+
For an up-to-date option summary, type
|
21
|
+
|
22
|
+
$ rdoc --help
|
23
|
+
|
24
|
+
A typical use might be to generate documentation for a package of Ruby
|
25
|
+
source (such as RDoc itself).
|
26
|
+
|
27
|
+
$ rdoc
|
28
|
+
|
29
|
+
This command generates documentation for all the Ruby and C source
|
30
|
+
files in and below the current directory. These will be stored in a
|
31
|
+
documentation tree starting in the subdirectory +doc+.
|
32
|
+
|
33
|
+
You can make this slightly more useful for your readers by having the
|
34
|
+
index page contain the documentation for the primary file. In our
|
35
|
+
case, we could type
|
36
|
+
|
37
|
+
% rdoc --main README.rdoc
|
38
|
+
|
39
|
+
You'll find information on the various formatting tricks you can use
|
40
|
+
in comment blocks in the documentation this generates.
|
41
|
+
|
42
|
+
RDoc uses file extensions to determine how to process each file. File names
|
43
|
+
ending +.rb+ and +.rbw+ are assumed to be Ruby source. Files
|
44
|
+
ending +.c+ are parsed as C files. All other files are assumed to
|
45
|
+
contain just Markup-style markup (with or without leading '#' comment
|
46
|
+
markers). If directory names are passed to RDoc, they are scanned
|
47
|
+
recursively for C and Ruby source files only.
|
48
|
+
|
49
|
+
To generate documentation using +rake+ see RDoc::Task[https://ruby.github.io/rdoc/RDocTask.html].
|
50
|
+
|
51
|
+
To generate documentation programmatically:
|
52
|
+
|
53
|
+
gem 'rdoc'
|
54
|
+
require 'rdoc/rdoc'
|
55
|
+
|
56
|
+
options = RDoc::Options.new
|
57
|
+
# see RDoc::Options
|
58
|
+
|
59
|
+
rdoc = RDoc::RDoc.new
|
60
|
+
rdoc.document options
|
61
|
+
# see RDoc::RDoc
|
62
|
+
|
63
|
+
== Writing Documentation
|
64
|
+
|
65
|
+
To write documentation for RDoc place a comment above the class, module,
|
66
|
+
method, constant, or attribute you want documented:
|
67
|
+
|
68
|
+
##
|
69
|
+
# This class represents an arbitrary shape by a series of points.
|
70
|
+
|
71
|
+
class Shape
|
72
|
+
|
73
|
+
##
|
74
|
+
# Creates a new shape described by a +polyline+.
|
75
|
+
#
|
76
|
+
# If the +polyline+ does not end at the same point it started at the
|
77
|
+
# first pointed is copied and placed at the end of the line.
|
78
|
+
#
|
79
|
+
# An ArgumentError is raised if the line crosses itself, but shapes may
|
80
|
+
# be concave.
|
81
|
+
|
82
|
+
def initialize polyline
|
83
|
+
# ...
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
|
88
|
+
The default comment markup format is the RDoc::Markup format.
|
89
|
+
TomDoc[rdoc-ref:RDoc::TomDoc], Markdown[rdoc-ref:RDoc::Markdown] and
|
90
|
+
RD[rdoc-ref:RDoc::RD] format comments are also supported. You can set the
|
91
|
+
default comment format for your entire project by creating a
|
92
|
+
<tt>.rdoc_options</tt> file. See RDoc::Options@Saved+Options for instructions
|
93
|
+
on creating one. You can also set the comment format for a single file
|
94
|
+
through the +:markup:+ directive, but this is only recommended if you wish to
|
95
|
+
switch markup formats. See RDoc::Markup@Other+directives.
|
96
|
+
|
97
|
+
Comments can contain directives that tell RDoc information that it cannot
|
98
|
+
otherwise discover through parsing. See RDoc::Markup@Directives to control
|
99
|
+
what is or is not documented, to define method arguments or to break up
|
100
|
+
methods in a class by topic. See RDoc::Parser::Ruby for directives used to
|
101
|
+
teach RDoc about metaprogrammed methods.
|
102
|
+
|
103
|
+
See RDoc::Parser::C for documenting C extensions with RDoc.
|
104
|
+
|
105
|
+
To determine how well your project is documented run <tt>rdoc -C lib</tt> to
|
106
|
+
get a documentation coverage report. <tt>rdoc -C1 lib</tt> includes parameter
|
107
|
+
names in the documentation coverage report.
|
108
|
+
|
109
|
+
== Bugs
|
110
|
+
|
111
|
+
See CONTRIBUTING@Bugs for information on filing a bug report. It's OK to file
|
112
|
+
a bug report for anything you're having a problem with. If you can't figure
|
113
|
+
out how to make RDoc produce the output you like that is probably a
|
114
|
+
documentation bug.
|
115
|
+
|
116
|
+
== License
|
117
|
+
|
118
|
+
RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers.
|
119
|
+
Portions (c) 2007-2011 Eric Hodel. Portions copyright others, see individual
|
120
|
+
files and LEGAL.rdoc for details.
|
121
|
+
|
122
|
+
RDoc is free software, and may be redistributed under the terms specified in
|
123
|
+
LICENSE.rdoc.
|
124
|
+
|
125
|
+
== Warranty
|
126
|
+
|
127
|
+
This software is provided "as is" and without any express or implied
|
128
|
+
warranties, including, without limitation, the implied warranties of
|
129
|
+
merchantability and fitness for a particular purpose.
|
data/RI.rdoc
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
= RI
|
2
|
+
|
3
|
+
+ri+ is a tool that allows Ruby documentation to be viewed on the command-line.
|
4
|
+
|
5
|
+
You can use +ri+ to look up information from either the command line or
|
6
|
+
interactively. When you run +ri+ without any arguments it will launch in
|
7
|
+
interactive mode. In interactive mode you can tab-complete class and method
|
8
|
+
names.
|
9
|
+
|
10
|
+
== Usage
|
11
|
+
|
12
|
+
To see information for a class, do:
|
13
|
+
ri ClassName
|
14
|
+
|
15
|
+
For example, for the Array class, do:
|
16
|
+
ri Array
|
17
|
+
|
18
|
+
To see information on a method on a class, do:
|
19
|
+
ri ClassName.method
|
20
|
+
|
21
|
+
This will show both instance and class methods. For example, the IO
|
22
|
+
class defines both IO::read and IO#read:
|
23
|
+
ri IO.read
|
24
|
+
|
25
|
+
To see information for an instance method, do:
|
26
|
+
ri ClassName#method_name
|
27
|
+
|
28
|
+
For example, for Array's +join+ method, do:
|
29
|
+
ri Array#join
|
30
|
+
|
31
|
+
To see information for a class method, do:
|
32
|
+
ri ClassName::method_name
|
33
|
+
|
34
|
+
For example, for Module's +private+ method, do:
|
35
|
+
ri Module::private
|
36
|
+
|
37
|
+
To read documentation for all +read+ methods, do:
|
38
|
+
ri read
|
39
|
+
|
40
|
+
== Options
|
41
|
+
|
42
|
+
+ri+ supports a variety of options, all of which can be viewed via +--help+.
|
43
|
+
Of particular interest, are:
|
44
|
+
|
45
|
+
[<tt>-f</tt>]
|
46
|
+
Outputs ri data using the selected formatter. You can see the available
|
47
|
+
formatters in <tt>ri --help</tt>
|
48
|
+
[<tt>-T</tt>]
|
49
|
+
Send output to stdout, rather than to a pager.
|
50
|
+
|
51
|
+
All options also can be specified through the +RI+ environment variable.
|
52
|
+
Command-line options always override those specified in the +RI+ environment
|
53
|
+
variable.
|
54
|
+
|
55
|
+
The +RI_PAGER+ environment variable allows you to choose a particular pager or
|
56
|
+
particular options for your pager.
|
57
|
+
|
data/Rakefile
CHANGED
@@ -1,98 +1,101 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require '
|
1
|
+
$:.unshift File.expand_path 'lib'
|
2
|
+
require 'rdoc/task'
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rake/testtask'
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
Hoe.plugin :minitest
|
6
|
+
task :docs => :generate
|
7
|
+
task :test => [:normal_test, :rubygems_test]
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
developer 'Tony Strauss', 'tony.strauss@designingpatterns.com'
|
16
|
-
|
17
|
-
self.remote_rdoc_dir = ''
|
18
|
-
self.rsync_args = '-avz'
|
19
|
-
self.testlib = :minitest
|
20
|
-
self.isolate_dir = 'tmp/isolated'
|
21
|
-
|
22
|
-
extra_dev_deps << ['minitest', '~> 2']
|
23
|
-
extra_dev_deps << ['isolate', '~> 3']
|
24
|
-
extra_rdoc_files << 'Rakefile'
|
25
|
-
spec_extras['required_rubygems_version'] = '>= 1.3'
|
26
|
-
spec_extras['homepage'] = 'http://rdoc.rubyforge.org'
|
27
|
-
|
28
|
-
spec_extras[:post_install_message] = <<-EOF
|
29
|
-
RDoc 2.5 did not save method parameters, so you should upgrade your rdoc-data
|
30
|
-
gem to a version >= 2.5.3.
|
31
|
-
|
32
|
-
To have ri data for core and stdlib you'll need to:
|
33
|
-
|
34
|
-
gem install rdoc-data
|
9
|
+
PARSER_FILES = %w[
|
10
|
+
lib/rdoc/rd/block_parser.ry
|
11
|
+
lib/rdoc/rd/inline_parser.ry
|
12
|
+
lib/rdoc/markdown.kpeg
|
13
|
+
lib/rdoc/markdown/literals.kpeg
|
14
|
+
]
|
35
15
|
|
36
|
-
|
16
|
+
$rdoc_rakefile = true
|
37
17
|
|
38
|
-
|
18
|
+
task :default => :test
|
39
19
|
|
40
|
-
|
20
|
+
RDoc::Task.new do |doc|
|
21
|
+
doc.main = 'README.rdoc'
|
22
|
+
doc.title = "rdoc #{RDoc::VERSION} Documentation"
|
23
|
+
doc.rdoc_dir = 'html'
|
24
|
+
doc.rdoc_files = FileList.new %w[lib/**/*.rb *.rdoc] - PARSER_FILES
|
25
|
+
end
|
41
26
|
|
42
|
-
|
27
|
+
task ghpages: :rdoc do
|
28
|
+
`git checkout gh-pages`
|
29
|
+
require "fileutils"
|
30
|
+
FileUtils.rm_rf "/tmp/html"
|
31
|
+
FileUtils.mv "html", "/tmp"
|
32
|
+
FileUtils.rm_rf "*"
|
33
|
+
FileUtils.cp_r Dir.glob("/tmp/html/*"), "."
|
34
|
+
end
|
43
35
|
|
44
|
-
|
45
|
-
|
36
|
+
Rake::TestTask.new(:normal_test) do |t|
|
37
|
+
t.libs << "test/rdoc"
|
38
|
+
t.verbose = true
|
39
|
+
t.deps = :generate
|
40
|
+
t.test_files = FileList["test/**/test_*.rb"].exclude("test/rdoc/test_rdoc_rubygems_hook.rb")
|
46
41
|
end
|
47
42
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
#
|
54
|
-
# If you don't have this directory structure, set RUBY_PATH and/or
|
55
|
-
# RUBINIUS_PATH.
|
56
|
-
|
57
|
-
diff_options = "-urpN --exclude '*svn*' --exclude '*swp' --exclude '*rbc'"
|
58
|
-
rsync_options = "-avP --exclude '*svn*' --exclude '*swp' --exclude '*rbc' --exclude '*.rej' --exclude '*.orig'"
|
59
|
-
|
60
|
-
rubinius_dir = ENV['RUBINIUS_PATH'] || '../../../git/git.rubini.us/code'
|
61
|
-
ruby_dir = ENV['RUBY_PATH'] || '../../ruby/trunk'
|
62
|
-
|
63
|
-
desc "Updates Ruby HEAD with the currently checked-out copy of RDoc."
|
64
|
-
task :update_ruby do
|
65
|
-
sh "rsync #{rsync_options} bin/rdoc #{ruby_dir}/bin/rdoc"
|
66
|
-
sh "rsync #{rsync_options} bin/ri #{ruby_dir}/bin/ri"
|
67
|
-
sh "rsync #{rsync_options} lib/ #{ruby_dir}/lib"
|
68
|
-
sh "rsync #{rsync_options} test/ #{ruby_dir}/test/rdoc"
|
43
|
+
Rake::TestTask.new(:rubygems_test) do |t|
|
44
|
+
t.libs << "test/rdoc"
|
45
|
+
t.verbose = true
|
46
|
+
t.deps = :generate
|
47
|
+
t.pattern = "test/rdoc/test_rdoc_rubygems_hook.rb"
|
69
48
|
end
|
70
49
|
|
71
|
-
|
72
|
-
task :diff_ruby do
|
73
|
-
options = "-urpN --exclude '*svn*' --exclude '*swp' --exclude '*rbc'"
|
50
|
+
path = "pkg/#{Bundler::GemHelper.gemspec.full_name}"
|
74
51
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
52
|
+
package_parser_files = PARSER_FILES.map do |parser_file|
|
53
|
+
name = File.basename(parser_file, File.extname(parser_file))
|
54
|
+
_path = File.dirname(parser_file)
|
55
|
+
package_parser_file = "#{path}/#{name}.rb"
|
56
|
+
parsed_file = "#{_path}/#{name}.rb"
|
57
|
+
|
58
|
+
file package_parser_file => parsed_file # ensure copy runs before racc
|
81
59
|
|
82
|
-
|
83
|
-
task :update_rubinius do
|
84
|
-
sh "rsync #{rsync_options} bin/rdoc #{rubinius_dir}/lib/bin/rdoc.rb"
|
85
|
-
sh "rsync #{rsync_options} bin/ri #{rubinius_dir}/lib/bin/ri.rb"
|
86
|
-
sh "rsync #{rsync_options} lib/ #{rubinius_dir}/lib"
|
87
|
-
sh "rsync #{rsync_options} test/ #{rubinius_dir}/test/rdoc"
|
60
|
+
package_parser_file
|
88
61
|
end
|
89
62
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
63
|
+
parsed_files = PARSER_FILES.map do |parser_file|
|
64
|
+
ext = File.extname(parser_file)
|
65
|
+
parsed_file = "#{parser_file.chomp(ext)}.rb"
|
66
|
+
|
67
|
+
file parsed_file => parser_file do |t|
|
68
|
+
puts "Generating #{parsed_file}..."
|
69
|
+
case ext
|
70
|
+
when '.ry' # need racc
|
71
|
+
racc = Gem.bin_path 'racc', 'racc'
|
72
|
+
rb_file = parser_file.gsub(/\.ry\z/, ".rb")
|
73
|
+
ruby "#{racc} -l -o #{rb_file} #{parser_file}"
|
74
|
+
open(rb_file, 'r+') do |f|
|
75
|
+
newtext = "# frozen_string_literal: true\n#{f.read}"
|
76
|
+
f.rewind
|
77
|
+
f.write newtext
|
78
|
+
end
|
79
|
+
when '.kpeg' # need kpeg
|
80
|
+
kpeg = Gem.bin_path 'kpeg', 'kpeg'
|
81
|
+
rb_file = parser_file.gsub(/\.kpeg\z/, ".rb")
|
82
|
+
ruby "#{kpeg} -fsv -o #{rb_file} #{parser_file}"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
parsed_file
|
97
87
|
end
|
98
88
|
|
89
|
+
task "#{path}.gem" => package_parser_files
|
90
|
+
desc "Generate all files used racc and kpeg"
|
91
|
+
task :generate => parsed_files
|
92
|
+
|
93
|
+
begin
|
94
|
+
require 'rubocop/rake_task'
|
95
|
+
rescue LoadError
|
96
|
+
else
|
97
|
+
RuboCop::RakeTask.new(:rubocop) do |t|
|
98
|
+
t.options = [*parsed_files]
|
99
|
+
end
|
100
|
+
task :build => [:generate, "rubocop:auto_correct"]
|
101
|
+
end
|
data/TODO.rdoc
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
This file contains some things that might happen in RDoc, or might not.
|
2
|
+
Forward Looking Statements applies.
|
3
|
+
|
4
|
+
=== RDoc::VERSION.succ
|
5
|
+
|
6
|
+
Blockers:
|
7
|
+
|
8
|
+
* Update LICENSE to match ruby's switch
|
9
|
+
* The alias keyword should not be bidirectional
|
10
|
+
* Fix RDoc::Parser#use_markup to handle the filename (see TODO)
|
11
|
+
* Restore backwards compatibility due to paragraph text joining from existing
|
12
|
+
ri files
|
13
|
+
* Fix consumption of , after link like: RDoc[rdoc-ref:RDoc], <- comma here
|
14
|
+
* Remove support for links like Matrix[*rows]
|
15
|
+
|
16
|
+
Nice to have:
|
17
|
+
|
18
|
+
* Parse only changed files (like in ruby)
|
19
|
+
* Page of Glory (or Shame) in HTML output showing documentation coverage
|
20
|
+
statistics.
|
21
|
+
* Link to the parent-class implementation of methods that use super
|
22
|
+
* Add direct accessor to RDoc::Options to RDoc::Task
|
23
|
+
* Remove "Public" in HTML output if there are only public methods
|
24
|
+
* Method markup support for rd documentation (per rd syntax)
|
25
|
+
* Improve SIGINFO handling
|
26
|
+
* Global variable support
|
27
|
+
* Provide the code_object to directive handlers
|
28
|
+
|
29
|
+
=== 4
|
30
|
+
|
31
|
+
API changes to RDoc
|
32
|
+
|
33
|
+
* RDoc::TopLevel#add_method should automatically create the appropriate method
|
34
|
+
class rather than requiring one be passed in.
|
35
|
+
* Remove #comment= from Context subclasses in favor of #add_comment
|
36
|
+
* Add versions to RDoc::Markup syntax tree marshal format
|
37
|
+
* Comments can no longer be Strings
|
38
|
+
|
39
|
+
=== Crazy Ideas
|
40
|
+
|
41
|
+
* Auto-normalize heading levels to look OK. It's weird to see an <h1> in
|
42
|
+
the middle of a method section.
|
43
|
+
* RDoc::CodeObject
|
44
|
+
* Move into own namespace
|
45
|
+
* Rename TopLevel to File
|
46
|
+
* Rename Context to Container
|
47
|
+
* Rename NormalClass to Class
|
48
|
+
|
49
|
+
=== Accessibility
|
50
|
+
|
51
|
+
Page title in right hand side
|
52
|
+
|
53
|
+
Table of contents in left hand side as sub-list under main heading
|
54
|
+
|
55
|
+
For class list, never method list, method summary at top
|
56
|
+
|
57
|
+
table-of-contents-navigation div => nav + role="navigation"
|
58
|
+
|
59
|
+
type "mod", focus is still on "mod"
|
data/bin/console
ADDED
data/bin/setup
ADDED
data/{bin → exe}/rdoc
RENAMED
@@ -5,14 +5,23 @@
|
|
5
5
|
#
|
6
6
|
# Copyright (c) 2003 Dave Thomas
|
7
7
|
# Released under the same terms as Ruby
|
8
|
-
|
9
|
-
|
8
|
+
|
9
|
+
begin
|
10
|
+
gem 'rdoc'
|
11
|
+
rescue NameError => e # --disable-gems
|
12
|
+
raise unless e.name == :gem
|
13
|
+
rescue Gem::LoadError
|
14
|
+
end
|
10
15
|
|
11
16
|
require 'rdoc/rdoc'
|
12
17
|
|
13
18
|
begin
|
14
19
|
r = RDoc::RDoc.new
|
15
20
|
r.document ARGV
|
21
|
+
rescue Errno::ENOSPC
|
22
|
+
$stderr.puts 'Ran out of space creating documentation'
|
23
|
+
$stderr.puts
|
24
|
+
$stderr.puts 'Please free up some space and try again'
|
16
25
|
rescue SystemExit
|
17
26
|
raise
|
18
27
|
rescue Exception => e
|
data/exe/ri
ADDED
data/lib/rdoc/alias.rb
CHANGED