rdoc 3.12.2 → 4.0.0.preview2
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 +6 -6
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.autotest +3 -2
- data/DEVELOPERS.rdoc +53 -0
- data/History.rdoc +159 -25
- data/LEGAL.rdoc +12 -0
- data/Manifest.txt +56 -3
- data/README.rdoc +87 -19
- data/Rakefile +11 -2
- data/TODO.rdoc +20 -13
- data/bin/rdoc +4 -0
- data/lib/gauntlet_rdoc.rb +1 -1
- data/lib/rdoc.rb +32 -71
- data/lib/rdoc/any_method.rb +75 -21
- data/lib/rdoc/attr.rb +49 -10
- data/lib/rdoc/class_module.rb +182 -32
- data/lib/rdoc/code_object.rb +54 -12
- data/lib/rdoc/comment.rb +8 -1
- data/lib/rdoc/constant.rb +100 -6
- data/lib/rdoc/context.rb +93 -41
- data/lib/rdoc/context/section.rb +143 -28
- data/lib/rdoc/cross_reference.rb +58 -50
- data/lib/rdoc/encoding.rb +34 -29
- data/lib/rdoc/erb_partial.rb +18 -0
- data/lib/rdoc/extend.rb +117 -0
- data/lib/rdoc/generator.rb +11 -6
- data/lib/rdoc/generator/darkfish.rb +250 -62
- data/lib/rdoc/generator/json_index.rb +20 -12
- data/lib/rdoc/generator/markup.rb +10 -12
- data/lib/rdoc/generator/ri.rb +7 -60
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +7 -7
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +16 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +14 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +13 -0
- data/lib/rdoc/generator/template/darkfish/class.rhtml +15 -1
- data/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/lib/rdoc/generator/template/darkfish/index.rhtml +3 -3
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +7 -9
- data/lib/rdoc/generator/template/darkfish/page.rhtml +2 -0
- data/lib/rdoc/generator/template/darkfish/rdoc.css +31 -0
- data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +37 -0
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +3 -3
- data/lib/rdoc/include.rb +12 -3
- data/lib/rdoc/markdown.kpeg +1186 -0
- data/lib/rdoc/markdown.rb +16336 -0
- data/lib/rdoc/markdown/entities.rb +2128 -0
- data/lib/rdoc/markdown/literals_1_8.kpeg +18 -0
- data/lib/rdoc/markdown/literals_1_8.rb +454 -0
- data/lib/rdoc/markdown/literals_1_9.kpeg +22 -0
- data/lib/rdoc/markdown/literals_1_9.rb +417 -0
- data/lib/rdoc/markup.rb +69 -10
- data/lib/rdoc/markup/attr_changer.rb +2 -5
- data/lib/rdoc/markup/attribute_manager.rb +23 -14
- data/lib/rdoc/markup/attributes.rb +70 -0
- data/lib/rdoc/markup/block_quote.rb +14 -0
- data/lib/rdoc/markup/document.rb +20 -4
- data/lib/rdoc/markup/formatter.rb +17 -6
- data/lib/rdoc/markup/formatter_test_case.rb +93 -24
- data/lib/rdoc/markup/hard_break.rb +31 -0
- data/lib/rdoc/markup/heading.rb +1 -1
- data/lib/rdoc/markup/indented_paragraph.rb +14 -0
- data/lib/rdoc/markup/list.rb +23 -4
- data/lib/rdoc/markup/list_item.rb +17 -4
- data/lib/rdoc/markup/paragraph.rb +14 -0
- data/lib/rdoc/markup/parser.rb +107 -60
- data/lib/rdoc/markup/raw.rb +4 -4
- data/lib/rdoc/markup/special.rb +3 -3
- data/lib/rdoc/markup/to_ansi.rb +7 -1
- data/lib/rdoc/markup/to_html.rb +42 -14
- data/lib/rdoc/markup/to_html_crossref.rb +10 -9
- data/lib/rdoc/markup/to_html_snippet.rb +20 -4
- data/lib/rdoc/markup/to_joined_paragraph.rb +68 -0
- data/lib/rdoc/markup/to_label.rb +20 -1
- data/lib/rdoc/markup/to_markdown.rb +134 -0
- data/lib/rdoc/markup/to_rdoc.rb +36 -5
- data/lib/rdoc/markup/to_table_of_contents.rb +6 -1
- data/lib/rdoc/markup/to_tt_only.rb +11 -2
- data/lib/rdoc/markup/verbatim.rb +19 -0
- data/lib/rdoc/method_attr.rb +33 -19
- data/lib/rdoc/normal_class.rb +26 -7
- data/lib/rdoc/normal_module.rb +10 -5
- data/lib/rdoc/options.rb +95 -21
- data/lib/rdoc/parser.rb +6 -2
- data/lib/rdoc/parser/c.rb +212 -97
- data/lib/rdoc/parser/markdown.rb +23 -0
- data/lib/rdoc/parser/ruby.rb +115 -35
- data/lib/rdoc/parser/ruby_tools.rb +8 -3
- data/lib/rdoc/rd.rb +8 -4
- data/lib/rdoc/rd/block_parser.rb +1 -1
- data/lib/rdoc/rd/block_parser.ry +1 -1
- data/lib/rdoc/rdoc.rb +45 -21
- data/lib/rdoc/ri/driver.rb +322 -76
- data/lib/rdoc/ri/paths.rb +90 -31
- data/lib/rdoc/ri/store.rb +2 -353
- data/lib/rdoc/ruby_lex.rb +5 -21
- data/lib/rdoc/ruby_token.rb +2 -3
- data/lib/rdoc/rubygems_hook.rb +21 -9
- data/lib/rdoc/servlet.rb +302 -0
- data/lib/rdoc/stats.rb +28 -20
- data/lib/rdoc/store.rb +881 -0
- data/lib/rdoc/task.rb +2 -1
- data/lib/rdoc/test_case.rb +103 -1
- data/lib/rdoc/text.rb +5 -4
- data/lib/rdoc/tom_doc.rb +17 -16
- data/lib/rdoc/top_level.rb +43 -285
- data/test/MarkdownTest_1.0.3/Amps and angle encoding.text +21 -0
- data/test/MarkdownTest_1.0.3/Auto links.text +13 -0
- data/test/MarkdownTest_1.0.3/Backslash escapes.text +120 -0
- data/test/MarkdownTest_1.0.3/Blockquotes with code blocks.text +11 -0
- data/test/MarkdownTest_1.0.3/Code Blocks.text +14 -0
- data/test/MarkdownTest_1.0.3/Code Spans.text +6 -0
- data/test/MarkdownTest_1.0.3/Hard-wrapped paragraphs with list-like lines.text +8 -0
- data/test/MarkdownTest_1.0.3/Horizontal rules.text +67 -0
- data/test/MarkdownTest_1.0.3/Inline HTML (Advanced).text +15 -0
- data/test/MarkdownTest_1.0.3/Inline HTML (Simple).text +69 -0
- data/test/MarkdownTest_1.0.3/Inline HTML comments.text +13 -0
- data/test/MarkdownTest_1.0.3/Links, inline style.text +12 -0
- data/test/MarkdownTest_1.0.3/Links, reference style.text +71 -0
- data/test/MarkdownTest_1.0.3/Links, shortcut references.text +20 -0
- data/test/MarkdownTest_1.0.3/Literal quotes in titles.text +7 -0
- data/test/MarkdownTest_1.0.3/Markdown Documentation - Basics.text +306 -0
- data/test/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text +888 -0
- data/test/MarkdownTest_1.0.3/Nested blockquotes.text +5 -0
- data/test/MarkdownTest_1.0.3/Ordered and unordered lists.text +131 -0
- data/test/MarkdownTest_1.0.3/Strong and em together.text +7 -0
- data/test/MarkdownTest_1.0.3/Tabs.text +21 -0
- data/test/MarkdownTest_1.0.3/Tidyness.text +5 -0
- data/test/test_attribute_manager.rb +7 -4
- data/test/test_rdoc_any_method.rb +84 -13
- data/test/test_rdoc_attr.rb +59 -9
- data/test/test_rdoc_class_module.rb +670 -73
- data/test/test_rdoc_code_object.rb +21 -1
- data/test/test_rdoc_comment.rb +1 -1
- data/test/test_rdoc_constant.rb +132 -0
- data/test/test_rdoc_context.rb +84 -18
- data/test/test_rdoc_context_section.rb +99 -15
- data/test/test_rdoc_cross_reference.rb +1 -1
- data/test/test_rdoc_encoding.rb +17 -1
- data/test/test_rdoc_extend.rb +94 -0
- data/test/test_rdoc_generator_darkfish.rb +45 -19
- data/test/test_rdoc_generator_json_index.rb +27 -7
- data/test/test_rdoc_generator_markup.rb +3 -3
- data/test/test_rdoc_generator_ri.rb +11 -9
- data/test/test_rdoc_include.rb +12 -0
- data/test/test_rdoc_markdown.rb +977 -0
- data/test/test_rdoc_markdown_test.rb +1891 -0
- data/test/test_rdoc_markup.rb +1 -1
- data/test/test_rdoc_markup_attribute_manager.rb +2 -2
- data/test/test_rdoc_markup_attributes.rb +39 -0
- data/test/test_rdoc_markup_document.rb +16 -1
- data/test/test_rdoc_markup_formatter.rb +7 -4
- data/test/test_rdoc_markup_hard_break.rb +31 -0
- data/test/test_rdoc_markup_indented_paragraph.rb +14 -0
- data/test/test_rdoc_markup_paragraph.rb +15 -1
- data/test/test_rdoc_markup_parser.rb +152 -89
- data/test/test_rdoc_markup_to_ansi.rb +23 -2
- data/test/test_rdoc_markup_to_bs.rb +24 -0
- data/test/test_rdoc_markup_to_html.rb +50 -19
- data/test/test_rdoc_markup_to_html_crossref.rb +23 -5
- data/test/test_rdoc_markup_to_html_snippet.rb +49 -8
- data/test/test_rdoc_markup_to_joined_paragraph.rb +32 -0
- data/test/test_rdoc_markup_to_label.rb +63 -1
- data/test/test_rdoc_markup_to_markdown.rb +352 -0
- data/test/test_rdoc_markup_to_rdoc.rb +22 -2
- data/test/test_rdoc_markup_to_table_of_contents.rb +44 -39
- data/test/test_rdoc_markup_to_tt_only.rb +20 -0
- data/test/test_rdoc_markup_verbatim.rb +13 -0
- data/test/test_rdoc_method_attr.rb +5 -0
- data/test/test_rdoc_normal_class.rb +24 -5
- data/test/test_rdoc_normal_module.rb +1 -1
- data/test/test_rdoc_options.rb +21 -6
- data/test/test_rdoc_parser.rb +24 -0
- data/test/test_rdoc_parser_c.rb +151 -26
- data/test/test_rdoc_parser_markdown.rb +55 -0
- data/test/test_rdoc_parser_rd.rb +2 -2
- data/test/test_rdoc_parser_ruby.rb +468 -109
- data/test/test_rdoc_parser_simple.rb +2 -2
- data/test/test_rdoc_rd_block_parser.rb +0 -4
- data/test/test_rdoc_rdoc.rb +110 -22
- data/test/test_rdoc_ri_driver.rb +415 -80
- data/test/test_rdoc_ri_paths.rb +122 -13
- data/test/test_rdoc_ruby_lex.rb +5 -61
- data/test/test_rdoc_ruby_token.rb +19 -0
- data/test/test_rdoc_rubygems_hook.rb +64 -43
- data/test/test_rdoc_servlet.rb +429 -0
- data/test/test_rdoc_stats.rb +83 -24
- data/test/{test_rdoc_ri_store.rb → test_rdoc_store.rb} +395 -22
- data/test/test_rdoc_task.rb +2 -2
- data/test/test_rdoc_text.rb +37 -11
- data/test/test_rdoc_tom_doc.rb +59 -62
- data/test/test_rdoc_top_level.rb +71 -113
- data/test/xref_test_case.rb +7 -9
- metadata +122 -39
- metadata.gz.sig +0 -0
- data/CVE-2013-0256.rdoc +0 -49
- data/lib/rdoc/markup/attribute.rb +0 -51
data/README.rdoc
CHANGED
@@ -3,28 +3,48 @@
|
|
3
3
|
home :: https://github.com/rdoc/rdoc
|
4
4
|
rdoc :: http://docs.seattlerb.org/rdoc
|
5
5
|
bugs :: https://github.com/rdoc/rdoc/issues
|
6
|
+
code quality :: {<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/rdoc/rdoc]
|
6
7
|
|
7
8
|
== Description
|
8
9
|
|
9
10
|
RDoc produces HTML and command-line documentation for Ruby projects. RDoc
|
10
|
-
includes the +rdoc+ and +ri+ tools for generating and displaying
|
11
|
-
|
11
|
+
includes the +rdoc+ and +ri+ tools for generating and displaying documentation
|
12
|
+
from the command-line.
|
12
13
|
|
13
|
-
|
14
|
+
== Generating Documentation
|
14
15
|
|
15
|
-
|
16
|
+
Once installed, you can create documentation using the +rdoc+ command
|
16
17
|
|
17
|
-
|
18
|
-
RDoc::Markup. RDoc::Parser::Ruby and RDoc::Parser::C have additional
|
19
|
-
directives (such as metaprogrammed methods) for documenting Ruby and C files
|
20
|
-
respectively.
|
18
|
+
$ rdoc [options] [names...]
|
21
19
|
|
22
|
-
|
23
|
-
project's root directory.
|
20
|
+
For an up-to-date option summary, type
|
24
21
|
|
25
|
-
|
26
|
-
|
27
|
-
|
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.
|
28
48
|
|
29
49
|
To generate documentation using +rake+ see RDoc::Task.
|
30
50
|
|
@@ -40,22 +60,70 @@ To generate documentation programmatically:
|
|
40
60
|
rdoc.document options
|
41
61
|
# see RDoc::RDoc
|
42
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
|
+
|
43
109
|
== Bugs
|
44
110
|
|
45
|
-
|
46
|
-
|
111
|
+
See DEVELOPERS@Bugs for information on filing a bug report. It's OK to file a
|
112
|
+
bug report for anything you're having a problem with. If you can't figure out
|
113
|
+
how to make RDoc produce the output you like that is probably a documentation
|
114
|
+
bug.
|
47
115
|
|
48
116
|
== License
|
49
117
|
|
50
118
|
RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers.
|
51
119
|
Portions (c) 2007-2011 Eric Hodel. Portions copyright others, see individual
|
52
|
-
files for details.
|
120
|
+
files and LEGAL.rdoc for details.
|
53
121
|
|
54
|
-
|
55
|
-
LICENSE.
|
122
|
+
RDoc is free software, and may be redistributed under the terms specified in
|
123
|
+
LICENSE.rdoc.
|
56
124
|
|
57
125
|
== Warranty
|
58
126
|
|
59
127
|
This software is provided "as is" and without any express or implied
|
60
128
|
warranties, including, without limitation, the implied warranties of
|
61
|
-
|
129
|
+
merchantability and fitness for a particular purpose.
|
data/Rakefile
CHANGED
@@ -10,11 +10,16 @@ task :test => :generate
|
|
10
10
|
PARSER_FILES = %w[
|
11
11
|
lib/rdoc/rd/block_parser.rb
|
12
12
|
lib/rdoc/rd/inline_parser.rb
|
13
|
+
lib/rdoc/markdown.rb
|
14
|
+
lib/rdoc/markdown/literals_1_8.rb
|
15
|
+
lib/rdoc/markdown/literals_1_9.rb
|
13
16
|
]
|
14
17
|
|
15
18
|
Hoe.plugin :git
|
19
|
+
Hoe.plugin :kpeg
|
16
20
|
Hoe.plugin :minitest
|
17
21
|
Hoe.plugin :rdoc_tags
|
22
|
+
Hoe.plugin :travis
|
18
23
|
|
19
24
|
$rdoc_rakefile = true
|
20
25
|
|
@@ -37,12 +42,12 @@ Depending on your version of ruby, you may need to install ruby rdoc/ri data:
|
|
37
42
|
>= 1.9.2 : nothing to do! Yay!
|
38
43
|
MESSAGE
|
39
44
|
|
45
|
+
self.licenses << 'Ruby'
|
40
46
|
self.readme_file = 'README.rdoc'
|
41
47
|
self.history_file = 'History.rdoc'
|
42
48
|
self.testlib = :minitest
|
43
49
|
self.extra_rdoc_files += %w[
|
44
50
|
DEVELOPERS.rdoc
|
45
|
-
CVE-2013-0256.rdoc
|
46
51
|
History.rdoc
|
47
52
|
LICENSE.rdoc
|
48
53
|
LEGAL.rdoc
|
@@ -52,6 +57,7 @@ Depending on your version of ruby, you may need to install ruby rdoc/ri data:
|
|
52
57
|
]
|
53
58
|
|
54
59
|
self.clean_globs += PARSER_FILES
|
60
|
+
self.kpeg_flags = '-fsv' if self.respond_to? :kpeg_flags= # no plugin
|
55
61
|
|
56
62
|
require_ruby_version '>= 1.8.7'
|
57
63
|
extra_deps << ['json', '~> 1.4']
|
@@ -64,6 +70,10 @@ Depending on your version of ruby, you may need to install ruby rdoc/ri data:
|
|
64
70
|
spec_extras['homepage'] = 'http://docs.seattlerb.org/rdoc'
|
65
71
|
end
|
66
72
|
|
73
|
+
# requires ruby 1.8 and ruby 1.8 to build
|
74
|
+
hoe.clean_globs -= PARSER_FILES.grep(/literals_/)
|
75
|
+
|
76
|
+
task :generate => :isolate
|
67
77
|
task :generate => PARSER_FILES
|
68
78
|
task :check_manifest => :generate
|
69
79
|
|
@@ -134,4 +144,3 @@ task :diff_rubinius do
|
|
134
144
|
sh "diff #{diff_options} test #{rubinius_dir}/test/rdoc; true"
|
135
145
|
end
|
136
146
|
|
137
|
-
|
data/TODO.rdoc
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
This file contains some things that might happen in RDoc, or might not.
|
2
2
|
Forward Looking Statements applies.
|
3
3
|
|
4
|
-
===
|
4
|
+
=== RDoc::VERSION.succ
|
5
|
+
|
6
|
+
Blockers:
|
5
7
|
|
6
8
|
* Update LICENSE to match ruby's switch
|
7
|
-
*
|
8
|
-
|
9
|
-
|
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)
|
10
19
|
* Page of Glory (or Shame) in HTML output showing documentation coverage
|
11
20
|
statistics.
|
12
21
|
* Link to the parent-class implementation of methods that use super
|
@@ -15,26 +24,24 @@ Forward Looking Statements applies.
|
|
15
24
|
* Method markup support for rd documentation (per rd syntax)
|
16
25
|
* Improve SIGINFO handling
|
17
26
|
* Global variable support
|
18
|
-
* Page support for ri
|
19
27
|
* Provide the code_object to directive handlers
|
20
|
-
* Add markup parser documentation to DEVELOPERS.rdoc
|
21
28
|
|
22
29
|
=== 4
|
23
30
|
|
24
31
|
API changes to RDoc
|
25
32
|
|
26
|
-
* Remove global state
|
27
|
-
* Remove RDoc::RDocError
|
28
33
|
* RDoc::TopLevel#add_method should automatically create the appropriate method
|
29
34
|
class rather than requiring one be passed in.
|
30
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.
|
31
43
|
* RDoc::CodeObject
|
32
44
|
* Move into own namespace
|
33
45
|
* Rename TopLevel to File
|
34
46
|
* Rename Context to Container
|
35
47
|
* Rename NormalClass to Class
|
36
|
-
|
37
|
-
=== Crazy Ideas
|
38
|
-
|
39
|
-
* Auto-normalize heading levels to look OK. It's weird to see an <h1> in
|
40
|
-
the middle of a method section.
|
data/bin/rdoc
CHANGED
@@ -18,6 +18,10 @@ require 'rdoc/rdoc'
|
|
18
18
|
begin
|
19
19
|
r = RDoc::RDoc.new
|
20
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'
|
21
25
|
rescue SystemExit
|
22
26
|
raise
|
23
27
|
rescue Exception => e
|
data/lib/gauntlet_rdoc.rb
CHANGED
data/lib/rdoc.rb
CHANGED
@@ -3,88 +3,53 @@ $DEBUG_RDOC = nil
|
|
3
3
|
# :main: README.rdoc
|
4
4
|
|
5
5
|
##
|
6
|
-
# RDoc
|
7
|
-
#
|
8
|
-
#
|
6
|
+
# RDoc produces documentation for Ruby source files by parsing the source and
|
7
|
+
# extracting the definition for classes, modules, methods, includes and
|
8
|
+
# requires. It associates these with optional documentation contained in an
|
9
|
+
# immediately preceding comment block then renders the result using an output
|
10
|
+
# formatter.
|
9
11
|
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
# modules, methods, includes and requires. It associates these with optional
|
13
|
-
# documentation contained in an immediately preceding comment block then
|
14
|
-
# renders the result using an output formatter.
|
15
|
-
#
|
16
|
-
# RDoc::Markup that converts plain text into various output formats. The
|
17
|
-
# markup library is used to interpret the comment blocks that RDoc uses to
|
18
|
-
# document methods, classes, and so on.
|
19
|
-
#
|
20
|
-
# RDoc::RI implements the +ri+ command-line tool which displays on-line
|
21
|
-
# documentation for ruby classes, methods, etc. +ri+ features several output
|
22
|
-
# formats and an interactive mode (<tt>ri -i</tt>). See <tt>ri --help</tt>
|
23
|
-
# for further details.
|
12
|
+
# For a simple introduction to writing or generating documentation using RDoc
|
13
|
+
# see the README.
|
24
14
|
#
|
25
15
|
# == Roadmap
|
26
16
|
#
|
27
|
-
#
|
28
|
-
# * If you want to use RDoc to create documentation for your Ruby source files,
|
29
|
-
# see RDoc::Markup and refer to <tt>rdoc --help</tt> for command line
|
30
|
-
# usage.
|
31
|
-
# * If you want to store rdoc configuration in your gem see
|
32
|
-
# RDoc::Options@Saved+Options
|
33
|
-
# * If you want to write documentation for Ruby files see RDoc::Parser::Ruby
|
34
|
-
# * If you want to write documentation for extensions written in C see
|
35
|
-
# RDoc::Parser::C
|
36
|
-
# * If you want to generate documentation using <tt>rake</tt> see RDoc::Task.
|
37
|
-
# * If you want to drive RDoc programmatically, see RDoc::RDoc.
|
38
|
-
# * If you want to use the library to format text blocks into HTML or other
|
39
|
-
# formats, look at RDoc::Markup.
|
40
|
-
# * If you want to make an RDoc plugin such as a generator or directive
|
41
|
-
# handler see RDoc::RDoc.
|
42
|
-
# * If you want to write your own output generator see RDoc::Generator.
|
43
|
-
# * If you want an overview of how RDoc works see DEVELOPERS
|
44
|
-
#
|
45
|
-
# == Summary
|
17
|
+
# If you think you found a bug in RDoc see DEVELOPERS@Bugs
|
46
18
|
#
|
47
|
-
#
|
19
|
+
# If you want to use RDoc to create documentation for your Ruby source files,
|
20
|
+
# see RDoc::Markup and refer to <tt>rdoc --help</tt> for command line usage.
|
48
21
|
#
|
49
|
-
#
|
22
|
+
# If you want to set the default markup format see
|
23
|
+
# RDoc::Markup@Supported+Formats
|
50
24
|
#
|
51
|
-
#
|
25
|
+
# If you want to store rdoc configuration in your gem (such as the default
|
26
|
+
# markup format) see RDoc::Options@Saved+Options
|
52
27
|
#
|
53
|
-
#
|
28
|
+
# If you want to write documentation for Ruby files see RDoc::Parser::Ruby
|
54
29
|
#
|
55
|
-
#
|
56
|
-
#
|
30
|
+
# If you want to write documentation for extensions written in C see
|
31
|
+
# RDoc::Parser::C
|
57
32
|
#
|
58
|
-
#
|
33
|
+
# If you want to generate documentation using <tt>rake</tt> see RDoc::Task.
|
59
34
|
#
|
60
|
-
#
|
61
|
-
# files in and below the current directory. These will be stored in a
|
62
|
-
# documentation tree starting in the subdirectory +doc+.
|
35
|
+
# If you want to drive RDoc programmatically, see RDoc::RDoc.
|
63
36
|
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
# case, we could type
|
37
|
+
# If you want to use the library to format text blocks into HTML or other
|
38
|
+
# formats, look at RDoc::Markup.
|
67
39
|
#
|
68
|
-
#
|
40
|
+
# If you want to make an RDoc plugin such as a generator or directive handler
|
41
|
+
# see RDoc::RDoc.
|
69
42
|
#
|
70
|
-
#
|
71
|
-
# in comment blocks in the documentation this generates.
|
43
|
+
# If you want to write your own output generator see RDoc::Generator.
|
72
44
|
#
|
73
|
-
#
|
74
|
-
# ending +.rb+ and +.rbw+ are assumed to be Ruby source. Files
|
75
|
-
# ending +.c+ are parsed as C files. All other files are assumed to
|
76
|
-
# contain just Markup-style markup (with or without leading '#' comment
|
77
|
-
# markers). If directory names are passed to RDoc, they are scanned
|
78
|
-
# recursively for C and Ruby source files only.
|
45
|
+
# If you want an overview of how RDoc works see DEVELOPERS
|
79
46
|
#
|
80
|
-
# ==
|
47
|
+
# == Credits
|
81
48
|
#
|
82
49
|
# RDoc is currently being maintained by Eric Hodel <drbrain@segment7.net>.
|
83
50
|
#
|
84
51
|
# Dave Thomas <dave@pragmaticprogrammer.com> is the original author of RDoc.
|
85
52
|
#
|
86
|
-
# == Credits
|
87
|
-
#
|
88
53
|
# * The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
|
89
54
|
# work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
|
90
55
|
# parser for irb and the rtags package.
|
@@ -96,19 +61,10 @@ module RDoc
|
|
96
61
|
|
97
62
|
class Error < RuntimeError; end
|
98
63
|
|
99
|
-
def self.const_missing const_name # :nodoc:
|
100
|
-
if const_name.to_s == 'RDocError' then
|
101
|
-
warn "RDoc::RDocError is deprecated and will be removed in RDoc 4"
|
102
|
-
return Error
|
103
|
-
end
|
104
|
-
|
105
|
-
super
|
106
|
-
end
|
107
|
-
|
108
64
|
##
|
109
65
|
# RDoc version you are using
|
110
66
|
|
111
|
-
VERSION = '
|
67
|
+
VERSION = '4.0.0.preview2'
|
112
68
|
|
113
69
|
##
|
114
70
|
# Method visibilities
|
@@ -170,15 +126,19 @@ module RDoc
|
|
170
126
|
|
171
127
|
autoload :CrossReference, 'rdoc/cross_reference'
|
172
128
|
autoload :ERBIO, 'rdoc/erbio'
|
129
|
+
autoload :ERBPartial, 'rdoc/erb_partial'
|
173
130
|
autoload :Encoding, 'rdoc/encoding'
|
174
131
|
autoload :Generator, 'rdoc/generator'
|
175
132
|
autoload :Options, 'rdoc/options'
|
176
133
|
autoload :Parser, 'rdoc/parser'
|
134
|
+
autoload :Servlet, 'rdoc/servlet'
|
177
135
|
autoload :RI, 'rdoc/ri'
|
178
136
|
autoload :Stats, 'rdoc/stats'
|
137
|
+
autoload :Store, 'rdoc/store'
|
179
138
|
autoload :Task, 'rdoc/task'
|
180
139
|
autoload :Text, 'rdoc/text'
|
181
140
|
|
141
|
+
autoload :Markdown, 'rdoc/markdown'
|
182
142
|
autoload :Markup, 'rdoc/markup'
|
183
143
|
autoload :RD, 'rdoc/rd'
|
184
144
|
autoload :TomDoc, 'rdoc/tom_doc'
|
@@ -215,6 +175,7 @@ module RDoc
|
|
215
175
|
|
216
176
|
autoload :Constant, 'rdoc/constant'
|
217
177
|
autoload :Include, 'rdoc/include'
|
178
|
+
autoload :Extend, 'rdoc/extend'
|
218
179
|
autoload :Require, 'rdoc/require'
|
219
180
|
|
220
181
|
end
|
data/lib/rdoc/any_method.rb
CHANGED
@@ -3,7 +3,14 @@
|
|
3
3
|
|
4
4
|
class RDoc::AnyMethod < RDoc::MethodAttr
|
5
5
|
|
6
|
-
|
6
|
+
##
|
7
|
+
# 2::
|
8
|
+
# RDoc 4
|
9
|
+
# Added calls_super
|
10
|
+
# Added parent name and class
|
11
|
+
# Added section title
|
12
|
+
|
13
|
+
MARSHAL_VERSION = 2 # :nodoc:
|
7
14
|
|
8
15
|
##
|
9
16
|
# Don't rename \#initialize to \::new
|
@@ -25,6 +32,11 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
25
32
|
|
26
33
|
attr_accessor :params
|
27
34
|
|
35
|
+
##
|
36
|
+
# If true this method uses +super+ to call a superclass version
|
37
|
+
|
38
|
+
attr_accessor :calls_super
|
39
|
+
|
28
40
|
include RDoc::TokenStream
|
29
41
|
|
30
42
|
##
|
@@ -36,6 +48,8 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
36
48
|
@c_function = nil
|
37
49
|
@dont_rename_initialize = false
|
38
50
|
@token_stream = nil
|
51
|
+
@calls_super = false
|
52
|
+
@superclass_method = nil
|
39
53
|
end
|
40
54
|
|
41
55
|
##
|
@@ -93,7 +107,11 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
93
107
|
@block_params,
|
94
108
|
aliases,
|
95
109
|
@params,
|
96
|
-
@file.
|
110
|
+
@file.relative_name,
|
111
|
+
@calls_super,
|
112
|
+
@parent.name,
|
113
|
+
@parent.class,
|
114
|
+
@section.title,
|
97
115
|
]
|
98
116
|
end
|
99
117
|
|
@@ -104,34 +122,44 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
104
122
|
# * #full_name
|
105
123
|
# * #parent_name
|
106
124
|
|
107
|
-
def marshal_load
|
125
|
+
def marshal_load array
|
108
126
|
@dont_rename_initialize = nil
|
109
127
|
@is_alias_for = nil
|
110
128
|
@token_stream = nil
|
111
129
|
@aliases = []
|
112
|
-
|
113
|
-
|
114
|
-
@
|
115
|
-
@
|
116
|
-
@
|
117
|
-
|
118
|
-
|
119
|
-
@
|
120
|
-
@
|
130
|
+
@parent = nil
|
131
|
+
@parent_name = nil
|
132
|
+
@parent_class = nil
|
133
|
+
@section = nil
|
134
|
+
@file = nil
|
135
|
+
|
136
|
+
version = array[0]
|
137
|
+
@name = array[1]
|
138
|
+
@full_name = array[2]
|
139
|
+
@singleton = array[3]
|
140
|
+
@visibility = array[4]
|
141
|
+
@comment = array[5]
|
142
|
+
@call_seq = array[6]
|
143
|
+
@block_params = array[7]
|
144
|
+
# 8 handled below
|
145
|
+
@params = array[9]
|
146
|
+
# 10 handled below
|
147
|
+
@calls_super = array[11]
|
148
|
+
@parent_name = array[12]
|
149
|
+
@parent_title = array[13]
|
150
|
+
@section_title = array[14]
|
121
151
|
|
122
152
|
array[8].each do |new_name, comment|
|
123
153
|
add_alias RDoc::Alias.new(nil, @name, new_name, comment, @singleton)
|
124
154
|
end
|
125
155
|
|
126
|
-
@
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
name.join '::'
|
134
|
-
end
|
156
|
+
@parent_name ||= if @full_name =~ /#/ then
|
157
|
+
$`
|
158
|
+
else
|
159
|
+
name = @full_name.split('::')
|
160
|
+
name.pop
|
161
|
+
name.join '::'
|
162
|
+
end
|
135
163
|
|
136
164
|
@file = RDoc::TopLevel.new array[10] if version > 0
|
137
165
|
end
|
@@ -204,5 +232,31 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
204
232
|
params
|
205
233
|
end
|
206
234
|
|
235
|
+
##
|
236
|
+
# Sets the store for this method and its referenced code objects.
|
237
|
+
|
238
|
+
def store= store
|
239
|
+
super
|
240
|
+
|
241
|
+
@file = @store.add_file @file.full_name if @file
|
242
|
+
end
|
243
|
+
|
244
|
+
##
|
245
|
+
# For methods that +super+, find the superclass method that would be called.
|
246
|
+
|
247
|
+
def superclass_method
|
248
|
+
return unless @calls_super
|
249
|
+
return @superclass_method if @superclass_method
|
250
|
+
|
251
|
+
parent.each_ancestor do |ancestor|
|
252
|
+
if method = ancestor.method_list.find { |m| m.name == @name } then
|
253
|
+
@superclass_method = method
|
254
|
+
break
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
@superclass_method
|
259
|
+
end
|
260
|
+
|
207
261
|
end
|
208
262
|
|