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,20 +1,24 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # A horizontal rule with a weight
2
+ module RDoc
3
+ class Markup
4
+ ##
5
+ # A horizontal rule with a weight
4
6
 
5
- class RDoc::Markup::Rule < Struct.new :weight
7
+ class Rule < Struct.new :weight
6
8
 
7
- ##
8
- # Calls #accept_rule on +visitor+
9
+ ##
10
+ # Calls #accept_rule on +visitor+
9
11
 
10
- def accept(visitor)
11
- visitor.accept_rule self
12
- end
12
+ def accept(visitor)
13
+ visitor.accept_rule self
14
+ end
15
+
16
+ def pretty_print(q) # :nodoc:
17
+ q.group 2, '[rule:', ']' do
18
+ q.pp weight
19
+ end
20
+ end
13
21
 
14
- def pretty_print(q) # :nodoc:
15
- q.group 2, '[rule:', ']' do
16
- q.pp weight
17
22
  end
18
23
  end
19
-
20
24
  end
@@ -1,144 +1,148 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Outputs RDoc markup with vibrant ANSI color!
2
+ module RDoc
3
+ class Markup
4
+ ##
5
+ # Outputs RDoc markup with vibrant ANSI color!
6
+
7
+ class ToAnsi < Markup::ToRdoc
8
+
9
+ ##
10
+ # Creates a new ToAnsi visitor that is ready to output vibrant ANSI color!
11
+
12
+ def initialize
13
+ super
14
+
15
+ @headings.clear
16
+ @headings[1] = ["\e[1;32m", "\e[m"] # bold
17
+ @headings[2] = ["\e[4;32m", "\e[m"] # underline
18
+ @headings[3] = ["\e[32m", "\e[m"] # just green
19
+ end
20
+
21
+ ##
22
+ # Maps attributes to ANSI sequences
23
+
24
+ ANSI_STYLE_CODES_ON = {
25
+ BOLD: 1,
26
+ TT: 7,
27
+ EM: 4,
28
+ STRIKE: 9
29
+ }
30
+
31
+ ANSI_STYLE_CODES_OFF = {
32
+ BOLD: 22,
33
+ TT: 27,
34
+ EM: 24,
35
+ STRIKE: 29
36
+ }
37
+
38
+ # Apply the given attributes by emitting ANSI sequences.
39
+ # Emitting attribute changes are deferred until new text is added and applied in batch.
40
+ # This method computes the necessary ANSI codes to transition from the
41
+ # current set of applied attributes to the new set of +attributes+.
42
+
43
+ def apply_attributes(attributes)
44
+ before = @applied_attributes
45
+ after = attributes.sort
46
+ return if before == after
47
+
48
+ if after.empty?
49
+ emit_inline("\e[m")
50
+ elsif !before.empty? && before.size > (before & after).size + 1
51
+ codes = after.map {|attr| ANSI_STYLE_CODES_ON[attr] }.compact
52
+ emit_inline("\e[#{[0, *codes].join(';')}m")
53
+ else
54
+ off_codes = (before - after).map {|attr| ANSI_STYLE_CODES_OFF[attr] }.compact
55
+ on_codes = (after - before).map {|attr| ANSI_STYLE_CODES_ON[attr] }.compact
56
+ emit_inline("\e[#{(off_codes + on_codes).join(';')}m")
57
+ end
58
+ @applied_attributes = attributes
59
+ end
60
+
61
+ def add_text(text)
62
+ attrs = @attributes.keys
63
+ if @applied_attributes != attrs
64
+ apply_attributes(attrs)
65
+ end
66
+ emit_inline(text)
67
+ end
68
+
69
+ def handle_inline(text)
70
+ @applied_attributes = []
71
+ res = super
72
+ res << "\e[m" unless @applied_attributes.empty?
73
+ @applied_attributes = []
74
+ res
75
+ end
76
+
77
+ ##
78
+ # Overrides indent width to ensure output lines up correctly.
79
+
80
+ def accept_list_item_end(list_item)
81
+ width = case @list_type.last
82
+ when :BULLET
83
+ 2
84
+ when :NOTE, :LABEL
85
+ if @prefix
86
+ @res << @prefix.strip
87
+ @prefix = nil
88
+ end
89
+
90
+ @res << "\n" unless res.length == 1
91
+ 2
92
+ else
93
+ bullet = @list_index.last.to_s
94
+ @list_index[-1] = @list_index.last.succ
95
+ bullet.length + 2
96
+ end
97
+
98
+ @indent -= width
99
+ end
100
+
101
+ ##
102
+ # Adds coloring to note and label list items
103
+
104
+ def accept_list_item_start(list_item)
105
+ bullet = case @list_type.last
106
+ when :BULLET
107
+ '*'
108
+ when :NOTE, :LABEL
109
+ labels = Array(list_item.label).map do |label|
110
+ attributes(label).strip
111
+ end.join "\n"
112
+
113
+ labels << ":\n" unless labels.empty?
114
+
115
+ labels
116
+ else
117
+ @list_index.last.to_s + '.'
118
+ end
119
+
120
+ case @list_type.last
121
+ when :NOTE, :LABEL
122
+ @indent += 2
123
+ @prefix = bullet + (' ' * @indent)
124
+ else
125
+ @prefix = (' ' * @indent) + bullet.ljust(bullet.length + 1)
126
+
127
+ width = bullet.gsub(/\e\[[\d;]*m/, '').length + 1
128
+
129
+ @indent += width
130
+ end
131
+ end
132
+
133
+ def calculate_text_width(text)
134
+ text.gsub(/\e\[[\d;]*m/, '').size
135
+ end
136
+
137
+ ##
138
+ # Starts accepting with a reset screen
139
+
140
+ def start_accepting
141
+ super
142
+
143
+ @res = ["\e[0m"]
144
+ end
4
145
 
5
- class RDoc::Markup::ToAnsi < RDoc::Markup::ToRdoc
6
-
7
- ##
8
- # Creates a new ToAnsi visitor that is ready to output vibrant ANSI color!
9
-
10
- def initialize(markup = nil)
11
- super
12
-
13
- @headings.clear
14
- @headings[1] = ["\e[1;32m", "\e[m"] # bold
15
- @headings[2] = ["\e[4;32m", "\e[m"] # underline
16
- @headings[3] = ["\e[32m", "\e[m"] # just green
17
- end
18
-
19
- ##
20
- # Maps attributes to ANSI sequences
21
-
22
- ANSI_STYLE_CODES_ON = {
23
- BOLD: 1,
24
- TT: 7,
25
- EM: 4,
26
- STRIKE: 9
27
- }
28
-
29
- ANSI_STYLE_CODES_OFF = {
30
- BOLD: 22,
31
- TT: 27,
32
- EM: 24,
33
- STRIKE: 29
34
- }
35
-
36
- # Apply the given attributes by emitting ANSI sequences.
37
- # Emitting attribute changes are deferred until new text is added and applied in batch.
38
- # This method computes the necessary ANSI codes to transition from the
39
- # current set of applied attributes to the new set of +attributes+.
40
-
41
- def apply_attributes(attributes)
42
- before = @applied_attributes
43
- after = attributes.sort
44
- return if before == after
45
-
46
- if after.empty?
47
- emit_inline("\e[m")
48
- elsif !before.empty? && before.size > (before & after).size + 1
49
- codes = after.map {|attr| ANSI_STYLE_CODES_ON[attr] }.compact
50
- emit_inline("\e[#{[0, *codes].join(';')}m")
51
- else
52
- off_codes = (before - after).map {|attr| ANSI_STYLE_CODES_OFF[attr] }.compact
53
- on_codes = (after - before).map {|attr| ANSI_STYLE_CODES_ON[attr] }.compact
54
- emit_inline("\e[#{(off_codes + on_codes).join(';')}m")
55
- end
56
- @applied_attributes = attributes
57
- end
58
-
59
- def add_text(text)
60
- attrs = @attributes.keys
61
- if @applied_attributes != attrs
62
- apply_attributes(attrs)
63
- end
64
- emit_inline(text)
65
- end
66
-
67
- def handle_inline(text)
68
- @applied_attributes = []
69
- res = super
70
- res << "\e[m" unless @applied_attributes.empty?
71
- @applied_attributes = []
72
- res
73
- end
74
-
75
- ##
76
- # Overrides indent width to ensure output lines up correctly.
77
-
78
- def accept_list_item_end(list_item)
79
- width = case @list_type.last
80
- when :BULLET then
81
- 2
82
- when :NOTE, :LABEL then
83
- if @prefix then
84
- @res << @prefix.strip
85
- @prefix = nil
86
- end
87
-
88
- @res << "\n" unless res.length == 1
89
- 2
90
- else
91
- bullet = @list_index.last.to_s
92
- @list_index[-1] = @list_index.last.succ
93
- bullet.length + 2
94
- end
95
-
96
- @indent -= width
97
- end
98
-
99
- ##
100
- # Adds coloring to note and label list items
101
-
102
- def accept_list_item_start(list_item)
103
- bullet = case @list_type.last
104
- when :BULLET then
105
- '*'
106
- when :NOTE, :LABEL then
107
- labels = Array(list_item.label).map do |label|
108
- attributes(label).strip
109
- end.join "\n"
110
-
111
- labels << ":\n" unless labels.empty?
112
-
113
- labels
114
- else
115
- @list_index.last.to_s + '.'
116
- end
117
-
118
- case @list_type.last
119
- when :NOTE, :LABEL then
120
- @indent += 2
121
- @prefix = bullet + (' ' * @indent)
122
- else
123
- @prefix = (' ' * @indent) + bullet.ljust(bullet.length + 1)
124
-
125
- width = bullet.gsub(/\e\[[\d;]*m/, '').length + 1
126
-
127
- @indent += width
128
146
  end
129
147
  end
130
-
131
- def calculate_text_width(text)
132
- text.gsub(/\e\[[\d;]*m/, '').size
133
- end
134
-
135
- ##
136
- # Starts accepting with a reset screen
137
-
138
- def start_accepting
139
- super
140
-
141
- @res = ["\e[0m"]
142
- end
143
-
144
148
  end
@@ -1,86 +1,90 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Outputs RDoc markup with hot backspace action! You will probably need a
4
- # pager to use this output format.
5
- #
6
- # This formatter won't work on 1.8.6 because it lacks String#chars.
2
+ module RDoc
3
+ class Markup
4
+ ##
5
+ # Outputs RDoc markup with hot backspace action! You will probably need a
6
+ # pager to use this output format.
7
+ #
8
+ # This formatter won't work on 1.8.6 because it lacks String#chars.
7
9
 
8
- class RDoc::Markup::ToBs < RDoc::Markup::ToRdoc
10
+ class ToBs < Markup::ToRdoc
9
11
 
10
- ##
11
- # Returns a new ToBs that is ready for hot backspace action!
12
+ ##
13
+ # Returns a new ToBs that is ready for hot backspace action!
12
14
 
13
- def initialize(markup = nil)
14
- super
15
+ def initialize
16
+ super
15
17
 
16
- @in_b = false
17
- @in_em = false
18
- end
19
-
20
- def handle_inline(text)
21
- initial_style = []
22
- initial_style << :BOLD if @in_b
23
- initial_style << :EM if @in_em
24
- super(text, initial_style)
25
- end
18
+ @in_b = false
19
+ @in_em = false
20
+ end
26
21
 
27
- def add_text(text)
28
- attrs = @attributes.keys
29
- if attrs.include? :BOLD
30
- styled = +''
31
- text.chars.each do |c|
32
- styled << "#{c}\b#{c}"
22
+ def handle_inline(text)
23
+ initial_style = []
24
+ initial_style << :BOLD if @in_b
25
+ initial_style << :EM if @in_em
26
+ super(text, initial_style)
33
27
  end
34
- text = styled
35
- elsif attrs.include? :EM
36
- styled = +''
37
- text.chars.each do |c|
38
- styled << "_\b#{c}"
28
+
29
+ def add_text(text)
30
+ attrs = @attributes.keys
31
+ if attrs.include? :BOLD
32
+ styled = +''
33
+ text.chars.each do |c|
34
+ styled << "#{c}\b#{c}"
35
+ end
36
+ text = styled
37
+ elsif attrs.include? :EM
38
+ styled = +''
39
+ text.chars.each do |c|
40
+ styled << "_\b#{c}"
41
+ end
42
+ text = styled
43
+ end
44
+ emit_inline(text)
39
45
  end
40
- text = styled
41
- end
42
- emit_inline(text)
43
- end
44
46
 
45
- ##
46
- # Makes heading text bold.
47
+ ##
48
+ # Makes heading text bold.
47
49
 
48
- def accept_heading(heading)
49
- use_prefix or @res << ' ' * @indent
50
- @res << @headings[heading.level][0]
51
- @in_b = true
52
- @res << attributes(heading.text)
53
- @in_b = false
54
- @res << @headings[heading.level][1]
55
- @res << "\n"
56
- end
50
+ def accept_heading(heading)
51
+ use_prefix or @res << ' ' * @indent
52
+ @res << @headings[heading.level][0]
53
+ @in_b = true
54
+ @res << attributes(heading.text)
55
+ @in_b = false
56
+ @res << @headings[heading.level][1]
57
+ @res << "\n"
58
+ end
57
59
 
58
- ##
59
- # Prepares the visitor for consuming +list_item+
60
+ ##
61
+ # Prepares the visitor for consuming +list_item+
60
62
 
61
- def accept_list_item_start(list_item)
62
- type = @list_type.last
63
+ def accept_list_item_start(list_item)
64
+ type = @list_type.last
63
65
 
64
- case type
65
- when :NOTE, :LABEL then
66
- bullets = Array(list_item.label).map do |label|
67
- attributes(label).strip
68
- end.join "\n"
66
+ case type
67
+ when :NOTE, :LABEL
68
+ bullets = Array(list_item.label).map do |label|
69
+ attributes(label).strip
70
+ end.join "\n"
69
71
 
70
- bullets << ":\n" unless bullets.empty?
72
+ bullets << ":\n" unless bullets.empty?
71
73
 
72
- @prefix = ' ' * @indent
73
- @indent += 2
74
- @prefix << bullets + (' ' * @indent)
75
- else
76
- bullet = type == :BULLET ? '*' : @list_index.last.to_s + '.'
77
- @prefix = (' ' * @indent) + bullet.ljust(bullet.length + 1)
78
- width = bullet.length + 1
79
- @indent += width
80
- end
81
- end
74
+ @prefix = ' ' * @indent
75
+ @indent += 2
76
+ @prefix << bullets + (' ' * @indent)
77
+ else
78
+ bullet = type == :BULLET ? '*' : @list_index.last.to_s + '.'
79
+ @prefix = (' ' * @indent) + bullet.ljust(bullet.length + 1)
80
+ width = bullet.length + 1
81
+ @indent += width
82
+ end
83
+ end
82
84
 
83
- def calculate_text_width(text)
84
- text.gsub(/_\x08/, '').gsub(/\x08./, '').size
85
+ def calculate_text_width(text)
86
+ text.gsub(/_\x08/, '').gsub(/\x08./, '').size
87
+ end
88
+ end
85
89
  end
86
90
  end