rdoc 8.0.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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -3
  3. data/RI.md +75 -75
  4. data/exe/rdoc +2 -2
  5. data/lib/rdoc/code_object/alias.rb +71 -69
  6. data/lib/rdoc/code_object/any_method.rb +305 -303
  7. data/lib/rdoc/code_object/attr.rb +150 -148
  8. data/lib/rdoc/code_object/class_module.rb +798 -792
  9. data/lib/rdoc/code_object/constant.rb +175 -173
  10. data/lib/rdoc/code_object/context/section.rb +142 -138
  11. data/lib/rdoc/code_object/context.rb +926 -958
  12. data/lib/rdoc/code_object/extend.rb +7 -5
  13. data/lib/rdoc/code_object/include.rb +7 -5
  14. data/lib/rdoc/code_object/method_attr.rb +326 -319
  15. data/lib/rdoc/code_object/mixin.rb +97 -95
  16. data/lib/rdoc/code_object/normal_class.rb +77 -78
  17. data/lib/rdoc/code_object/normal_module.rb +61 -59
  18. data/lib/rdoc/code_object/require.rb +23 -39
  19. data/lib/rdoc/code_object/single_class.rb +21 -19
  20. data/lib/rdoc/code_object/top_level.rb +212 -219
  21. data/lib/rdoc/code_object.rb +305 -303
  22. data/lib/rdoc/comment.rb +275 -273
  23. data/lib/rdoc/cross_reference.rb +192 -190
  24. data/lib/rdoc/encoding.rb +105 -103
  25. data/lib/rdoc/erb_partial.rb +13 -11
  26. data/lib/rdoc/erbio.rb +29 -27
  27. data/lib/rdoc/generator/aliki.rb +161 -153
  28. data/lib/rdoc/generator/darkfish.rb +645 -635
  29. data/lib/rdoc/generator/json_index.rb +233 -229
  30. data/lib/rdoc/generator/markup.rb +164 -146
  31. data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
  32. data/lib/rdoc/generator/pot/po.rb +52 -51
  33. data/lib/rdoc/generator/pot/po_entry.rb +138 -132
  34. data/lib/rdoc/generator/pot.rb +85 -81
  35. data/lib/rdoc/generator/ri.rb +23 -19
  36. data/lib/rdoc/generator/template/aliki/DESIGN.md +6 -4
  37. data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
  38. data/lib/rdoc/generator/template/aliki/_head.rhtml +10 -10
  39. data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
  40. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
  41. data/lib/rdoc/generator/template/aliki/css/rdoc.css +207 -178
  42. data/lib/rdoc/generator/template/aliki/js/aliki.js +60 -84
  43. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
  44. data/lib/rdoc/generator.rb +48 -46
  45. data/lib/rdoc/i18n/locale.rb +99 -95
  46. data/lib/rdoc/i18n/text.rb +109 -105
  47. data/lib/rdoc/i18n.rb +7 -5
  48. data/lib/rdoc/markdown/byte_runtime.rb +80 -0
  49. data/lib/rdoc/markdown.kpeg +15 -11
  50. data/lib/rdoc/markdown.rb +40 -47
  51. data/lib/rdoc/markup/block_quote.rb +12 -8
  52. data/lib/rdoc/markup/document.rb +127 -123
  53. data/lib/rdoc/markup/formatter.rb +219 -215
  54. data/lib/rdoc/markup/include.rb +33 -29
  55. data/lib/rdoc/markup/indented_paragraph.rb +37 -33
  56. data/lib/rdoc/markup/inline_parser.rb +281 -277
  57. data/lib/rdoc/markup/list.rb +80 -88
  58. data/lib/rdoc/markup/list_item.rb +73 -85
  59. data/lib/rdoc/markup/paragraph.rb +23 -19
  60. data/lib/rdoc/markup/parser.rb +501 -497
  61. data/lib/rdoc/markup/pre_process.rb +283 -279
  62. data/lib/rdoc/markup/raw.rb +2 -2
  63. data/lib/rdoc/markup/rule.rb +16 -12
  64. data/lib/rdoc/markup/to_ansi.rb +143 -139
  65. data/lib/rdoc/markup/to_bs.rb +72 -68
  66. data/lib/rdoc/markup/to_html.rb +594 -565
  67. data/lib/rdoc/markup/to_html_crossref.rb +234 -230
  68. data/lib/rdoc/markup/to_html_snippet.rb +232 -227
  69. data/lib/rdoc/markup/to_joined_paragraph.rb +36 -32
  70. data/lib/rdoc/markup/to_label.rb +63 -59
  71. data/lib/rdoc/markup/to_markdown.rb +212 -208
  72. data/lib/rdoc/markup/to_rdoc.rb +336 -332
  73. data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
  74. data/lib/rdoc/markup/to_test.rb +60 -56
  75. data/lib/rdoc/markup/to_tt_only.rb +84 -80
  76. data/lib/rdoc/markup/verbatim.rb +62 -58
  77. data/lib/rdoc/markup.rb +198 -196
  78. data/lib/rdoc/options.rb +1063 -1061
  79. data/lib/rdoc/parser/c.rb +1039 -1037
  80. data/lib/rdoc/parser/changelog.rb +319 -315
  81. data/lib/rdoc/parser/markdown.rb +17 -13
  82. data/lib/rdoc/parser/rbs.rb +239 -235
  83. data/lib/rdoc/parser/rd.rb +17 -13
  84. data/lib/rdoc/parser/ruby.rb +1245 -1124
  85. data/lib/rdoc/parser/ruby_colorizer.rb +263 -213
  86. data/lib/rdoc/parser/simple.rb +31 -27
  87. data/lib/rdoc/parser/text.rb +12 -8
  88. data/lib/rdoc/parser.rb +228 -220
  89. data/lib/rdoc/rbs_helper.rb +1 -1
  90. data/lib/rdoc/rd/inline.rb +57 -53
  91. data/lib/rdoc/rd.rb +90 -88
  92. data/lib/rdoc/rdoc.rb +500 -491
  93. data/lib/rdoc/ri/driver.rb +1140 -1135
  94. data/lib/rdoc/ri/formatter.rb +7 -3
  95. data/lib/rdoc/ri/paths.rb +140 -136
  96. data/lib/rdoc/ri/servlet.rb +354 -350
  97. data/lib/rdoc/ri/store.rb +4 -2
  98. data/lib/rdoc/ri/task.rb +55 -51
  99. data/lib/rdoc/ri.rb +14 -12
  100. data/lib/rdoc/rubygems_hook.rb +183 -181
  101. data/lib/rdoc/server.rb +349 -347
  102. data/lib/rdoc/stats/normal.rb +46 -42
  103. data/lib/rdoc/stats/quiet.rb +39 -35
  104. data/lib/rdoc/stats/verbose.rb +35 -31
  105. data/lib/rdoc/stats.rb +365 -363
  106. data/lib/rdoc/store.rb +888 -902
  107. data/lib/rdoc/task.rb +260 -256
  108. data/lib/rdoc/text.rb +135 -133
  109. data/lib/rdoc/token_stream.rb +101 -93
  110. data/lib/rdoc/tom_doc.rb +203 -201
  111. data/lib/rdoc/version.rb +1 -1
  112. metadata +4 -5
  113. data/lib/rdoc/markdown/literals.kpeg +0 -21
  114. data/lib/rdoc/markdown/literals.rb +0 -454
