rdoc 6.3.4.1 → 8.0.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 (205) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +195 -0
  3. data/History.rdoc +65 -63
  4. data/LEGAL.rdoc +7 -1
  5. data/LICENSE.rdoc +6 -0
  6. data/README.md +236 -0
  7. data/RI.md +842 -0
  8. data/TODO.rdoc +8 -7
  9. data/doc/markup_reference/markdown.md +659 -0
  10. data/doc/markup_reference/rdoc.rdoc +1169 -0
  11. data/exe/rdoc +0 -1
  12. data/lib/rdoc/{alias.rb → code_object/alias.rb} +4 -18
  13. data/lib/rdoc/{any_method.rb → code_object/any_method.rb} +50 -24
  14. data/lib/rdoc/{attr.rb → code_object/attr.rb} +16 -14
  15. data/lib/rdoc/{class_module.rb → code_object/class_module.rb} +225 -58
  16. data/lib/rdoc/{constant.rb → code_object/constant.rb} +44 -10
  17. data/lib/rdoc/code_object/context/section.rb +182 -0
  18. data/lib/rdoc/{context.rb → code_object/context.rb} +78 -106
  19. data/lib/rdoc/{extend.rb → code_object/extend.rb} +0 -1
  20. data/lib/rdoc/{include.rb → code_object/include.rb} +0 -1
  21. data/lib/rdoc/{method_attr.rb → code_object/method_attr.rb} +46 -48
  22. data/lib/rdoc/{mixin.rb → code_object/mixin.rb} +6 -4
  23. data/lib/rdoc/{normal_class.rb → code_object/normal_class.rb} +2 -3
  24. data/lib/rdoc/{normal_module.rb → code_object/normal_module.rb} +2 -3
  25. data/lib/rdoc/{require.rb → code_object/require.rb} +1 -2
  26. data/lib/rdoc/{single_class.rb → code_object/single_class.rb} +5 -1
  27. data/lib/rdoc/{top_level.rb → code_object/top_level.rb} +60 -63
  28. data/lib/rdoc/code_object.rb +11 -39
  29. data/lib/rdoc/code_objects.rb +1 -2
  30. data/lib/rdoc/comment.rb +202 -99
  31. data/lib/rdoc/cross_reference.rb +75 -62
  32. data/lib/rdoc/encoding.rb +8 -24
  33. data/lib/rdoc/erb_partial.rb +1 -2
  34. data/lib/rdoc/erbio.rb +3 -8
  35. data/lib/rdoc/generator/aliki.rb +200 -0
  36. data/lib/rdoc/generator/darkfish.rb +156 -122
  37. data/lib/rdoc/generator/json_index.rb +8 -24
  38. data/lib/rdoc/generator/markup.rb +70 -34
  39. data/lib/rdoc/generator/pot/message_extractor.rb +7 -7
  40. data/lib/rdoc/generator/pot/po.rb +1 -1
  41. data/lib/rdoc/generator/pot/po_entry.rb +8 -8
  42. data/lib/rdoc/generator/pot.rb +1 -5
  43. data/lib/rdoc/generator/ri.rb +1 -2
  44. data/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
  45. data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
  46. data/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
  47. data/lib/rdoc/generator/template/aliki/_head.rhtml +163 -0
  48. data/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
  49. data/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
  50. data/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
  51. data/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
  52. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +27 -0
  53. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +27 -0
  54. data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
  55. data/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
  56. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
  57. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
  58. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
  59. data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
  60. data/lib/rdoc/generator/template/aliki/class.rhtml +230 -0
  61. data/lib/rdoc/generator/template/aliki/css/rdoc.css +2181 -0
  62. data/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
  63. data/lib/rdoc/generator/template/aliki/js/aliki.js +513 -0
  64. data/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
  65. data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
  66. data/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
  67. data/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
  68. data/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
  69. data/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
  70. data/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
  71. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
  72. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
  73. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +3 -3
  74. data/lib/rdoc/generator/template/darkfish/_head.rhtml +35 -14
  75. data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +1 -5
  76. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +11 -9
  77. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +11 -9
  78. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +7 -6
  79. data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +20 -11
  80. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +25 -5
  81. data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +4 -9
  82. data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +2 -1
  83. data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +4 -4
  84. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +28 -7
  85. data/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
  86. data/lib/rdoc/generator/template/darkfish/class.rhtml +138 -90
  87. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +420 -358
  88. data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
  89. data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
  90. data/lib/rdoc/generator/template/darkfish/index.rhtml +14 -12
  91. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +59 -3
  92. data/lib/rdoc/generator/template/darkfish/js/search.js +15 -5
  93. data/lib/rdoc/generator/template/darkfish/page.rhtml +7 -6
  94. data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +12 -9
  95. data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +24 -21
  96. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +35 -21
  97. data/lib/rdoc/generator/template/json_index/js/navigation.js +8 -8
  98. data/lib/rdoc/generator/template/json_index/js/searcher.js +48 -6
  99. data/lib/rdoc/generator.rb +6 -5
  100. data/lib/rdoc/i18n/text.rb +3 -3
  101. data/lib/rdoc/i18n.rb +1 -1
  102. data/lib/rdoc/known_classes.rb +5 -4
  103. data/lib/rdoc/markdown/entities.rb +0 -1
  104. data/lib/rdoc/markdown/literals.kpeg +0 -2
  105. data/lib/rdoc/markdown/literals.rb +0 -1
  106. data/lib/rdoc/markdown.kpeg +140 -62
  107. data/lib/rdoc/markdown.rb +1015 -873
  108. data/lib/rdoc/markup/blank_line.rb +25 -24
  109. data/lib/rdoc/markup/block_quote.rb +1 -2
  110. data/lib/rdoc/markup/document.rb +10 -11
  111. data/lib/rdoc/markup/element.rb +21 -0
  112. data/lib/rdoc/markup/formatter.rb +134 -115
  113. data/lib/rdoc/markup/hard_break.rb +30 -28
  114. data/lib/rdoc/markup/heading.rb +163 -72
  115. data/lib/rdoc/markup/include.rb +3 -4
  116. data/lib/rdoc/markup/indented_paragraph.rb +4 -5
  117. data/lib/rdoc/markup/inline_parser.rb +312 -0
  118. data/lib/rdoc/markup/list.rb +6 -7
  119. data/lib/rdoc/markup/list_item.rb +6 -7
  120. data/lib/rdoc/markup/paragraph.rb +2 -3
  121. data/lib/rdoc/markup/parser.rb +29 -19
  122. data/lib/rdoc/markup/pre_process.rb +39 -18
  123. data/lib/rdoc/markup/raw.rb +52 -56
  124. data/lib/rdoc/markup/rule.rb +2 -3
  125. data/lib/rdoc/markup/table.rb +49 -32
  126. data/lib/rdoc/markup/to_ansi.rb +58 -8
  127. data/lib/rdoc/markup/to_bs.rb +47 -38
  128. data/lib/rdoc/markup/to_html.rb +343 -105
  129. data/lib/rdoc/markup/to_html_crossref.rb +143 -58
  130. data/lib/rdoc/markup/to_html_snippet.rb +78 -76
  131. data/lib/rdoc/markup/to_joined_paragraph.rb +3 -9
  132. data/lib/rdoc/markup/to_label.rb +34 -25
  133. data/lib/rdoc/markup/to_markdown.rb +74 -51
  134. data/lib/rdoc/markup/to_rdoc.rb +141 -82
  135. data/lib/rdoc/markup/to_table_of_contents.rb +4 -5
  136. data/lib/rdoc/markup/to_test.rb +10 -3
  137. data/lib/rdoc/markup/to_tt_only.rb +17 -31
  138. data/lib/rdoc/markup/verbatim.rb +5 -6
  139. data/lib/rdoc/markup.rb +59 -707
  140. data/lib/rdoc/options.rb +228 -101
  141. data/lib/rdoc/parser/c.rb +186 -184
  142. data/lib/rdoc/parser/changelog.rb +57 -13
  143. data/lib/rdoc/parser/markdown.rb +0 -2
  144. data/lib/rdoc/parser/rbs.rb +275 -0
  145. data/lib/rdoc/parser/rd.rb +0 -1
  146. data/lib/rdoc/parser/ruby.rb +963 -2024
  147. data/lib/rdoc/parser/ruby_colorizer.rb +253 -0
  148. data/lib/rdoc/parser/simple.rb +6 -23
  149. data/lib/rdoc/parser/text.rb +0 -1
  150. data/lib/rdoc/parser.rb +35 -14
  151. data/lib/rdoc/rbs_helper.rb +186 -0
  152. data/lib/rdoc/rd/block_parser.rb +659 -11
  153. data/lib/rdoc/rd/block_parser.ry +13 -9
  154. data/lib/rdoc/rd/inline.rb +4 -5
  155. data/lib/rdoc/rd/inline_parser.rb +646 -2
  156. data/lib/rdoc/rd.rb +4 -5
  157. data/lib/rdoc/rdoc.rb +234 -90
  158. data/lib/rdoc/ri/driver.rb +172 -172
  159. data/lib/rdoc/ri/paths.rb +3 -3
  160. data/lib/rdoc/{servlet.rb → ri/servlet.rb} +28 -27
  161. data/lib/rdoc/ri/store.rb +0 -1
  162. data/lib/rdoc/ri/task.rb +3 -3
  163. data/lib/rdoc/ri.rb +5 -5
  164. data/lib/rdoc/rubygems_hook.rb +106 -25
  165. data/lib/rdoc/server.rb +460 -0
  166. data/lib/rdoc/stats/normal.rb +1 -1
  167. data/lib/rdoc/stats/quiet.rb +1 -2
  168. data/lib/rdoc/stats/verbose.rb +3 -5
  169. data/lib/rdoc/stats.rb +158 -136
  170. data/lib/rdoc/store.rb +267 -48
  171. data/lib/rdoc/task.rb +54 -28
  172. data/lib/rdoc/text.rb +60 -120
  173. data/lib/rdoc/token_stream.rb +30 -45
  174. data/lib/rdoc/tom_doc.rb +9 -15
  175. data/lib/rdoc/version.rb +3 -1
  176. data/lib/rdoc.rb +90 -52
  177. data/lib/rubygems_plugin.rb +14 -0
  178. data/man/ri.1 +2 -0
  179. data/rdoc-logo.svg +43 -0
  180. data/rdoc.gemspec +25 -200
  181. metadata +120 -53
  182. data/CONTRIBUTING.rdoc +0 -220
  183. data/ExampleMarkdown.md +0 -37
  184. data/ExampleRDoc.rdoc +0 -208
  185. data/Gemfile +0 -12
  186. data/README.rdoc +0 -129
  187. data/RI.rdoc +0 -57
  188. data/Rakefile +0 -101
  189. data/bin/console +0 -7
  190. data/bin/setup +0 -6
  191. data/lib/rdoc/anon_class.rb +0 -11
  192. data/lib/rdoc/context/section.rb +0 -232
  193. data/lib/rdoc/generator/template/darkfish/.document +0 -0
  194. data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +0 -19
  195. data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +0 -9
  196. data/lib/rdoc/generator/template/json_index/.document +0 -1
  197. data/lib/rdoc/ghost_method.rb +0 -7
  198. data/lib/rdoc/markup/attr_changer.rb +0 -23
  199. data/lib/rdoc/markup/attr_span.rb +0 -36
  200. data/lib/rdoc/markup/attribute_manager.rb +0 -409
  201. data/lib/rdoc/markup/attributes.rb +0 -71
  202. data/lib/rdoc/markup/regexp_handling.rb +0 -41
  203. data/lib/rdoc/meta_method.rb +0 -7
  204. data/lib/rdoc/parser/ripper_state_lex.rb +0 -590
  205. data/lib/rdoc/parser/ruby_tools.rb +0 -167
