rdoc 7.2.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +4 -7
  3. data/LICENSE.rdoc +4 -0
  4. data/README.md +43 -2
  5. data/RI.md +75 -75
  6. data/doc/markup_reference/markdown.md +104 -3
  7. data/exe/rdoc +2 -2
  8. data/lib/rdoc/code_object/alias.rb +70 -74
  9. data/lib/rdoc/code_object/any_method.rb +305 -298
  10. data/lib/rdoc/code_object/attr.rb +150 -143
  11. data/lib/rdoc/code_object/class_module.rb +801 -765
  12. data/lib/rdoc/code_object/constant.rb +178 -150
  13. data/lib/rdoc/code_object/context/section.rb +133 -160
  14. data/lib/rdoc/code_object/context.rb +925 -952
  15. data/lib/rdoc/code_object/extend.rb +7 -5
  16. data/lib/rdoc/code_object/include.rb +7 -5
  17. data/lib/rdoc/code_object/method_attr.rb +325 -324
  18. data/lib/rdoc/code_object/mixin.rb +97 -95
  19. data/lib/rdoc/code_object/normal_class.rb +77 -78
  20. data/lib/rdoc/code_object/normal_module.rb +61 -59
  21. data/lib/rdoc/code_object/require.rb +23 -39
  22. data/lib/rdoc/code_object/single_class.rb +21 -19
  23. data/lib/rdoc/code_object/top_level.rb +212 -213
  24. data/lib/rdoc/code_object.rb +305 -305
  25. data/lib/rdoc/comment.rb +274 -337
  26. data/lib/rdoc/cross_reference.rb +194 -212
  27. data/lib/rdoc/encoding.rb +105 -103
  28. data/lib/rdoc/erb_partial.rb +13 -11
  29. data/lib/rdoc/erbio.rb +29 -27
  30. data/lib/rdoc/generator/aliki.rb +165 -140
  31. data/lib/rdoc/generator/darkfish.rb +647 -631
  32. data/lib/rdoc/generator/json_index.rb +233 -229
  33. data/lib/rdoc/generator/markup.rb +165 -122
  34. data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
  35. data/lib/rdoc/generator/pot/po.rb +52 -51
  36. data/lib/rdoc/generator/pot/po_entry.rb +138 -132
  37. data/lib/rdoc/generator/pot.rb +85 -81
  38. data/lib/rdoc/generator/ri.rb +23 -19
  39. data/lib/rdoc/generator/template/aliki/DESIGN.md +538 -0
  40. data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +1 -1
  41. data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
  42. data/lib/rdoc/generator/template/aliki/_head.rhtml +11 -11
  43. data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
  44. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +8 -6
  45. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +8 -6
  46. data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +1 -1
  47. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +2 -2
  48. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
  49. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +1 -1
  50. data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +1 -1
  51. data/lib/rdoc/generator/template/aliki/class.rhtml +56 -46
  52. data/lib/rdoc/generator/template/aliki/css/rdoc.css +538 -283
  53. data/lib/rdoc/generator/template/aliki/index.rhtml +1 -1
  54. data/lib/rdoc/generator/template/aliki/js/aliki.js +80 -102
  55. data/lib/rdoc/generator/template/aliki/page.rhtml +1 -1
  56. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +1 -1
  57. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +2 -2
  58. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
  59. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +8 -6
  60. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +8 -6
  61. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +1 -1
  62. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +1 -1
  63. data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +1 -1
  64. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +5 -5
  65. data/lib/rdoc/generator/template/darkfish/class.rhtml +18 -21
  66. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +0 -1
  67. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +3 -3
  68. data/lib/rdoc/generator.rb +48 -46
  69. data/lib/rdoc/i18n/locale.rb +99 -95
  70. data/lib/rdoc/i18n/text.rb +109 -105
  71. data/lib/rdoc/i18n.rb +7 -5
  72. data/lib/rdoc/markdown/byte_runtime.rb +80 -0
  73. data/lib/rdoc/markdown.kpeg +30 -21
  74. data/lib/rdoc/markdown.rb +329 -151
  75. data/lib/rdoc/markup/block_quote.rb +12 -8
  76. data/lib/rdoc/markup/document.rb +127 -123
  77. data/lib/rdoc/markup/formatter.rb +215 -221
  78. data/lib/rdoc/markup/heading.rb +1 -4
  79. data/lib/rdoc/markup/include.rb +33 -29
  80. data/lib/rdoc/markup/indented_paragraph.rb +37 -33
  81. data/lib/rdoc/markup/inline_parser.rb +281 -277
  82. data/lib/rdoc/markup/list.rb +80 -88
  83. data/lib/rdoc/markup/list_item.rb +73 -85
  84. data/lib/rdoc/markup/paragraph.rb +23 -19
  85. data/lib/rdoc/markup/parser.rb +501 -497
  86. data/lib/rdoc/markup/pre_process.rb +284 -305
  87. data/lib/rdoc/markup/raw.rb +2 -2
  88. data/lib/rdoc/markup/rule.rb +16 -12
  89. data/lib/rdoc/markup/to_ansi.rb +143 -139
  90. data/lib/rdoc/markup/to_bs.rb +72 -68
  91. data/lib/rdoc/markup/to_html.rb +600 -493
  92. data/lib/rdoc/markup/to_html_crossref.rb +221 -191
  93. data/lib/rdoc/markup/to_html_snippet.rb +232 -227
  94. data/lib/rdoc/markup/to_joined_paragraph.rb +40 -41
  95. data/lib/rdoc/markup/to_label.rb +63 -59
  96. data/lib/rdoc/markup/to_markdown.rb +212 -208
  97. data/lib/rdoc/markup/to_rdoc.rb +336 -332
  98. data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
  99. data/lib/rdoc/markup/to_test.rb +60 -56
  100. data/lib/rdoc/markup/to_tt_only.rb +83 -86
  101. data/lib/rdoc/markup/verbatim.rb +62 -58
  102. data/lib/rdoc/markup.rb +198 -196
  103. data/lib/rdoc/options.rb +1063 -1076
  104. data/lib/rdoc/parser/c.rb +1039 -1036
  105. data/lib/rdoc/parser/changelog.rb +319 -315
  106. data/lib/rdoc/parser/markdown.rb +17 -13
  107. data/lib/rdoc/parser/rbs.rb +279 -0
  108. data/lib/rdoc/parser/rd.rb +17 -13
  109. data/lib/rdoc/parser/ruby.rb +1231 -2222
  110. data/lib/rdoc/parser/ruby_colorizer.rb +303 -0
  111. data/lib/rdoc/parser/simple.rb +31 -27
  112. data/lib/rdoc/parser/text.rb +12 -8
  113. data/lib/rdoc/parser.rb +230 -221
  114. data/lib/rdoc/rbs_helper.rb +186 -0
  115. data/lib/rdoc/rd/inline.rb +57 -53
  116. data/lib/rdoc/rd.rb +90 -88
  117. data/lib/rdoc/rdoc.rb +547 -366
  118. data/lib/rdoc/ri/driver.rb +1141 -1130
  119. data/lib/rdoc/ri/formatter.rb +7 -3
  120. data/lib/rdoc/ri/paths.rb +140 -136
  121. data/lib/rdoc/ri/servlet.rb +456 -0
  122. data/lib/rdoc/ri/store.rb +4 -2
  123. data/lib/rdoc/ri/task.rb +55 -51
  124. data/lib/rdoc/ri.rb +14 -11
  125. data/lib/rdoc/rubygems_hook.rb +194 -192
  126. data/lib/rdoc/server.rb +462 -0
  127. data/lib/rdoc/stats/normal.rb +46 -42
  128. data/lib/rdoc/stats/quiet.rb +39 -35
  129. data/lib/rdoc/stats/verbose.rb +35 -31
  130. data/lib/rdoc/stats.rb +363 -338
  131. data/lib/rdoc/store.rb +919 -725
  132. data/lib/rdoc/task.rb +260 -255
  133. data/lib/rdoc/text.rb +130 -245
  134. data/lib/rdoc/token_stream.rb +101 -115
  135. data/lib/rdoc/tom_doc.rb +203 -201
  136. data/lib/rdoc/version.rb +1 -1
  137. data/lib/rdoc.rb +35 -7
  138. data/lib/rubygems_plugin.rb +2 -11
  139. data/rdoc-logo.svg +43 -0
  140. data/rdoc.gemspec +6 -4
  141. metadata +36 -20
  142. data/lib/rdoc/code_object/anon_class.rb +0 -10
  143. data/lib/rdoc/code_object/ghost_method.rb +0 -6
  144. data/lib/rdoc/code_object/meta_method.rb +0 -6
  145. data/lib/rdoc/markdown/literals.kpeg +0 -21
  146. data/lib/rdoc/markdown/literals.rb +0 -454
  147. data/lib/rdoc/parser/prism_ruby.rb +0 -1112
  148. data/lib/rdoc/parser/ripper_state_lex.rb +0 -302
  149. data/lib/rdoc/parser/ruby_tools.rb +0 -163
  150. data/lib/rdoc/servlet.rb +0 -452