@@ -6,53 +6,57 @@ rescue LoadError
6
6
  require 'io/console'
7
7
  end
8
8
 
9
- ##
10
- # Stats printer that prints just the files being documented with a progress
11
- # bar
9
+ module RDoc
10
+ class Stats
11
+ ##
12
+ # Stats printer that prints just the files being documented with a progress
13
+ # bar
12
14
 
13
- class RDoc::Stats::Normal < RDoc::Stats::Quiet
15
+ class Normal < Stats::Quiet
14
16
 
15
- def begin_adding # :nodoc:
16
- puts "Parsing sources..."
17
- @last_width = 0
18
- end
17
+ def begin_adding # :nodoc:
18
+ puts "Parsing sources..."
19
+ @last_width = 0
20
+ end
19
21
 
20
- ##
21
- # Prints a file with a progress bar
22
-
23
- def print_file(files_so_far, filename)
24
- progress_bar = sprintf("%3d%% [%2d/%2d] ",
25
- 100 * files_so_far / @num_files,
26
- files_so_far,
27
- @num_files)
28
-
29
- if $stdout.tty?
30
- # Print a progress bar, but make sure it fits on a single line. Filename
31
- # will be truncated if necessary.
32
- size = IO.respond_to?(:console_size) ? IO.console_size : IO.console.winsize
33
- terminal_width = size[1].to_i.nonzero? || 80
34
- max_filename_size = (terminal_width - progress_bar.size) - 1
35
-
36
- if filename.size > max_filename_size then
37
- # Turn "some_long_filename.rb" to "...ong_filename.rb"
38
- filename = filename[(filename.size - max_filename_size) .. -1]
39
- filename[0..2] = "..."
22
+ ##
23
+ # Prints a file with a progress bar
24
+
25
+ def print_file(files_so_far, filename)
26
+ progress_bar = sprintf("%3d%% [%2d/%2d] ",
27
+ 100 * files_so_far / @num_files,
28
+ files_so_far,
29
+ @num_files)
30
+
31
+ if $stdout.tty?
32
+ # Print a progress bar, but make sure it fits on a single line. Filename
33
+ # will be truncated if necessary.
34
+ size = IO.respond_to?(:console_size) ? IO.console_size : IO.console.winsize
35
+ terminal_width = size[1].to_i.nonzero? || 80
36
+ max_filename_size = (terminal_width - progress_bar.size) - 1
37
+
38
+ if filename.size > max_filename_size
39
+ # Turn "some_long_filename.rb" to "...ong_filename.rb"
40
+ filename = filename[(filename.size - max_filename_size) .. -1]
41
+ filename[0..2] = "..."
42
+ end
43
+
44
+ # Clean the line with whitespaces so that leftover output from the
45
+ # previous line doesn't show up.
46
+ $stdout.print("\r\e[K") if @last_width && @last_width > 0
47
+ @last_width = progress_bar.size + filename.size
48
+ term = "\r"
49
+ else
50
+ term = "\n"
51
+ end
52
+ $stdout.print(progress_bar, filename, term)
53
+ $stdout.flush
40
54
  end