@@ -86,12 +86,10 @@ class RDoc::Generator::JsonIndex
86
86
  attr_reader :index # :nodoc:
87
87
 
88
88
  ##
89
- # Creates a new generator. +parent_generator+ is used to determine the
90
- # class_dir and file_dir of links in the output index.
91
- #
89
+ # Creates a new generator.
92
90
  # +options+ are the same options passed to the parent generator.
93
91
 
94
- def initialize parent_generator, options
92
+ def initialize(parent_generator, options)
95
93
  @parent_generator = parent_generator
96
94
  @store = parent_generator.store
97
95
  @options = options
@@ -120,7 +118,7 @@ class RDoc::Generator::JsonIndex
120
118
  ##
121
119
  # Output progress information if debugging is enabled
122
120
 
123
- def debug_msg *msg
121
+ def debug_msg(*msg)
124
122
  return unless $DEBUG_RDOC
125
123
  $stderr.puts(*msg)
126
124
  end
@@ -230,9 +228,9 @@ class RDoc::Generator::JsonIndex
230
228
  def index_methods
231
229
  debug_msg " generating method search index"
232
230
 
233
- list = @classes.uniq.map do |klass|
231
+ list = @classes.uniq.flat_map do |klass|
234
232
  klass.method_list
235
- end.flatten.sort_by do |method|
233
+ end.sort_by do |method|
236
234
  [method.name, method.parent.full_name]