@@ -1,104 +1,100 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Represent an alias, which is an old_name/new_name pair associated with a
4
- # particular context
5
- #--
6
- # TODO implement Alias as a proxy to a method/attribute, inheriting from
7
- # MethodAttr
8
-
9
- class RDoc::Alias < RDoc::CodeObject
10
-
2
+ module RDoc
11
3
  ##
12
- # Aliased method's name
4
+ # Represent an alias, which is an old_name/new_name pair associated with a
5
+ # particular context
6
+ #--
7
+ # TODO implement Alias as a proxy to a method/attribute, inheriting from
8
+ # MethodAttr
13
9
 
14
- attr_reader :new_name
10
+ class Alias < CodeObject
15
11
 
16
- alias name new_name
12
+ ##
13
+ # Aliased method's name
17
14
 
18
- ##
19
- # Aliasee method's name
15
+ attr_reader :new_name
20
16
 
21
- attr_reader :old_name
17
+ alias name new_name
22
18
 
23
- ##
24
- # Is this an alias declared in a singleton context?
19
+ ##
20
+ # Aliasee method's name
25
21
 
26
- attr_reader :singleton
22
+ attr_reader :old_name
27
23
 
28
- ##
29
- # Source file token stream
24
+ ##
25
+ # Is this an alias declared in a singleton context?
30
26
 