41
55
 
42
- # Clean the line with whitespaces so that leftover output from the
43
- # previous line doesn't show up.
44
- $stdout.print("\r\e[K") if @last_width && @last_width > 0
45
- @last_width = progress_bar.size + filename.size
46
- term = "\r"
47
- else
48
- term = "\n"
49
- end
50
- $stdout.print(progress_bar, filename, term)
51
- $stdout.flush
52
- end
56
+ def done_adding # :nodoc:
57
+ puts
58
+ end
53
59
 
54
- def done_adding # :nodoc:
55
- puts
60
+ end
56
61
  end
57
-
58
62
  end
@@ -1,59 +1,63 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Stats printer that prints nothing
2
+ module RDoc
3
+ class Stats
4
+ ##
5
+ # Stats printer that prints nothing
4
6
 
5
- class RDoc::Stats::Quiet
7
+ class Quiet
6
8
 
7
- ##
8
- # Creates a new Quiet that will print nothing
9
+ ##
10
+ # Creates a new Quiet that will print nothing
9
11
 
10
- def initialize(num_files)
11
- @num_files = num_files
12
- end
12
+ def initialize(num_files)
13
+ @num_files = num_files
14
+ end
13
15
 
14
- ##
15
- # Prints a message at the beginning of parsing
16
+ ##
17
+ # Prints a message at the beginning of parsing
16
18
 
17
- def begin_adding(*) end
19
+ def begin_adding(*) end
18
20
 
19
- ##
20
- # Prints when an alias is added
21
+ ##
22
+ # Prints when an alias is added
21
23
 
22
- def print_alias(*) end
24
+ def print_alias(*) end
23
25
 
24
- ##
25
- # Prints when an attribute is added
26
+ ##
27
+ # Prints when an attribute is added
26
28
 
27
- def print_attribute(*) end
29
+ def print_attribute(*) end
28
30
 