237
235
  end
238
236
 
@@ -252,7 +250,7 @@ class RDoc::Generator::JsonIndex
252
250
  debug_msg " generating pages search index"
253
251
 
254
252
  pages = @files.select do |file|
255
- file.text?
253
+ file.text? && file.full_name != @options.main_page
256
254
  end
257
255
 
258
256
  pages.each do |page|
@@ -265,21 +263,7 @@ class RDoc::Generator::JsonIndex
265
263
  end
266
264
  end
267
265
 
268
- ##
269
- # The directory classes are written to
270
-
271
- def class_dir
272
- @parent_generator.class_dir
273
- end
274
-
275
- ##
276
- # The directory files are written to
277
-
278
- def file_dir
279
- @parent_generator.file_dir
280
- end
281
-
282
- def reset files, classes # :nodoc:
266
+ def reset(files, classes) # :nodoc:
283
267
  @files = files
284
268
  @classes = classes
285
269
 
@@ -293,7 +277,7 @@ class RDoc::Generator::JsonIndex
293
277
  ##
294
278
  # Removes whitespace and downcases +string+
295
279
 
296
- def search_string string
280
+ def search_string(string)
297
281
  string.downcase.gsub(/\s/, '')
298
282
  end
299
283
 
@@ -34,10 +34,18 @@ module RDoc::Generator::Markup
34
34
  def formatter
