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.

Files changed (200) hide show
  1. checksums.yaml +6 -6
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.autotest +3 -2
  5. data/DEVELOPERS.rdoc +53 -0
  6. data/History.rdoc +159 -25
  7. data/LEGAL.rdoc +12 -0
  8. data/Manifest.txt +56 -3
  9. data/README.rdoc +87 -19
  10. data/Rakefile +11 -2
  11. data/TODO.rdoc +20 -13
  12. data/bin/rdoc +4 -0
  13. data/lib/gauntlet_rdoc.rb +1 -1
  14. data/lib/rdoc.rb +32 -71
  15. data/lib/rdoc/any_method.rb +75 -21
  16. data/lib/rdoc/attr.rb +49 -10
  17. data/lib/rdoc/class_module.rb +182 -32
  18. data/lib/rdoc/code_object.rb +54 -12
  19. data/lib/rdoc/comment.rb +8 -1
  20. data/lib/rdoc/constant.rb +100 -6
  21. data/lib/rdoc/context.rb +93 -41
  22. data/lib/rdoc/context/section.rb +143 -28
  23. data/lib/rdoc/cross_reference.rb +58 -50
  24. data/lib/rdoc/encoding.rb +34 -29
  25. data/lib/rdoc/erb_partial.rb +18 -0
  26. data/lib/rdoc/extend.rb +117 -0
  27. data/lib/rdoc/generator.rb +11 -6
  28. data/lib/rdoc/generator/darkfish.rb +250 -62
  29. data/lib/rdoc/generator/json_index.rb +20 -12
  30. data/lib/rdoc/generator/markup.rb +10 -12
  31. data/lib/rdoc/generator/ri.rb +7 -60
  32. data/lib/rdoc/generator/template/darkfish/_head.rhtml +7 -7
  33. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +16 -0
  34. data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +1 -1
  35. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +14 -0
  36. data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +1 -1
  37. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +13 -0
  38. data/lib/rdoc/generator/template/darkfish/class.rhtml +15 -1
  39. data/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
  40. data/lib/rdoc/generator/template/darkfish/index.rhtml +3 -3
  41. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +7 -9
  42. data/lib/rdoc/generator/template/darkfish/page.rhtml +2 -0
  43. data/lib/rdoc/generator/template/darkfish/rdoc.css +31 -0
  44. data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +18 -0
  45. data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +37 -0
  46. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +3 -3
  47. data/lib/rdoc/include.rb +12 -3
  48. data/lib/rdoc/markdown.kpeg +1186 -0
  49. data/lib/rdoc/markdown.rb +16336 -0
  50. data/lib/rdoc/markdown/entities.rb +2128 -0
  51. data/lib/rdoc/markdown/literals_1_8.kpeg +18 -0
  52. data/lib/rdoc/markdown/literals_1_8.rb +454 -0
  53. data/lib/rdoc/markdown/literals_1_9.kpeg +22 -0
  54. data/lib/rdoc/markdown/literals_1_9.rb +417 -0
  55. data/lib/rdoc/markup.rb +69 -10
  56. data/lib/rdoc/markup/attr_changer.rb +2 -5
  57. data/lib/rdoc/markup/attribute_manager.rb +23 -14
  58. data/lib/rdoc/markup/attributes.rb +70 -0
  59. data/lib/rdoc/markup/block_quote.rb +14 -0
  60. data/lib/rdoc/markup/document.rb +20 -4
  61. data/lib/rdoc/markup/formatter.rb +17 -6
  62. data/lib/rdoc/markup/formatter_test_case.rb +93 -24
  63. data/lib/rdoc/markup/hard_break.rb +31 -0
  64. data/lib/rdoc/markup/heading.rb +1 -1
  65. data/lib/rdoc/markup/indented_paragraph.rb +14 -0
  66. data/lib/rdoc/markup/list.rb +23 -4
  67. data/lib/rdoc/markup/list_item.rb +17 -4
  68. data/lib/rdoc/markup/paragraph.rb +14 -0
  69. data/lib/rdoc/markup/parser.rb +107 -60
  70. data/lib/rdoc/markup/raw.rb +4 -4
  71. data/lib/rdoc/markup/special.rb +3 -3
  72. data/lib/rdoc/markup/to_ansi.rb +7 -1
  73. data/lib/rdoc/markup/to_html.rb +42 -14
  74. data/lib/rdoc/markup/to_html_crossref.rb +10 -9
  75. data/lib/rdoc/markup/to_html_snippet.rb +20 -4
  76. data/lib/rdoc/markup/to_joined_paragraph.rb +68 -0
  77. data/lib/rdoc/markup/to_label.rb +20 -1
  78. data/lib/rdoc/markup/to_markdown.rb +134 -0
  79. data/lib/rdoc/markup/to_rdoc.rb +36 -5
  80. data/lib/rdoc/markup/to_table_of_contents.rb +6 -1
  81. data/lib/rdoc/markup/to_tt_only.rb +11 -2
  82. data/lib/rdoc/markup/verbatim.rb +19 -0
  83. data/lib/rdoc/method_attr.rb +33 -19
  84. data/lib/rdoc/normal_class.rb +26 -7
  85. data/lib/rdoc/normal_module.rb +10 -5
  86. data/lib/rdoc/options.rb +95 -21
  87. data/lib/rdoc/parser.rb +6 -2
  88. data/lib/rdoc/parser/c.rb +212 -97
  89. data/lib/rdoc/parser/markdown.rb +23 -0
  90. data/lib/rdoc/parser/ruby.rb +115 -35
  91. data/lib/rdoc/parser/ruby_tools.rb +8 -3
  92. data/lib/rdoc/rd.rb +8 -4
  93. data/lib/rdoc/rd/block_parser.rb +1 -1
  94. data/lib/rdoc/rd/block_parser.ry +1 -1
  95. data/lib/rdoc/rdoc.rb +45 -21
  96. data/lib/rdoc/ri/driver.rb +322 -76
  97. data/lib/rdoc/ri/paths.rb +90 -31
  98. data/lib/rdoc/ri/store.rb +2 -353
  99. data/lib/rdoc/ruby_lex.rb +5 -21
  100. data/lib/rdoc/ruby_token.rb +2 -3
  101. data/lib/rdoc/rubygems_hook.rb +21 -9
  102. data/lib/rdoc/servlet.rb +302 -0
  103. data/lib/rdoc/stats.rb +28 -20
  104. data/lib/rdoc/store.rb +881 -0
  105. data/lib/rdoc/task.rb +2 -1
  106. data/lib/rdoc/test_case.rb +103 -1
  107. data/lib/rdoc/text.rb +5 -4
  108. data/lib/rdoc/tom_doc.rb +17 -16
  109. data/lib/rdoc/top_level.rb +43 -285
  110. data/test/MarkdownTest_1.0.3/Amps and angle encoding.text +21 -0
  111. data/test/MarkdownTest_1.0.3/Auto links.text +13 -0
  112. data/test/MarkdownTest_1.0.3/Backslash escapes.text +120 -0
  113. data/test/MarkdownTest_1.0.3/Blockquotes with code blocks.text +11 -0
  114. data/test/MarkdownTest_1.0.3/Code Blocks.text +14 -0
  115. data/test/MarkdownTest_1.0.3/Code Spans.text +6 -0
  116. data/test/MarkdownTest_1.0.3/Hard-wrapped paragraphs with list-like lines.text +8 -0
  117. data/test/MarkdownTest_1.0.3/Horizontal rules.text +67 -0
  118. data/test/MarkdownTest_1.0.3/Inline HTML (Advanced).text +15 -0
  119. data/test/MarkdownTest_1.0.3/Inline HTML (Simple).text +69 -0
  120. data/test/MarkdownTest_1.0.3/Inline HTML comments.text +13 -0
  121. data/test/MarkdownTest_1.0.3/Links, inline style.text +12 -0
  122. data/test/MarkdownTest_1.0.3/Links, reference style.text +71 -0
  123. data/test/MarkdownTest_1.0.3/Links, shortcut references.text +20 -0
  124. data/test/MarkdownTest_1.0.3/Literal quotes in titles.text +7 -0
  125. data/test/MarkdownTest_1.0.3/Markdown Documentation - Basics.text +306 -0
  126. data/test/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text +888 -0
  127. data/test/MarkdownTest_1.0.3/Nested blockquotes.text +5 -0
  128. data/test/MarkdownTest_1.0.3/Ordered and unordered lists.text +131 -0
  129. data/test/MarkdownTest_1.0.3/Strong and em together.text +7 -0
  130. data/test/MarkdownTest_1.0.3/Tabs.text +21 -0
  131. data/test/MarkdownTest_1.0.3/Tidyness.text +5 -0
  132. data/test/test_attribute_manager.rb +7 -4
  133. data/test/test_rdoc_any_method.rb +84 -13
  134. data/test/test_rdoc_attr.rb +59 -9
  135. data/test/test_rdoc_class_module.rb +670 -73
  136. data/test/test_rdoc_code_object.rb +21 -1
  137. data/test/test_rdoc_comment.rb +1 -1
  138. data/test/test_rdoc_constant.rb +132 -0
  139. data/test/test_rdoc_context.rb +84 -18
  140. data/test/test_rdoc_context_section.rb +99 -15
  141. data/test/test_rdoc_cross_reference.rb +1 -1
  142. data/test/test_rdoc_encoding.rb +17 -1
  143. data/test/test_rdoc_extend.rb +94 -0
  144. data/test/test_rdoc_generator_darkfish.rb +45 -19
  145. data/test/test_rdoc_generator_json_index.rb +27 -7
  146. data/test/test_rdoc_generator_markup.rb +3 -3
  147. data/test/test_rdoc_generator_ri.rb +11 -9
  148. data/test/test_rdoc_include.rb +12 -0
  149. data/test/test_rdoc_markdown.rb +977 -0
  150. data/test/test_rdoc_markdown_test.rb +1891 -0
  151. data/test/test_rdoc_markup.rb +1 -1
  152. data/test/test_rdoc_markup_attribute_manager.rb +2 -2
  153. data/test/test_rdoc_markup_attributes.rb +39 -0
  154. data/test/test_rdoc_markup_document.rb +16 -1
  155. data/test/test_rdoc_markup_formatter.rb +7 -4
  156. data/test/test_rdoc_markup_hard_break.rb +31 -0
  157. data/test/test_rdoc_markup_indented_paragraph.rb +14 -0
  158. data/test/test_rdoc_markup_paragraph.rb +15 -1
  159. data/test/test_rdoc_markup_parser.rb +152 -89
  160. data/test/test_rdoc_markup_to_ansi.rb +23 -2
  161. data/test/test_rdoc_markup_to_bs.rb +24 -0
  162. data/test/test_rdoc_markup_to_html.rb +50 -19
  163. data/test/test_rdoc_markup_to_html_crossref.rb +23 -5
  164. data/test/test_rdoc_markup_to_html_snippet.rb +49 -8
  165. data/test/test_rdoc_markup_to_joined_paragraph.rb +32 -0
  166. data/test/test_rdoc_markup_to_label.rb +63 -1
  167. data/test/test_rdoc_markup_to_markdown.rb +352 -0
  168. data/test/test_rdoc_markup_to_rdoc.rb +22 -2
  169. data/test/test_rdoc_markup_to_table_of_contents.rb +44 -39
  170. data/test/test_rdoc_markup_to_tt_only.rb +20 -0
  171. data/test/test_rdoc_markup_verbatim.rb +13 -0
  172. data/test/test_rdoc_method_attr.rb +5 -0
  173. data/test/test_rdoc_normal_class.rb +24 -5
  174. data/test/test_rdoc_normal_module.rb +1 -1
  175. data/test/test_rdoc_options.rb +21 -6
  176. data/test/test_rdoc_parser.rb +24 -0
  177. data/test/test_rdoc_parser_c.rb +151 -26
  178. data/test/test_rdoc_parser_markdown.rb +55 -0
  179. data/test/test_rdoc_parser_rd.rb +2 -2
  180. data/test/test_rdoc_parser_ruby.rb +468 -109
  181. data/test/test_rdoc_parser_simple.rb +2 -2
  182. data/test/test_rdoc_rd_block_parser.rb +0 -4
  183. data/test/test_rdoc_rdoc.rb +110 -22
  184. data/test/test_rdoc_ri_driver.rb +415 -80
  185. data/test/test_rdoc_ri_paths.rb +122 -13
  186. data/test/test_rdoc_ruby_lex.rb +5 -61
  187. data/test/test_rdoc_ruby_token.rb +19 -0
  188. data/test/test_rdoc_rubygems_hook.rb +64 -43
  189. data/test/test_rdoc_servlet.rb +429 -0
  190. data/test/test_rdoc_stats.rb +83 -24
  191. data/test/{test_rdoc_ri_store.rb → test_rdoc_store.rb} +395 -22
  192. data/test/test_rdoc_task.rb +2 -2
  193. data/test/test_rdoc_text.rb +37 -11
  194. data/test/test_rdoc_tom_doc.rb +59 -62
  195. data/test/test_rdoc_top_level.rb +71 -113
  196. data/test/xref_test_case.rb +7 -9
  197. metadata +122 -39
  198. metadata.gz.sig +0 -0
  199. data/CVE-2013-0256.rdoc +0 -49
  200. data/lib/rdoc/markup/attribute.rb +0 -51
