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
@@ -0,0 +1,21 @@
1
+ AT&T has an ampersand in their name.
2
+
3
+ AT&T is another way to write it.
4
+
5
+ This & that.
6
+
7
+ 4 < 5.
8
+
9
+ 6 > 5.
10
+
11
+ Here's a [link] [1] with an ampersand in the URL.
12
+
13
+ Here's a link with an amersand in the link text: [AT&T] [2].
14
+
15
+ Here's an inline [link](/script?foo=1&bar=2).
16
+
17
+ Here's an inline [link](</script?foo=1&bar=2>).
18
+
19
+
20
+ [1]: http://example.com/?foo=1&bar=2
21
+ [2]: http://att.com/ "AT&T"
@@ -0,0 +1,13 @@
1
+ Link: <http://example.com/>.
2
+
3
+ With an ampersand: <http://example.com/?foo=1&bar=2>
4
+
5
+ * In a list?
6
+ * <http://example.com/>
7
+ * It should.
8
+
9
+ > Blockquoted: <http://example.com/>
10
+
11
+ Auto-links should not occur here: `<http://example.com/>`
12
+
13
+ or here: <http://example.com/>
@@ -0,0 +1,120 @@
1
+ These should all get escaped:
2
+
3
+ Backslash: \\
4
+
5
+ Backtick: \`
6
+
7
+ Asterisk: \*
8
+
9
+ Underscore: \_
10
+
11
+ Left brace: \{
12
+
13
+ Right brace: \}
14
+
15
+ Left bracket: \[
16
+
17
+ Right bracket: \]
18
+
19
+ Left paren: \(
20
+
21
+ Right paren: \)
22
+
23
+ Greater-than: \>
24
+
25
+ Hash: \#
26
+
27
+ Period: \.
28
+
29
+ Bang: \!
30
+
31
+ Plus: \+
32
+
33
+ Minus: \-
34
+
35
+
36
+
37
+ These should not, because they occur within a code block:
38
+
39
+ Backslash: \\
40
+
41
+ Backtick: \`
42
+
43
+ Asterisk: \*
44
+
45
+ Underscore: \_
46
+
47
+ Left brace: \{
48
+
49
+ Right brace: \}
50
+
51
+ Left bracket: \[
52
+
53
+ Right bracket: \]
54
+
55
+ Left paren: \(
56
+
57
+ Right paren: \)
58
+
59
+ Greater-than: \>
60
+
61
+ Hash: \#
62
+
63
+ Period: \.
64
+
65
+ Bang: \!
66
+
67
+ Plus: \+
68
+
69
+ Minus: \-
70
+
71
+
72
+ Nor should these, which occur in code spans:
73
+
74
+ Backslash: `\\`
75
+
76
+ Backtick: `` \` ``
77
+
78
+ Asterisk: `\*`
79
+
80
+ Underscore: `\_`
81
+
82
+ Left brace: `\{`
83
+
84
+ Right brace: `\}`
85
+
86
+ Left bracket: `\[`
87
+
88
+ Right bracket: `\]`
89
+
90
+ Left paren: `\(`
91
+
92
+ Right paren: `\)`
93
+
94
+ Greater-than: `\>`
95
+
96
+ Hash: `\#`
97
+
98
+ Period: `\.`
99
+
100
+ Bang: `\!`
101
+
102
+ Plus: `\+`
103
+
104
+ Minus: `\-`
105
+
106
+
107
+ These should get escaped, even though they're matching pairs for
108
+ other Markdown constructs:
109
+
110
+ \*asterisks\*
111
+
112
+ \_underscores\_
113
+
114
+ \`backticks\`
115
+
116
+ This is a code span with a literal backslash-backtick sequence: `` \` ``
117
+
118
+ This is a tag with unescaped backticks <span attr='`ticks`'>bar</span>.
119
+
120
+ This is a tag with backslashes <span attr='\\backslashes\\'>bar</span>.
@@ -0,0 +1,11 @@
1
+ > Example:
2
+ >
3
+ > sub status {
4
+ > print "working";
5
+ > }
6
+ >
7
+ > Or:
8
+ >
9
+ > sub status {
10
+ > return "working";
11
+ > }
@@ -0,0 +1,14 @@
1
+ code block on the first line
2
+
3
+ Regular text.
4
+
5
+ code block indented by spaces
6
+
7
+ Regular text.
8
+
9
+ the lines in this block
10
+ all contain trailing spaces
11
+
12
+ Regular Text.
13
+
14
+ code block on the last line
@@ -0,0 +1,6 @@
1
+ `<test a="` content of attribute `">`
2
+
3
+ Fix for backticks within HTML tag: <span attr='`ticks`'>like this</span>
4
+
5
+ Here's how you put `` `backticks` `` in a code span.
6
+
@@ -0,0 +1,8 @@
1
+ In Markdown 1.0.0 and earlier. Version
2
+ 8. This line turns into a list item.
3
+ Because a hard-wrapped line in the
4
+ middle of a paragraph looked like a
5
+ list item.
6
+
7
+ Here's one with a bullet.
8
+ * criminey.
@@ -0,0 +1,67 @@
1
+ Dashes:
2
+
3
+ ---
4
+
5
+ ---
6
+
7
+ ---
8
+
9
+ ---
10
+
11
+ ---
12
+
13
+ - - -
14
+
15
+ - - -
16
+
17
+ - - -
18
+
19
+ - - -
20
+
21
+ - - -
22
+
23
+
24
+ Asterisks:
25
+
26
+ ***
27
+
28
+ ***
29
+
30
+ ***
31
+
32
+ ***
33
+
34
+ ***
35
+
36
+ * * *
37
+
38
+ * * *
39
+
40
+ * * *
41
+
42
+ * * *
43
+
44
+ * * *
45
+
46
+
47
+ Underscores:
48
+
49
+ ___
50
+
51
+ ___
52
+
53
+ ___
54
+
55
+ ___
56
+
57
+ ___
58
+
59
+ _ _ _
60
+
61
+ _ _ _
62
+
63
+ _ _ _
64
+
65
+ _ _ _
66
+
67
+ _ _ _
@@ -0,0 +1,15 @@
1
+ Simple block on one line:
2
+
3
+ <div>foo</div>
4
+
5
+ And nested without indentation:
6
+
7
+ <div>
8
+ <div>
9
+ <div>
10
+ foo
11
+ </div>
12
+ <div style=">"/>
13
+ </div>
14
+ <div>bar</div>
15
+ </div>
@@ -0,0 +1,69 @@
1
+ Here's a simple block:
2
+
3
+ <div>
4
+ foo
5
+ </div>
6
+
7
+ This should be a code block, though:
8
+
9
+ <div>
10
+ foo
11
+ </div>
12
+
13
+ As should this:
14
+
15
+ <div>foo</div>
16
+
17
+ Now, nested:
18
+
19
+ <div>
20
+ <div>
21
+ <div>
22
+ foo
23
+ </div>
24
+ </div>
25
+ </div>
26
+
27
+ This should just be an HTML comment:
28
+
29
+ <!-- Comment -->
30
+
31
+ Multiline:
32
+
33
+ <!--
34
+ Blah
35
+ Blah
36
+ -->
37
+
38
+ Code block:
39
+
40
+ <!-- Comment -->
41
+
42
+ Just plain comment, with trailing spaces on the line:
43
+
44
+ <!-- foo -->
45
+
46
+ Code:
47
+
48
+ <hr />
49
+
50
+ Hr's:
51
+
52
+ <hr>
53
+
54
+ <hr/>
55
+
56
+ <hr />
57
+
58
+ <hr>
59
+
60
+ <hr/>
61
+
62
+ <hr />
63
+
64
+ <hr class="foo" id="bar" />
65
+
66
+ <hr class="foo" id="bar"/>
67
+
68
+ <hr class="foo" id="bar" >
69
+
@@ -0,0 +1,13 @@
1
+ Paragraph one.
2
+
3
+ <!-- This is a simple comment -->
4
+
5
+ <!--
6
+ This is another comment.
7
+ -->
8
+
9
+ Paragraph two.
10
+
11
+ <!-- one comment block -- -- with two comments -->
12
+
13
+ The end.
@@ -0,0 +1,12 @@
1
+ Just a [URL](/url/).
2
+
3
+ [URL and title](/url/ "title").
4
+
5
+ [URL and title](/url/ "title preceded by two spaces").
6
+
7
+ [URL and title](/url/ "title preceded by a tab").
8
+
9
+ [URL and title](/url/ "title has spaces afterward" ).
10
+
11
+
12
+ [Empty]().
@@ -0,0 +1,71 @@
1
+ Foo [bar] [1].
2
+
3
+ Foo [bar][1].
4
+
5
+ Foo [bar]
6
+ [1].
7
+
8
+ [1]: /url/ "Title"
9
+
10
+
11
+ With [embedded [brackets]] [b].
12
+
13
+
14
+ Indented [once][].
15
+
16
+ Indented [twice][].
17
+
18
+ Indented [thrice][].
19
+
20
+ Indented [four][] times.
21
+
22
+ [once]: /url
23
+
24
+ [twice]: /url
25
+
26
+ [thrice]: /url
27
+
28
+ [four]: /url
29
+
30
+
31
+ [b]: /url/
32
+
33
+ * * *
34
+
35
+ [this] [this] should work
36
+
37
+ So should [this][this].
38
+
39
+ And [this] [].
40
+
41
+ And [this][].
42
+
43
+ And [this].
44
+
45
+ But not [that] [].
46
+
47
+ Nor [that][].
48
+
49
+ Nor [that].
50
+
51
+ [Something in brackets like [this][] should work]
52
+
53
+ [Same with [this].]
54
+
55
+ In this case, [this](/somethingelse/) points to something else.
56
+
57
+ Backslashing should suppress \[this] and [this\].
58
+
59
+ [this]: foo
60
+
61
+
62
+ * * *
63
+
64
+ Here's one where the [link
65
+ breaks] across lines.
66
+
67
+ Here's another where the [link
68
+ breaks] across lines, but with a line-ending space.
69
+
70
+
71
+ [link breaks]: /url/