35
35
  return @formatter if defined? @formatter
36
36
 
37
- options = @store.rdoc.options
37
+ options = @store.options
38
38
  this = RDoc::Context === self ? self : @parent
39
39
 
40
- @formatter = RDoc::Markup::ToHtmlCrossref.new options, this.path, this
40
+ @formatter = RDoc::Markup::ToHtmlCrossref.new(
41
+ this.path, this,
42
+ pipe: options.pipe,
43
+ output_decoration: options.output_decoration,
44
+ hyperlink_all: options.hyperlink_all,
45
+ show_hash: options.show_hash,
46
+ autolink_excluded_words: options.autolink_excluded_words || [],
47
+ warn_missing_rdoc_ref: options.warn_missing_rdoc_ref
48
+ )
41
49
  @formatter.code_object = self
42
50
  @formatter
43
51
  end
@@ -55,6 +63,18 @@ module RDoc::Generator::Markup
55
63
  end
56
64
  end
57
65
 
66
+ ##
67
+ # The preferred URL for this object.
68
+
69
+ def canonical_url
70
+ options = @store.options
71
+ if path
72
+ File.join(options.canonical_root, path.to_s)
73
+ else
74
+ options.canonical_root
75
+ end
76
+ end
77
+
58
78
  end
59
79
 
60
80
  class RDoc::CodeObject
@@ -63,60 +83,77 @@ class RDoc::CodeObject
63
83
 
64
84
  end
65
85
 
86
+ class RDoc::AnyMethod
87
+
88
+ ##
89
+ # Creates an HTML link to the superclass method called by this method.
90
+
91
+ def superclass_method_link
92
+ target = superclass_method
93
+ return unless target
94
+
95
+ html_formatter = formatter
96
+ name = target.full_name
97
+
98
+ html_formatter.link name, html_formatter.convert_string(name)
99
+ end
100
+
101
+ end
102
+
66
103
  class RDoc::MethodAttr
67
104
 
68
105
  ##
69
- # Prepend +src+ with line numbers. Relies on the first line of a source
70
- # code listing having:
71
- #
72
- # # File xxxxx, line dddd
73
- #
74
- # If it has this comment then line numbers are added to +src+ and the <tt>,
75
- # line dddd</tt> portion of the comment is removed.
106
+ # Prepend +src+ with line numbers.
76
107
 
77
108
  def add_line_numbers(src)
78
- return unless src.sub!(/\A(.*)(, line (\d+))/, '\1')
79
- first = $3.to_i - 1
80
- last = first + src.count("\n")
81
- size = last.to_s.length
109
+ return if src.empty? || !line
110
+ start_line = line
111
+ end_line = start_line + src.count("\n")
112
+ number_digits = end_line.to_s.length
82
113
 