29
- ##
30
- # Prints when a class is added
31
+ ##
32
+ # Prints when a class is added
31
33
 
32
- def print_class(*) end
34
+ def print_class(*) end
33
35
 
34
- ##
35
- # Prints when a constant is added
36
+ ##
37
+ # Prints when a constant is added
36
38
 
37
- def print_constant(*) end
39
+ def print_constant(*) end
38
40
 
39
- ##
40
- # Prints when a file is added
41
+ ##
42
+ # Prints when a file is added
41
43
 
42
- def print_file(*) end
44
+ def print_file(*) end
43
45
 
44
- ##
45
- # Prints when a method is added
46
+ ##
47
+ # Prints when a method is added
46
48
 
47
- def print_method(*) end
49
+ def print_method(*) end
48
50
 
49
- ##
50
- # Prints when a module is added
51
+ ##
52
+ # Prints when a module is added
51
53
 
52
- def print_module(*) end
54
+ def print_module(*) end
53
55
 
54
- ##
55
- # Prints when RDoc is done
56
+ ##
57
+ # Prints when RDoc is done
56
58
 
57
- def done_adding(*) end
59
+ def done_adding(*) end
58
60
 
61
+ end
62
+ end
59
63
  end
@@ -1,44 +1,48 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Stats printer that prints everything documented, including the documented
4
- # status
2
+ module RDoc
3
+ class Stats
4
+ ##
5
+ # Stats printer that prints everything documented, including the documented
6
+ # status
5
7
 
6
- class RDoc::Stats::Verbose < RDoc::Stats::Normal
8
+ class Verbose < Stats::Normal
7
9
 
8
- ##
9
- # Returns a marker for RDoc::CodeObject +co+ being undocumented
10
+ ##
11
+ # Returns a marker for RDoc::CodeObject +co+ being undocumented
10
12
 
11
- def nodoc(co)
12
- " (undocumented)" unless co.documented?
13
- end
13
+ def nodoc(co)
14
+ " (undocumented)" unless co.documented?
15
+ end
14
16
 
15
- def print_alias(as) # :nodoc:
16
- puts " alias #{as.new_name} #{as.old_name}#{nodoc as}"
17
- end
17
+ def print_alias(as) # :nodoc:
18
+ puts " alias #{as.new_name} #{as.old_name}#{nodoc as}"
19
+ end
18
20
 
19
- def print_attribute(attribute) # :nodoc:
20
- puts " #{attribute.definition} #{attribute.name}#{nodoc attribute}"
21
- end
21
+ def print_attribute(attribute) # :nodoc:
22
+ puts " #{attribute.definition} #{attribute.name}#{nodoc attribute}"
23
+ end
22
24
 
23
- def print_class(klass) # :nodoc:
24
- puts " class #{klass.full_name}#{nodoc klass}"
25
- end
25
+ def print_class(klass) # :nodoc:
26
+ puts " class #{klass.full_name}#{nodoc klass}"
27
+ end
26
28
 
27
- def print_constant(constant) # :nodoc:
28
- puts " #{constant.name}#{nodoc constant}"
29
- end
29
+ def print_constant(constant) # :nodoc:
30
+ puts " #{constant.name}#{nodoc constant}"
31
+ end
30
32
 
31
- def print_file(files_so_far, file) # :nodoc:
32
- super
33
- puts
34
- end
33
+ def print_file(files_so_far, file) # :nodoc:
34
+ super
35
+ puts
36
+ end
35
37
 
36
- def print_method(method) # :nodoc:
37
- puts " #{method.singleton ? '::' : '#'}#{method.name}#{nodoc method}"
38
- end
38
+ def print_method(method) # :nodoc:
39
+ puts " #{method.singleton ? '::' : '#'}#{method.name}#{nodoc method}"
40
+ end
39
41
 
40
- def print_module(mod) # :nodoc:
41
- puts " module #{mod.full_name}#{nodoc mod}"
42
- end
42
+ def print_module(mod) # :nodoc:
43
+ puts " module #{mod.full_name}#{nodoc mod}"
44
+ end
43
45
 
46
+ end
47
+ end
44
48
  end