31
- attr_reader :text
27
+ attr_reader :singleton
32
28
 
33
- ##
34
- # Creates a new Alias with a token stream of +text+ that aliases +old_name+
35
- # to +new_name+, has +comment+ and is a +singleton+ context.
29
+ ##
30
+ # Creates a new Alias that aliases +old_name+
31
+ # to +new_name+, has +comment+ and is a +singleton+ context.
36
32
 
37
- def initialize(text, old_name, new_name, comment, singleton: false)
38
- super()
33
+ def initialize(old_name, new_name, comment, singleton: false)
34
+ super()
39
35
 
40
- @text = text
41
- @singleton = singleton
42
- @old_name = old_name
43
- @new_name = new_name
44
- self.comment = comment
45
- end
36
+ @singleton = singleton
37
+ @old_name = old_name
38
+ @new_name = new_name
39
+ self.comment = comment
40
+ end
46
41
 
47
- ##
48
- # Order by #singleton then #new_name
42
+ ##
43
+ # Order by #singleton then #new_name
49
44
 
50
- def <=>(other)
51
- [@singleton ? 0 : 1, new_name] <=> [other.singleton ? 0 : 1, other.new_name]
52
- end
45
+ def <=>(other)
46
+ [@singleton ? 0 : 1, new_name] <=> [other.singleton ? 0 : 1, other.new_name]
47
+ end
53
48
 
54
- ##
55
- # HTML fragment reference for this alias
49
+ ##
50
+ # HTML fragment reference for this alias
56
51
 
57
- def aref
58
- type = singleton ? 'c' : 'i'
59
- "#alias-#{type}-#{html_name}"
60
- end
52
+ def aref
53
+ type = singleton ? 'c' : 'i'
54
+ "#alias-#{type}-#{html_name}"
55
+ end
61
56
 
62
- ##
63
- # HTML id-friendly version of +#new_name+.
57
+ ##
58
+ # HTML id-friendly version of +#new_name+.
64
59
 
65
- def html_name
66
- CGI.escape(@new_name.gsub('-', '-2D')).gsub('%', '-').sub(/^-/, '')
67
- end
60
+ def html_name
61
+ CGI.escape(@new_name.gsub('-', '-2D')).gsub('%', '-').sub(/^-/, '')
62
+ end
68
63
 
69
- def inspect # :nodoc:
70
- parent_name = parent ? parent.name : '(unknown)'
71
- "#<%s:0x%x %s.alias_method %s, %s>" % [
72
- self.class, object_id,
73
- parent_name, @old_name, @new_name,
74
- ]
75
- end
64
+ def inspect # :nodoc:
65
+ parent_name = parent ? parent.name : '(unknown)'
66
+ "#<%s:0x%x %s.alias_method %s, %s>" % [
67
+ self.class, object_id,
68
+ parent_name, @old_name, @new_name,
69
+ ]
70
+ end
76
71
 
77
- ##
78
- # '::' for the alias of a singleton method/attribute, '#' for instance-level.
72
+ ##
73
+ # '::' for the alias of a singleton method/attribute, '#' for instance-level.
79
74
 
80
- def name_prefix
81
- singleton ? '::' : '#'
82
- end
75
+ def name_prefix
76
+ singleton ? '::' : '#'
77
+ end
83
78
 
84
- ##
85
- # Old name with prefix '::' or '#'.
79
+ ##
80
+ # Old name with prefix '::' or '#'.
86
81
 
87
- def pretty_old_name
88
- "#{singleton ? '::' : '#'}#{@old_name}"
89
- end
82
+ def pretty_old_name
83
+ "#{singleton ? '::' : '#'}#{@old_name}"
84
+ end
90
85
 
91
- ##
92
- # New name with prefix '::' or '#'.
86
+ ##
87
+ # New name with prefix '::' or '#'.
93
88
 
94
- def pretty_new_name
95
- "#{singleton ? '::' : '#'}#{@new_name}"
96
- end
89
+ def pretty_new_name
90
+ "#{singleton ? '::' : '#'}#{@new_name}"
91
+ end
97
92
 
98
- alias pretty_name pretty_new_name
93
+ alias pretty_name pretty_new_name
99
94
 
100
- def to_s # :nodoc:
101
- "alias: #{self.new_name} -> #{self.pretty_old_name} in: #{parent}"
102
- end
95
+ def to_s # :nodoc:
96
+ "alias: #{self.new_name} -> #{self.pretty_old_name} in: #{parent}"
97
+ end
103
98
 
99
+ end
104
100
  end