83
- line = first
114
+ current_line = start_line
84
115
  src.gsub!(/^/) do
85
- res = if line == first then
86
- " " * (size + 1)
87
- else
88
- "<span class=\"line-num\">%2$*1$d</span> " % [size, line]
89
- end
116
+ res = "<span class=\"line-num\">#{current_line.to_s.rjust(number_digits)}</span> "
90
117
 
91
- line += 1
118
+ current_line += 1
92
119
  res
93
120
  end
94
121
  end
95
122
 
123
+ ##
124
+ # Prepend +src+ with a comment that declares its location in the source.
125
+
126
+ def add_location_comment(src)
127
+ path = CGI.escapeHTML(file.relative_name)
128
+ if options.line_numbers && !src.empty?
129
+ src.prepend("<span class=\"ruby-comment\"># File #{path}</span>\n")
130
+ else
131
+ src.prepend("<span class=\"ruby-comment\"># File #{path}, line #{line}</span>\n")
132
+ end
133
+ end
134
+
96
135
  ##
97
136
  # Turns the method's token stream into HTML.
98
137
  #
99
138
  # Prepends line numbers if +options.line_numbers+ is true.
100
139
 
101
140
  def markup_code
102
- return '' unless @token_stream
141
+ return '' if !@token_stream
103
142
 
104
143
  src = RDoc::TokenStream.to_html @token_stream
105
144
 
106
145
  # dedent the source
107
- indent = src.length
108
- lines = src.lines.to_a
109
- lines.shift if src =~ /\A.*#\ *File/i # remove '# File' comment
110
- lines.each do |line|
111
- if line =~ /^ *(?=\S)/
112
- n = $&.length
113
- indent = n if n < indent
114
- break if n == 0
115
- end
146
+ common_indent = src.length
147
+ src.scan(/^ *(?=\S)/) do |whitespace|
148
+ common_indent = whitespace.length if whitespace.length < common_indent
149
+ break if common_indent == 0
116
150
  end