@@ -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 online
11
- documentation.
11
+ includes the +rdoc+ and +ri+ tools for generating and displaying documentation
12
+ from the command-line.
12
13
 
13
- See RDoc for a description of RDoc's markup and basic use.
14
+ == Generating Documentation
14
15
 
15
- == Synopsis
16
+ Once installed, you can create documentation using the +rdoc+ command
16
17
 
17
- To learn RDoc's syntax and directives for documenting your ruby project see
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
- To generate HTML documentation for your project run <tt>rdoc .</tt> in your
23
- project's root directory.
20
+ For an up-to-date option summary, type
24
21
 
25
- To determine how well your project is documented run <tt>rdoc -C lib</tt> to
26
- get a documentation coverage report. <tt>rdoc -C1 lib</tt> includes parameter
27
- names in the documentation coverage report.
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
- If you find a bug, please report it at the RDoc project's
46
- {issues tracker}[https://github.com/rdoc/rdoc/issues] on github.
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
- It is free software, and may be redistributed under the terms specified in
55
- LICENSE.txt.
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
- merchantibility and fitness for a particular purpose.
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
- === 3.next
4
+ === RDoc::VERSION.succ
5
+
6
+ Blockers:
5
7
 
6
8
  * Update LICENSE to match ruby's switch
7
- * Reload the RDoc tree from an RI store
8
- * Re-run generators
9
- * Parse only changed files (like in ruby)
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
@@ -36,7 +36,7 @@ class RDoc::Gauntlet < Gauntlet
36
36
 
37
37
  args = @args.dup
38
38
  args << '--op' << dir
39
- args.push(*spec.rdoc_options)
39
+ args.concat spec.rdoc_options
40
40
  args << spec.require_paths
41
41
  args << spec.extra_rdoc_files
42
42
  args = args.flatten.map { |a| a.to_s }
@@ -3,88 +3,53 @@ $DEBUG_RDOC = nil
3
3
  # :main: README.rdoc
4
4
 
5
5
  ##
6
- # RDoc is a Ruby documentation system which contains RDoc::RDoc for generating
7
- # documentation, RDoc::RI for interactive documentation and RDoc::Markup for
8
- # text markup.
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
- # RDoc::RDoc produces documentation for Ruby source files. It works similarly
11
- # to JavaDoc, parsing the source and extracting the definition for classes,
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
- # * If you think you found a bug in RDoc see DEVELOPERS@Bugs
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
- # Once installed, you can create documentation using the +rdoc+ command
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
- # % rdoc [options] [names...]
22
+ # If you want to set the default markup format see
23
+ # RDoc::Markup@Supported+Formats
50
24
  #
51
- # For an up-to-date option summary, type
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
- # % rdoc --help
28
+ # If you want to write documentation for Ruby files see RDoc::Parser::Ruby
54
29
  #
55
- # A typical use might be to generate documentation for a package of Ruby
56
- # source (such as RDoc itself).
30
+ # If you want to write documentation for extensions written in C see
31
+ # RDoc::Parser::C
57
32
  #
58
- # % rdoc
33
+ # If you want to generate documentation using <tt>rake</tt> see RDoc::Task.
59
34
  #
60
- # This command generates documentation for all the Ruby and C source
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
- # You can make this slightly more useful for your readers by having the
65
- # index page contain the documentation for the primary file. In our
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
- # % rdoc --main README.rdoc
40
+ # If you want to make an RDoc plugin such as a generator or directive handler
41
+ # see RDoc::RDoc.
69
42
  #
70
- # You'll find information on the various formatting tricks you can use
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
- # RDoc uses file extensions to determine how to process each file. File names
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
- # == Other stuff
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 = '3.12.2'
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
@@ -3,7 +3,14 @@
3
3
 
4
4
  class RDoc::AnyMethod < RDoc::MethodAttr
5
5
 
6
- MARSHAL_VERSION = 1 # :nodoc:
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.absolute_name,
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(array)
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
- version = array[0]
114
- @name = array[1]
115
- @full_name = array[2]
116
- @singleton = array[3]
117
- @visibility = array[4]
118
- @comment = array[5]
119
- @call_seq = array[6]
120
- @block_params = array[7]
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
- @params = array[9]
127
-
128
- @parent_name = if @full_name =~ /#/ then
129
- $`
130
- else
131
- name = @full_name.split('::')
132
- name.pop
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