117
- src.gsub!(/^#{' ' * indent}/, '') if indent > 0
151
+ src.gsub!(/^#{' ' * common_indent}/, '') if common_indent > 0
118
152
 
119
- add_line_numbers(src) if options.line_numbers
153
+ if source_language == 'ruby'
154
+ add_line_numbers(src) if options.line_numbers
155
+ add_location_comment(src)
156
+ end
120
157
 
121
158
  src
122
159
  end
@@ -147,7 +184,7 @@ class RDoc::TopLevel
147
184
  # command line option to set.
148
185
 
149
186
  def cvs_url
150
- url = @store.rdoc.options.webcvs
187
+ url = @store.options.webcvs
151
188
 
152
189
  if /%s/ =~ url then
153
190
  url % @relative_name
@@ -157,4 +194,3 @@ class RDoc::TopLevel
157
194
  end
158
195
 
159
196
  end
160
-
@@ -7,7 +7,7 @@ class RDoc::Generator::POT::MessageExtractor
7
7
  ##
8
8
  # Creates a message extractor for +store+.
9
9
 
10
- def initialize store
10
+ def initialize(store)
11
11
  @store = store
12
12
  @po = RDoc::Generator::POT::PO.new
13
13
  end
@@ -25,21 +25,21 @@ class RDoc::Generator::POT::MessageExtractor
25
25
 
26
26
  private
27
27
 
28
- def extract_from_klass klass
28
+ def extract_from_klass(klass)
29
29
  extract_text(klass.comment_location, klass.full_name)
30
30
 
31
31
  klass.each_section do |section, constants, attributes|
32
- extract_text(section.title ,"#{klass.full_name}: section title")
32
+ extract_text(section.title, "#{klass.full_name}: section title")
33
33
  section.comments.each do |comment|
34
34
  extract_text(comment, "#{klass.full_name}: #{section.title}")
35
35
  end
36
36
  end
37
37
 
38
- klass.each_constant do |constant|
38
+ klass.constants.each do |constant|
39
39
  extract_text(constant.comment, constant.full_name)
40
40
  end
41
41
 
42
- klass.each_attribute do |attribute|
42
+ klass.attributes.each do |attribute|
43
43
  extract_text(attribute.comment, attribute.full_name)
44
44
  end
45
45
 
@@ -48,7 +48,7 @@ class RDoc::Generator::POT::MessageExtractor
48
48
  end
49
49
  end
50
50
 
51
- def extract_text text, comment, location = nil
51
+ def extract_text(text, comment, location = nil)
52
52
  return if text.nil?
53
53
 
54
54
  options = {
@@ -61,7 +61,7 @@ class RDoc::Generator::POT::MessageExtractor
61
61
  end
62
62
  end
63
63
 
64
- def entry msgid, options
64
+ def entry(msgid, options)
65
65
  RDoc::Generator::POT::POEntry.new(msgid, options)
66
66
  end
67
67
 
@@ -15,7 +15,7 @@ class RDoc::Generator::POT::PO
15
15
  ##
16
16
  # Adds a PO entry to the PO.
17
17
 
18
- def add entry
18
+ def add(entry)
19
19
  existing_entry = @entries[entry.msgid]
20
20
  if existing_entry
21
21
  entry = existing_entry.merge(entry)
@@ -23,10 +23,10 @@ class RDoc::Generator::POT::POEntry
23
23
  attr_reader :flags
24
24
 
25
25
  ##
26
- # Creates a PO entry for +msgid+. Other valus can be specified by
26
+ # Creates a PO entry for +msgid+. Other values can be specified by
27
27
  # +options+.
28
28
 
29
- def initialize msgid, options = {}
29
+ def initialize(msgid, options = {})
30
30
  @msgid = msgid
31
31
  @msgstr = options[:msgstr] || ""
32
32
  @translator_comment = options[:translator_comment]
@@ -53,7 +53,7 @@ msgstr #{format_message(@msgstr)}
53
53
  ##
54
54
  # Merges the PO entry with +other_entry+.
55
55
 
56
- def merge other_entry
56
+ def merge(other_entry)
57
57
  options = {
58
58
  :extracted_comment => merge_string(@extracted_comment,
59
59
  other_entry.extracted_comment),
@@ -69,7 +69,7 @@ msgstr #{format_message(@msgstr)}
69
69
 
70
70
  private
71
71
 
72
- def format_comment mark, comment
72
+ def format_comment(mark, comment)
73
73
  return '' unless comment
74
74
  return '' if comment.empty?
75
75
 
@@ -106,7 +106,7 @@ msgstr #{format_message(@msgstr)}
106
106
  "\#, #{formatted_flags}\n"
107
107
  end
108
108
 
109
- def format_message message
109
+ def format_message(message)
110
110
  return "\"#{escape(message)}\"" unless message.include?("\n")
111
111
 
112
112
  formatted_message = '""'
@@ -117,7 +117,7 @@ msgstr #{format_message(@msgstr)}
117
117
  formatted_message
118
118
  end
119
119
 
120
- def escape string
120
+ def escape(string)
121
121
  string.gsub(/["\\\t\n]/) do |special_character|
122
122
  case special_character
123
123
  when "\t"
@@ -130,11 +130,11 @@ msgstr #{format_message(@msgstr)}
130
130
  end
131
131
  end
132
132
 
133
- def merge_string string1, string2
133
+ def merge_string(string1, string2)
134
134
  [string1, string2].compact.join("\n")
135
135
  end
136
136
 
137
- def merge_array array1, array2
137
+ def merge_array(array1, array2)
138
138
  (array1 + array2).uniq
139
139
  end
140
140
 
@@ -65,7 +65,7 @@ class RDoc::Generator::POT
65
65
  ##
66
66
  # Set up a new .pot generator
67
67
 
68
- def initialize store, options #:not-new:
68
+ def initialize(store, options) #:not-new:
69
69
  @options = options
70
70
  @store = store
71
71
  end
@@ -81,10 +81,6 @@ class RDoc::Generator::POT
81
81
  end
82
82
  end
83
83
 
84
- def class_dir
85
- nil
86
- end
87
-
88
84
  private
89
85
  def extract_messages
90
86
  extractor = MessageExtractor.new(@store)
@@ -14,7 +14,7 @@ class RDoc::Generator::RI
14
14
  ##
15
15
  # Set up a new ri generator
16
16
 
17
- def initialize store, options #:not-new:
17
+ def initialize(store, options) #:not-new:
18
18
  @options = options
19
19
  @store = store
20
20
  @store.path = '.'
@@ -28,4 +28,3 @@ class RDoc::Generator::RI
28
28
  end
29
29
 
30
30
  end
31
-